From: Michael Ellerman <mpe@ellerman.id.au>
To: Michael Ellerman <mpe@ellerman.id.au>, <linuxppc-dev@ozlabs.org>
Cc: amodra@gmail.com, rusty@rustcorp.com.au,
linux-kernel@vger.kernel.org, quentin.casasnovas@oracle.com,
paul.gortmaker@windriver.com, Anton Blanchard <anton@samba.org>
Subject: Re: powerpc: Simplify module TOC handling
Date: Thu, 21 Jan 2016 16:34:07 +1100 (AEDT) [thread overview]
Message-ID: <20160121053407.A6CEB140BF6@ozlabs.org> (raw)
In-Reply-To: <1453077867-23873-1-git-send-email-mpe@ellerman.id.au>
On Mon, 2016-18-01 at 00:44:27 UTC, Michael Ellerman wrote:
> From: Alan Modra <amodra@gmail.com>
>
> 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>
Applied to powerpc fixes.
https://git.kernel.org/powerpc/c/c153693d7eb9eeb28478aa2dea
cheers
prev parent reply other threads:[~2016-01-21 5:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-18 0:44 [PATCH] powerpc: Simplify module TOC handling Michael Ellerman
2016-01-21 5:34 ` Michael Ellerman [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=20160121053407.A6CEB140BF6@ozlabs.org \
--to=mpe@ellerman.id.au \
--cc=amodra@gmail.com \
--cc=anton@samba.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=paul.gortmaker@windriver.com \
--cc=quentin.casasnovas@oracle.com \
--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 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).