This is the mail archive of the
mailing list for the binutils project.
Re: [GOLD] ifunc tests
On Wed, Mar 6, 2013 at 3:39 PM, Alan Modra <firstname.lastname@example.org> wrote:
> On Wed, Mar 06, 2013 at 06:15:04AM -0800, Ian Lance Taylor wrote:
>> On Wed, Mar 6, 2013 at 3:45 AM, Alan Modra <email@example.com> wrote:
>> > ifuncmain1pie and ifuncmain6pie fail on powerpc, because the ifunc
>> > resolver function runs *before* all GOT relocations have been applied.
>> > (The tests all pass on powerpc64 with a recent gcc due to
>> > -mcmodel=medium avoiding the GOT/TOC. They fail with any other
>> > -mcmodel.)
>> I don't understand why the ifunc relocations can't be run after all
>> the other relocations are applied. That is how it works on x86. Gold
>> uses a separate reloc section for the IRELATIVE relocs and puts it
>> after the other reloc sections. The dynamic linker then processes the
>> relocs in order.
> Yes, we do the same on powerpc (*), but it only works for relocs in a
> single binary, not when the ifunc relocation in a shared library uses
> a resolver function in another shared library or the main app. In
> that case GOT relocs may not have been applied. Exactly this
> situation occurs in ifuncmain6pie/ifuncmod6.so.
OK, next (unrelated) thought: perhaps the PPC code should just safely
retrieve global into a local variable, rather than writing the whole
switch statement in assembler.
i = global;