I have a program, code-named foo
. foo
depends on common.so
and is linked to it in the normal way (sorry I don't know the technical way to say that). When foo
is running it then dynamically loads bar.so
using dlopen()
. So far so good.
But, bar.so
also depends on common.so
. Will dlopen()
re-load common.so
(from what I've read it loads any required dependencies recursively), or will it detect that it is already loaded? If it does re-load it, could that cause problems in my program? Both foo
and bar.so
need to see the changes in common.so
that either of them make to static variables there.
Maybe my design needs to be changed or requires use of -rdynamic
(which I also don't quite understand properly yet)?