Is it possible to execute code BEFORE a shared object gets automatically loaded.
The problem is that we can be working in multiple projects as the same time ( different versions). Each have their own set of shared object and binaries located in their private directory. The problem with this is that the path for the shared object must be set independantly for each version, this is VERY error prone.
I would like each binaries to set their LD_LIBRARY_PATH dependending on the directory where they are. But for this to work I need to be able to set LD_LIBRARY_PATH before the program loads the DLL.
I’m currently experimenting with attribute constructor, but I get the feeling this will still not be execute before the startup code loads the shared object.
Suggestion?