Hi AJ,
Thanks for you comments,
The problem in your example that you have two copies of lib.dll.so, one that is imported implicitly and one that is loaded by LoadLibrary, so it gets loaded twice. You have to make sure that the dll loaded by LoadLibrary is exactly the same as the one that was imported at the Unix level.
In the example i sent there is only 1 DLL at any time.
I even copy the DLL to a specific location before linking it with the app, and the same location is used for LoadLibrary().
So not only is there only 1 library, but the same location is used for linking, and for loading the library inside the app.
Did you try the example? I simply cannot get it to work. Are you sure its not just broken currently with all the loader changes?
Thanks,
/pedro