ifunc resolving

Florian Weimer fweimer@redhat.com
Tue Jan 19 14:59:54 GMT 2021


* Fangrui Song:

> I have seen ifunc relocation activities on glibc and ld recently.
> https://sourceware.org/glibc/wiki/GNU_IFUNC is under-documented, some aspects
> have not been well-known, and there are a lot differences across architectures
> supporting ifunc, so I am sending this email hoping that these aspects can be
> clarified, toolchain developers can get on the same page, and documentation can
> be improved (if developers get confused at times, how could regular users
> comfortably use them? :) )

We have two positions that still need to be reconciled:

* IFUNC resolvers must not themselves have relocation dependencies
  because they can be called at any time during relocation.  This
  restricts the functionality available to an IFUNC resolver.

* IFUNC resolvers may have relocation dependencies, but they may only be
  called after the object that contains them has been relocated.  This
  restricts how IFUNC symbols can be used (interposition is limited,
  correct dependency ordering via DT_NEEDED is required).

I do not think we have ever achieved consensus which position is the
correct one.

We have removed several IFUNC resolvers with IFUNC dependencies from
glibc itself because we could not follow the interposition/dependency
rules for the second approach.

Due to the x86-specific checks we have, those architectures currently
land in the second category.  I do not know if other architecture
maintainers agree.

Thanks,
Florian
-- 
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill



More information about the Libc-alpha mailing list