linux-sg2042/scripts/mod
Alan Modra c153693d7e powerpc: Simplify module TOC handling
PowerPC64 uses the symbol .TOC. much as other targets use
_GLOBAL_OFFSET_TABLE_. It identifies the value of the GOT pointer (or in
powerpc parlance, the TOC pointer). Global offset tables are generally
local to an executable or shared library, or in the kernel, module. Thus
it does not make sense for a module to resolve a relocation against
.TOC. to the kernel's .TOC. value. A module has its own .TOC., and
indeed the powerpc64 module relocation processing ignores the kernel
value of .TOC. and instead calculates a module-local value.

This patch removes code involved in exporting the kernel .TOC., tweaks
modpost to ignore an undefined .TOC., and the module loader to twiddle
the section symbol so that .TOC. isn't seen as undefined.

Note that if the kernel was compiled with -msingle-pic-base then ELFv2
would not have function global entry code setting up r2. In that case
the module call stubs would need to be modified to set up r2 using the
kernel .TOC. value, requiring some of this code to be reinstated.

mpe: Furthermore a change in binutils master (not yet released) causes
the current way we handle the TOC to no longer work when building with
MODVERSIONS=y and RELOCATABLE=n. The symptom is that modules can not be
loaded due to there being no version found for TOC.

Cc: stable@vger.kernel.org # 3.16+
Signed-off-by: Alan Modra <amodra@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2016-01-21 14:10:56 +11:00
..
.gitignore kbuild: trivial - remove trailing empty lines 2014-06-10 00:04:06 +02:00
Makefile improve modalias building 2013-06-28 00:48:16 +02:00
devicetable-offsets.c sound updates for 4.4-rc1 2015-11-06 11:04:07 -08:00
empty.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
file2alias.c modpost: don't add a trailing wildcard for OF module aliases 2016-01-14 16:00:49 -08:00
mk_elfconfig.c kbuild: trivial - remove trailing empty lines 2014-06-10 00:04:06 +02:00
modpost.c powerpc: Simplify module TOC handling 2016-01-21 14:10:56 +11:00
modpost.h Avoid conflict with host definitions when cross-compiling 2015-08-20 14:55:54 +02:00
sumversion.c kbuild: trivial - use tabs for code indent where possible 2014-06-10 14:00:53 +02:00