This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: rtld: resolve incoming STT_GNU_IFUNC only after DT_INIT


* 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]