This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: rtld: resolve incoming STT_GNU_IFUNC only after DT_INIT
- From: Florian Weimer <fw at deneb dot enyo dot de>
- To: John Reiser <jreiser at bitwagon dot com>
- Cc: libc-alpha at sourceware dot org, Florian Weimer <fweimer at redhat dot com>
- Date: Wed, 01 Nov 2017 17:35:42 +0100
- Subject: Re: rtld: resolve incoming STT_GNU_IFUNC only after DT_INIT
- Authentication-results: sourceware.org; auth=none
- References: <9b03e519-3ec8-b603-dc19-b25379cbc9a5@bitwagon.com>
* John Reiser:
> When loading a shared library, either DT_NEEDED or via dlopen(),
> then the processing by rtld of relocations in other modules which
> refer to STT_GNU_IFUNC symbols in the current library causes
> problems for me. Relocating a reference from outside to a
> STT_GNU_IFUNC symbol causes the IFUNC code to be called before the
> DT_INIT executes. This is not nice.
But this is required because the DT_INIT code may need IFUNC-backed
relocations. And there is no way to tell which relocations are needed
for DT_INIT and which are just required afterwards.
> It seems to me that rtld could change the order of evaluation, so that
> DT_INIT is called before any other code in the library is executed,
> including the code for resolving incoming references to STT_GNU_IFUNC
> symbols in the library. Comments?
I don't think this is possible at all.