]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
s390: vmlinux.lds.S: explicitly keep various sections
authorNathan Chancellor <nathan@kernel.org>
Thu, 8 Feb 2024 00:14:56 +0000 (17:14 -0700)
committerHeiko Carstens <hca@linux.ibm.com>
Wed, 14 Feb 2024 12:50:52 +0000 (13:50 +0100)
When building with CONFIG_LD_ORPHAN_WARN after selecting
CONFIG_ARCH_HAS_LD_ORPHAN_WARN, there are some warnings around certain
ELF sections:

  s390-linux-ld: warning: orphan section `.dynstr' from `arch/s390/kernel/head64.o' being placed in section `.dynstr'
  s390-linux-ld: warning: orphan section `.dynamic' from `arch/s390/kernel/head64.o' being placed in section `.dynamic'
  s390-linux-ld: warning: orphan section `.hash' from `arch/s390/kernel/head64.o' being placed in section `.hash'
  s390-linux-ld: warning: orphan section `.gnu.hash' from `arch/s390/kernel/head64.o' being placed in section `.gnu.hash'

Explicitly keep those sections like other architectures when
CONFIG_RELOCATABLE is enabled, which is always true for s390.

[hca@linux.ibm.com: keep sections instead of discarding]
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20240207-s390-lld-and-orphan-warn-v1-4-8a665b3346ab@kernel.org
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/kernel/vmlinux.lds.S

index 725e3122c2143f344521b2d47183999ff8fd6d2a..63cb403b334411e1baad81b83de9ab2334b3ce18 100644 (file)
@@ -200,6 +200,18 @@ SECTIONS
                *(.rela*)
                __rela_dyn_end = .;
        }
+       .dynamic ALIGN(8) : {
+               *(.dynamic)
+       }
+       .dynstr ALIGN(8) : {
+               *(.dynstr)
+       }
+       .hash ALIGN(8) : {
+               *(.hash)
+       }
+       .gnu.hash ALIGN(8) : {
+               *(.gnu.hash)
+       }
 
        . = ALIGN(PAGE_SIZE);
        __init_end = .;         /* freed after init ends here */