Question

Is there a flag or any other directive that I can use to force the Linux Dynamic Linker ld.so to load all shared libraries at once at start of the program instead of lazy binding.

Essentially I want to turn off lazy binding.

Thanks

Was it helpful?

Solution

Setting environment variable LD_BIND_NOW = 1 will do that.

Thanks to @skwllsp for the answer.

OTHER TIPS

man ld sayes:

-z keyword

now - When generating an executable or shared library, mark it to tell the dynamic linker to resolve all symbols when the program is started, or when the shared library is linked to using dlopen, instead of deferring function call resolution to the point when the function is first called

http://linux.die.net/man/1/ld

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top