This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: symbol type in ->check_relocs()
From: Alan Modra <amodra@gmail.com>
Date: Wed, 3 Feb 2010 08:26:01 +1030
> On Tue, Feb 02, 2010 at 10:50:06AM -0800, David Miller wrote:
>>
>> All of the IFUNC BFD backend changes have added code
>> which is conditional upon the symbol type to the
>> target ->check_relocs() method.
>>
>> But this doesn't seem to be kosher.
>>
>> The final symbol type isn't known at this point. And it
>> won't be until all of the object file symbol tables have
>> been slurped in.
>
> So anything you need to do for ifunc syms, you need to do for undef
> ones.
How can it?
Look even at the elf64-ppc.c ->check_relocs() code. It specifically
does all of it's "ifunc = &h->plt.plist" business only when h->type ==
STT_GNU_IFUNC.
And therefore, for example, without h->type being STT_GNU_IFUNC this
code also will not invoke update_plt_info().
These functions handle STT_GNU_IFUNC relocations properly only when
the h->type is set to it's final resting value.
I really think ->check_relocs() mustn't make tests on the value of
h->type in any way, and that only future passes which execute after
all symbol resolution has occurred are allowed to do so.