Forcing BIND_NOW for a symbol
Carlos O'Donell
carlos@redhat.com
Mon Nov 2 15:08:00 GMT 2015
On 11/02/2015 08:42 AM, Florian Weimer wrote:
> Is there a way to tell the dynamic linker to resolve a function symbol
> at load time, and not later, when the function is called?
Well, it's LD_BIND_NOW=1 env var, or -z now, but that does all the symbols
not just one.
There is no way to resolve just one function at load time.
Implementing such a feature should not be that difficult, all the machinery
is in place. You'd need a way to list the functions you wanted bound at
load time, and then handle that at load time or dlopen time.
> I'm interested in both the case where this is a completely new symbol
> (so we can do anything we want to make this happen), and existing
> versioned function symbol.
How are they any different?
> The idea is to ensure that if there is an IFUNC handler for the symbol,
> the handler is called at load time, and not later during program execution.
Why?
Cheers,
Carlos.
More information about the Libc-help
mailing list