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 3/3] powerpc: Discard .branch_lt section
Date: Tue, 11 Dec 2018 08:58:54 +1030 [thread overview]
Message-ID: <20181210222854.21156-4-joel@jms.id.au> (raw)
In-Reply-To: <20181210222854.21156-1-joel@jms.id.au>
When building a 32 bit powerpc kernel with Binutils 2.31.1 this warning
is emitted:
powerpc-linux-gnu-ld: warning: orphan section `.branch_lt' from
`arch/powerpc/kernel/head_44x.o' being placed in section `.branch_lt'
As of binutils commit 2d7ad24e8726 ("Support PLT16 relocs against local
symbols")[1], 32 bit targets can produce .branch_lt sections in their
output.
These sections should be empty for the kernel build so discard them for
both PPC64 and PPC32.
[1] https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=2d7ad24e8726ba4c45c9e67be08223a146a837ce
Signed-off-by: Joel Stanley <joel@jms.id.au>
---
v2: Discard instead of keep. Alan said "[discarding] can be a recipe for
finding linker bugs", so lets go with that.
---
arch/powerpc/kernel/vmlinux.lds.S | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index 2c93a420f456..af0f81df8bb9 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -316,7 +316,6 @@ SECTIONS
DATA_DATA
*(.data.rel*)
*(.toc1)
- *(.branch_lt)
}
.opd : AT(ADDR(.opd) - LOAD_OFFSET) {
@@ -388,6 +387,7 @@ SECTIONS
*(.hash .gnu.hash)
*(.interp)
*(.dynstr)
+ *(.branch_lt)
#ifndef CONFIG_PPC32
*(.dynsym)
#endif
--
2.19.1
prev parent reply other threads:[~2018-12-10 22:39 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 ` [PATCH v3 1/3] powerpc: Discard more sections in linker script Joel Stanley
2018-12-20 11:18 ` 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 ` Joel Stanley [this message]
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-4-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).