From: Michael Ellerman <mpe@ellerman.id.au>
To: Michael Ellerman <mpe@ellerman.id.au>, <linuxppc-dev@ozlabs.org>
Cc: ulrich.weigand@de.ibm.com, Anton Blanchard <anton@samba.org>,
rostedt@goodmis.org, amodra@gmail.com
Subject: Re: [2/2] powerpc/module: Handle R_PPC64_ENTRY relocations
Date: Thu, 14 Jan 2016 00:09:25 +1100 (AEDT) [thread overview]
Message-ID: <20160113130926.2805B140556@ozlabs.org> (raw)
In-Reply-To: <1452600863-6294-2-git-send-email-mpe@ellerman.id.au>
On Tue, 2016-12-01 at 12:14:23 UTC, Michael Ellerman wrote:
> From: Ulrich Weigand <ulrich.weigand@de.ibm.com>
>
> GCC 6 will include changes to generated code with -mcmodel=large,
> which is used to build kernel modules on powerpc64le. This was
> necessary because the large model is supposed to allow arbitrary
> sizes and locations of the code and data sections, but the ELFv2
> global entry point prolog still made the unconditional assumption
> that the TOC associated with any particular function can be found
> within 2 GB of the function entry point:
>
> func:
> addis r2,r12,(.TOC.-func)@ha
> addi r2,r2,(.TOC.-func)@l
> .localentry func, .-func
>
> To remove this assumption, GCC will now generate instead this global
> entry point prolog sequence when using -mcmodel=large:
>
> .quad .TOC.-func
> func:
> .reloc ., R_PPC64_ENTRY
> ld r2, -8(r12)
> add r2, r2, r12
> .localentry func, .-func
>
> The new .reloc triggers an optimization in the linker that will
> replace this new prolog with the original code (see above) if the
> linker determines that the distance between .TOC. and func is in
> range after all.
>
> Since this new relocation is now present in module object files,
> the kernel module loader is required to handle them too. This
> patch adds support for the new relocation and implements the
> same optimization done by the GNU linker.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Applied to powerpc next.
https://git.kernel.org/powerpc/c/a61674bdfc7c2bf909c4010699
cheers
next prev parent reply other threads:[~2016-01-13 13:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-12 12:14 [PATCH 1/2] scripts/recordmcount.pl: support data in text section on powerpc Michael Ellerman
2016-01-12 12:14 ` [PATCH 2/2] powerpc/module: Handle R_PPC64_ENTRY relocations Michael Ellerman
2016-01-13 13:09 ` Michael Ellerman [this message]
2016-01-12 15:42 ` [PATCH 1/2] scripts/recordmcount.pl: support data in text section on powerpc Steven Rostedt
2016-01-12 22:43 ` Michael Ellerman
2016-01-13 13:09 ` [1/2] " Michael Ellerman
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=20160113130926.2805B140556@ozlabs.org \
--to=mpe@ellerman.id.au \
--cc=amodra@gmail.com \
--cc=anton@samba.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=rostedt@goodmis.org \
--cc=ulrich.weigand@de.ibm.com \
/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).