]> xenbits.xensource.com Git - xen.git/commitdiff
x86/boot: Explicitly list .{sym,shstr,str}tab in build32.lds.S
authorFrediano Ziglio <frediano.ziglio@cloud.com>
Tue, 5 Nov 2024 14:13:43 +0000 (14:13 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 6 Nov 2024 13:47:23 +0000 (13:47 +0000)
Currently, building with LLVM's LLD fails:

    ld -melf_i386_fbsd  --orphan-handling=error -N -T ...
    ld: error: <internal>:(.symtab) is being placed in '.symtab'
    ld: error: <internal>:(.shstrtab) is being placed in '.shstrtab'
    ld: error: <internal>:(.strtab) is being placed in '.strtab'
    gmake[11]: *** [arch/x86/boot/Makefile:69: arch/x86/boot/built-in-32.base.bin] Error 1

This is a consequence of --orphan-handling, and it appears that Binutils
doesn't diagnose some orphaned sections even explicitly asked to do so.

List the sections explicitly.

Fixes: aa9045e77130 ('x86/boot: Rework how 32bit C is linked/included for early boot')
Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/boot/build32.lds.S

index 9b29f0184fb8480839daf6b409f20ca1082914c4..1e59732edd6ee15390832a4cd9ad68279df3e49b 100644 (file)
@@ -66,6 +66,15 @@ SECTIONS
        *(.comment.*)
        *(.note.*)
   }
+  .shstrtab : {
+       *(.shstrtab)
+  }
+  .strtab : {
+       *(.strtab)
+  }
+  .symtab : {
+       *(.symtab)
+  }
   /* Dynamic linkage sections.  Collected simply so we can check they're empty. */
   .got : {
         *(.got)