A dynamically linked ELF file resolves the symbols at runtime. Either it does so immediately at startup to resolve all symbols or they get lazily resolved whenever a symbol is actually being called.
I would like to create an executable which resolves one symbol lazily and another immediately on startup.
Is that possible giving arguments to the linker?
If not, what do I need to patch in the finished binary?
I can for example switch between both modes using LD_BIND_NOW
. But only for all symbols at once. I could force lazy binding and call all symbols I want to be resolved immediately at startup, but I want it to be the originally intended way the dynamic linker works to resolve symbols without having to call them.