diff mbox series

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

Message ID 1eaec57f-7a6a-bfd2-82f1-df25f86b69d6@suse.com (mailing list archive)
State New, archived
Headers show
Series x86/build: also handle .comment.* in linker script | expand

Commit Message

Jan Beulich March 21, 2022, 11:47 a.m. UTC
Oldish SUSE compilers generate .comment.SUSE.OPTS sections. Just like we
already discard such for xen.efi, fold them into .comment for xen-syms.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Just like for .comment itself I also wouldn't mind discarding these also
for the non-EFI case.

Comments

Roger Pau Monné March 21, 2022, noon UTC | #1
On Mon, Mar 21, 2022 at 12:47:27PM +0100, Jan Beulich wrote:
> Oldish SUSE compilers generate .comment.SUSE.OPTS sections. Just like we
> already discard such for xen.efi, fold them into .comment for xen-syms.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>

> ---
> 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.
diff mbox series

Patch

--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -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.