This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [Question] ifunc odering in ELF
- From: Florian Weimer <fweimer at redhat dot com>
- To: Szabolcs Nagy <Szabolcs dot Nagy at arm dot com>
- Cc: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, nd <nd at arm dot com>, "libc-alpha\@sourceware.org" <libc-alpha at sourceware dot org>
- Date: Wed, 16 Oct 2019 14:55:12 +0200
- Subject: Re: [Question] ifunc odering in ELF
- References: <1568314984.28076.65.camel@blackberry.com> <87pnjzy75u.fsf@oldenburg2.str.redhat.com> <66583af6-6049-7f1d-0a31-a77a228cf603@linaro.org> <87v9tnezju.fsf@oldenburg2.str.redhat.com> <0a862d00-8b76-4015-3750-f05636544611@arm.com>
* Szabolcs Nagy:
> On 20/09/2019 16:51, Florian Weimer wrote:
>> * Adhemerval Zanella:
>>
>>> That's was not my impression, I this we should to go this way iff we can't
>>> really make IFUNC reordering work on loader. From your initial work on
>>> the two-phase IFUNC relocation, which prevents us to move forward?
>>
>> No one said, “yes, we do need this feature in the loader”.
>>
>> (Keep in mind that it does not solve all ordering problems, the example
>> in this thread would still break.)
>
> if most "reasonable" ordering issues can be fixed, then
> i think the ordering should be fixed.
>
> but i seem to remember that for it to work it's not enough
> to consider the relocations of a single module,
Current binutils already orders IRELATIVE relocations after all other
relocations. I haven't checked (or don't recall) if the sorting also
treats likely self-bindings specially (ordering them after other
relocations). Beyond that there is little we can do in the link editor
because the problematic scenarios involve preloading, so there's just
not a complete picture and link time.
> but other modules have to be considered (in case of copy relocated
> function pointers? or extern ifunc code in not yet relocated
> modules?).
The patch I posted is global in effect:
<https://sourceware.org/ml/libc-alpha/2018-06/msg00077.html>
> if relocations have to be processed twice across multiple
> modules then i think the complexity is too much (we need to
> allocate space for the list of relocs that need reprocessing
> etc).
Right, the patch does that. Looks like I read the consensus on the list
correctly. 8-/
I guess I'll keep working on eliminating the remaining relocation
dependencies (and others) in glibc's IFUNC resolvers.
Thanks,
Florian