This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc 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: [PATCH] PPC64 elf configure


On Wed, Mar 12, 2003 at 03:09:56PM -0600, Steve Munroe wrote:
> Roland McGrath writes:
> 
> > Is there a reason this is impossible on PPC64?  I would think that 
> values
> > relative to the TOC address could work similarly to how they do on x86. 
> > Is this not doable, or is it just that the compiler doesn't do it?  If 
> the
> > latter, ideally GCC should learn to do it, and then we should write a
> > configure check that ascertains if the compiler is in fact doing it.
> 
> It may not be impossible but it is difficult. The ABI allows for the 
> possibility of a GOT and small data area as a subset of the TOC, but I 
> don't think PPC64 gcc supports SDA. Or at least it's was not getting used 
> in the code generated for rtld.c. 
> 
> The biggest issue is that we don't support TOCs >64KB and we tend to blow 
> the TOC on the larger libs. So putting more stuff into the TOC seems like 
> a bad idea.
> 
> Alan will have a give the details.

I think you've more or less covered it all.  Roland is correct in
saying that it would be possible to address static vars relative to
the TOC pointer, but powerpc64 gcc doesn't generate code to implement
this addressing mode at the moment.  Support for .sdata (on my todo
list) is a special case of this addressing mode where the offsets are
16 bit due to storage for the var being allocated in the TOC section
itself.  It's interesting to consider that placing a static var (of
size not greater than a long) in the TOC won't increase TOC size at
all, because you won't need to put the var's address in the TOC.
The same could be done for global vars, but you'd need a linker relax
pass to adjust code and trim off unnecessary TOC entries.

-- 
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]