From: Joel Stanley <joel@jms.id.au>
To: linuxppc-dev@lists.ozlabs.org
Cc: Stephen Rothwell <sfr@canb.auug.org.au>, Alan Modra <amodra@gmail.com>
Subject: [PATCH v3 1/3] powerpc: Discard more sections in linker script
Date: Tue, 11 Dec 2018 08:58:52 +1030 [thread overview]
Message-ID: <20181210222854.21156-2-joel@jms.id.au> (raw)
In-Reply-To: <20181210222854.21156-1-joel@jms.id.au>
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 <amodra@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 <sfr@canb.auug.org.au>
Signed-off-by: Joel Stanley <joel@jms.id.au>
---
See https://lore.kernel.org/lkml/CACPK8Xft3n5KkpTjN3=7_VUCXHFcK7mxvZm2Rrqu7tppcBoyOg@mail.gmail.com/T/#m58532c86cf0c7b4fb01cc1fe724e48d4c7d8e4a7
v3: Add dynstr hunk to this patch (it was incorrectly left in patch 2)
---
arch/powerpc/kernel/vmlinux.lds.S | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index 434581bcd5b4..779b8b3075a1 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -273,14 +273,11 @@ SECTIONS
#endif
*(.dynsym)
}
- .dynstr : AT(ADDR(.dynstr) - LOAD_OFFSET) { *(.dynstr) }
.dynamic : AT(ADDR(.dynamic) - LOAD_OFFSET)
{
__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 = .;
@@ -388,5 +385,8 @@ SECTIONS
*(.gnu.version*)
*(.gnu.attributes)
*(.eh_frame)
+ *(.hash .gnu.hash)
+ *(.interp)
+ *(.dynstr)
}
}
--
2.19.1
next prev parent reply other threads:[~2018-12-10 22:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-10 22:28 [PATCH v3 0/3] powerpc: Add to linker script discards Joel Stanley
2018-12-10 22:28 ` Joel Stanley [this message]
2018-12-20 11:18 ` [PATCH v3 1/3] powerpc: Discard more sections in linker script Michael Ellerman
2018-12-10 22:28 ` [PATCH v3 2/3] powerpc: Discard dynsym section for !PPC32 Joel Stanley
2018-12-20 11:20 ` Michael Ellerman
2018-12-10 22:28 ` [PATCH v3 3/3] powerpc: Discard .branch_lt section Joel Stanley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181210222854.21156-2-joel@jms.id.au \
--to=joel@jms.id.au \
--cc=amodra@gmail.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=sfr@canb.auug.org.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).