This is the mail archive of the libc-help@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: Forcing BIND_NOW for a symbol


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.



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