I am trying to load a shared object that should resolve some symbols inside the executable that loaded it:
program A loads plugin.so which uses method "callback" that exists in program A
When I try to load the .so I end up with an error:
undefined symbol: __1cJBugEngineFipath2t6Mpkc_v_
if I use nm "program" | grep __1cJBugEngineFipath2t6Mpkc_v_:
0000000000416d20 T __1cJBugEngineFipath2t6Mpkc_v_
On Linux with the GCC tools, I would normally use the option "-rdynamic":
"When creating a dynamically linked executable, add all symbols to the dynamic symbol table. The dynamic symbol table is the set of symbols which are visible from dynamic objects at run time."
but I have read that the linker for suncc automatically exports all symbols as a default.
Nope :( same symbol error.
I also tried to use "dlopen(0, RTLD_NOLOAD|RTLD_GLOBAL)" to force symbols to be global in the executable, that didn't work.
I can fortunately switch from a plugin-based build to a completely static executable (all plugins statically linked but the client code is exactly the same) but it would be much better to fix this issue on Linux.