This is the mail archive of the libc-alpha@sourceware.org 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: powerpc STT_GNU_IFUNC support, 2 of 2


On Thu, Jul 30, 2009 at 08:03:03AM -0700, Richard Henderson wrote:
> On 07/30/2009 05:45 AM, Alan Modra wrote:
>> b) Implement powerpc indirect functions in assembly.  Returning
>> pic function addresses in C on powerpc requires GOT entries.
>
> Implement gotoff {ha,lo} relocations and you can fix that.
> I've always been surprised that ppc didn't have those relocs.

PowerPC64 would need 64-bit offsets.  Adding a 64-bit offset to the
GOT pointer requires six instructions if using immediates, compared to
just one to load a 64-bit address from the GOT.  You could load the
offset from the GOT I suppose, but it's a bit daft to do that
considering that the whole point of the GOT is to provide addresses
for position independant code.  So gotoff relocs don't make sense for
general PowerPC64 code.

-- 
Alan Modra
Australia Development Lab, IBM


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