From: Tony Breeds <tony@bakeyournoodle.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
LinuxPPC-dev <linuxppc-dev@lists.ozlabs.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>, Alan Modra <amodra@gmail.com>
Subject: [PATCH] powerpc/le: Avoid creatng R_PPC64_TOCSAVE relocations for modules.
Date: Wed, 12 Mar 2014 15:12:01 +1100 [thread overview]
Message-ID: <20140312041201.GA13555@thor.bakeyournoodle.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1066 bytes --]
When building modules with a native le toolchain the linker will
generate R_PPC64_TOCSAVE relocations when it's safe to omit saving r2 on
a plt call. This isn't helpful in the conext of a kernel module and the
kernel will fail to load those modules with an error like:
nf_conntrack: Unknown ADD relocation: 109
This patch tells the linker to avoid createing R_PPC64_TOCSAVE
relocations allowing modules to load.
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
---
arch/powerpc/Makefile | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 0f4344e..fff3945 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -74,6 +74,9 @@ override CROSS32AS += -mlittle-endian
LDEMULATION := lppc
GNUTARGET := powerpcle
MULTIPLEWORD := -mno-multiple
+ifeq ($(call cc-option-yn,-mno-save-toc-indirect),y)
+ KBUILD_CFLAGS_MODULE += -mno-save-toc-indirect
+endif
else
ifeq ($(call cc-option-yn,-mbig-endian),y)
override CC += -mbig-endian
--
1.8.5.3
Yours Tony
[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]
next reply other threads:[~2014-03-12 4:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-12 4:12 Tony Breeds [this message]
2014-04-06 23:55 ` [PATCH] powerpc/le: Avoid creatng R_PPC64_TOCSAVE relocations for modules Anton Blanchard
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=20140312041201.GA13555@thor.bakeyournoodle.com \
--to=tony@bakeyournoodle.com \
--cc=amodra@gmail.com \
--cc=benh@kernel.crashing.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=rusty@rustcorp.com.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.