[PATCH v1 3/4] livepatch-gcc: Ignore buildid.o

Mihails Strasuns posted 4 patches 3 years ago
[PATCH v1 3/4] livepatch-gcc: Ignore buildid.o
Posted by Mihails Strasuns 3 years ago
From: Raphael Ning <raphning@amazon.com>

Not all .o files generated by the Xen build need to be passed to
create-diff-object for analysis. The latest example is:

 Run create-diff-object on xen/arch/x86/efi/buildid.o
 Open base
 /usr/libexec/livepatch-build-tools/create-diff-object: ERROR: buildid.o: kpatch_create_section_list: 77: elf_getshdrnum

This file is special, as it does not contain any sections. It is
generated by objcopy from a magic string of bytes (see Xen commit
eee5909e9d1e x86/EFI: use less crude a way of generating the build ID),
which probably will never change. Therefore, livepatch-gcc should not
copy it to the output directory.

Signed-off-by: Raphael Ning <raphning@amazon.com>
Reviewed-by: Bjoern Doebel <doebel@amazon.de>
Reviewed-by: Martin Pohlack <mpohlack@amazon.de>

CR: https://code.amazon.com/reviews/CR-63147772
---
 livepatch-gcc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/livepatch-gcc b/livepatch-gcc
index 91333d5..e72cc8d 100755
--- a/livepatch-gcc
+++ b/livepatch-gcc
@@ -65,6 +65,7 @@ elif [[ "$TOOLCHAINCMD" =~ $OBJCOPY_RE ]] ; then
         version.o|\
         debug.o|\
         efi/check.o|\
+        buildid.o|\
         .*.o)
             ;;
         *.o)
-- 
2.38.1




Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879
Re: [PATCH v1 3/4] livepatch-gcc: Ignore buildid.o
Posted by Ross Lagerwall 2 years, 11 months ago
> From: Xen-devel <xen-devel-bounces@lists.xenproject.org> on behalf of Mihails Strasuns <mstrasun@amazon.com>
> Sent: Thursday, January 19, 2023 10:13 AM
> To: xen-devel@lists.xenproject.org <xen-devel@lists.xenproject.org>
> Cc: mstrasun@amazon.com <mstrasun@amazon.com>; Raphael Ning <raphning@amazon.com>; Bjoern Doebel <doebel@amazon.de>; Martin Pohlack <mpohlack@amazon.de>
> Subject: [PATCH v1 3/4] livepatch-gcc: Ignore buildid.o 
>  
> From: Raphael Ning <raphning@amazon.com>
> 
> Not all .o files generated by the Xen build need to be passed to
> create-diff-object for analysis. The latest example is:
> 
>  Run create-diff-object on xen/arch/x86/efi/buildid.o
>  Open base
>  /usr/libexec/livepatch-build-tools/create-diff-object: ERROR: buildid.o: kpatch_create_section_list: 77: elf_getshdrnum
> 
> This file is special, as it does not contain any sections. It is
> generated by objcopy from a magic string of bytes (see Xen commit
> eee5909e9d1e x86/EFI: use less crude a way of generating the build ID),
> which probably will never change. Therefore, livepatch-gcc should not
> copy it to the output directory.
> 
> Signed-off-by: Raphael Ning <raphning@amazon.com>
> Reviewed-by: Bjoern Doebel <doebel@amazon.de>
> Reviewed-by: Martin Pohlack <mpohlack@amazon.de>
> 

Reviewed-by: Ross Lagerwall <ross.lagerwall@citrix.com>