This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [rs6000/rfc] -fPIC vs TLS
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Richard Henderson <rth at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 10 Mar 2006 14:41:50 +1030
- Subject: Re: [rs6000/rfc] -fPIC vs TLS
- References: <20060309232027.GA13340@redhat.com>
On Thu, Mar 09, 2006 at 03:20:27PM -0800, Richard Henderson wrote:
> And, it turns out that the existance of that pc-relative
> relocation vs _GOT_ is what causes the linker to go into
> its old-style PLT mode.
Really? Then I guess I need to fix the linker.
> For the case of secure-plt, I can't think of anything more
> efficient than just treating _GOT_ as any other local symbol.
> Which means (at least for the moment), just dropping its
> address into the .got2 section and reading it from there.
You don't necessarily have any sort of GOT pointer around at
the point we emit that sequence.
> A possible improvement for old-abi: as I understand it, -fPIC
> code still does have a regular .got section, even if most bits
> go into the local .got2 subsections. This would mean that the
> best way to get this address is with the plain old
> load_toc_v4_pic_si pattern; that is
>
> bl _GLOBAL_OFFSET_TABLE_@local-4
> mflr 3
Yes, that would work (but force old abi, because you'd then need an exec
.got). The linker will insert long branch trampolines as needed.
--
Alan Modra
IBM OzLabs - Linux Technology Centre