This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [rs6000/rfc] -fPIC vs TLS


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]