Building the ppc64 kernel with a modern binutils results in this
warning:

 powerpc64le-linux-gnu-ld: warning: orphan section `.gnu.hash' from
 `linker stubs' being placed in section `.gnu.hash'

Alan Modra <amo...@gmail.com> explains:

 > .gnu.hash, like .hash, is used by glibc ld.so for dynamic symbol
 > lookup.  I imagine you don't need either section in a kernel, so
 > discarding both sounds reasonable.  Likely you could discard .interp
 > and .dynstr too, and .dynsym when !CONFIG_PPC32.

Reported-by: Stephen Rothwell <s...@canb.auug.org.au>
Signed-off-by: Joel Stanley <j...@jms.id.au>
---
See 
https://lore.kernel.org/lkml/CACPK8Xft3n5KkpTjN3=7_vucxhfck7mxvzm2rrqu7tppcbo...@mail.gmail.com/T/#m58532c86cf0c7b4fb01cc1fe724e48d4c7d8e4a7

 arch/powerpc/kernel/vmlinux.lds.S | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/vmlinux.lds.S 
b/arch/powerpc/kernel/vmlinux.lds.S
index 5c5d559a23fd..e14cde32b003 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -279,8 +279,6 @@ SECTIONS
                __dynamic_start = .;
                *(.dynamic)
        }
-       .hash : AT(ADDR(.hash) - LOAD_OFFSET) { *(.hash) }
-       .interp : AT(ADDR(.interp) - LOAD_OFFSET) { *(.interp) }
        .rela.dyn : AT(ADDR(.rela.dyn) - LOAD_OFFSET)
        {
                __rela_dyn_start = .;
@@ -389,5 +387,8 @@ SECTIONS
                *(.gnu.version*)
                *(.gnu.attributes)
                *(.eh_frame)
+               *(.hash .gnu.hash)
+               *(.interp)
+               *(.dynstr)
        }
 }
-- 
2.19.1

Reply via email to