Skip to contentSkip to conversation

x86/build: also handle .comment.* in linker script

PATCH In review Jan Beulich 2 participants 2 messages Mar 21, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/build: also handle .comment.* in linker script

Oldish SUSE compilers generate .comment.SUSE.OPTS sections. Just like we already discard such for xen.efi, fold them into .comment for xen-syms.

---
Just like for .comment itself I also wouldn't mind discarding these also for the non-EFI case.

xen/arch/x86/xen.lds.S +1 -1
@@ -454,7 +454,7 @@ SECTIONS
   .stab.exclstr 0 : { *(.stab.exclstr) }
   .stab.index 0 : { *(.stab.index) }
   .stab.indexstr 0 : { *(.stab.indexstr) }
-  .comment 0 : { *(.comment) }
+  .comment 0 : { *(.comment) *(.comment.*) }
   /*
    * LLVM ld also wants .symtab, .strtab, and .shstrtab placed. These look to
    * be benign to GNU ld, so we can have them here unconditionally.
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Jan Beulich

Oldish SUSE compilers generate .comment.SUSE.OPTS sections. Just like we already discard such for xen.efi, fold them into .comment for xen-syms.

Quoted 3 lines

---
Just like for .comment itself I also wouldn't mind discarding these also for the non-EFI case.

I guess there's a reason for compilers to add additional comments, and we shouldn't discard those randomly?

In any case they won't be loaded, so I don't see much issue with having them on the binary image.

Thanks, Roger.