I have an executable that loads .so plugins.
The executable is linked with -rdynamic so that symbol callback can occur.
I have a static library that is included in the executable. This has a function called BLAH_hello() in the .a
The static library is not used in the executable. ie there are no calls to BLAH_hello() in the executable code.
However, the .so does have calls to BLAH_hello().
When I dlopen() the .so it complains about an undefined symbol to BLAH_hello()
If I include a dummy call to BLAH_hello() in the executable code, like BLAH_hello(NULL);. The symbol is included in the executable and when the .so is loaded it finds the symbol.
I'm sure I could also link the .so against the .a but multiple dynamically loaded .so's use the BLAH_hello call so it makes sense to have it in the executable. I'm also worried about symbol conflict if I link the library into each .so.
So what I'm wondering, is how to get the symbols of the .a into the executable even if they aren't actually used in the executable?
.soplugins that will need to be linked against that.aI won't have symbol conflicts when i load all the.so's into my executable?