It is really expected. One instance of libssl.a inserts (probably a subset) of the other, and the results are not very good. You can use the script version ( --version-script to ld, with -Wl, for cc) to control export from A.so and B.so If something is not exported, it also cannot be inserted.
Alternatively, you can compile libssl.a flags of visibility, such as -fvisibility=hidden . These flags only affect the dynamic linker, not the static link. Most likely, you needed to compile it yourself, because the sent .a files usually contain position-specific code designed to communicate with executable files. Only on some platforms, such as 32-bit x86, can you get away with binding such code to shared objects and only by redistributing the text.
dlopen with RTLD_LOCAL , as suggested in the comment, should also work, but it seems difficult to use dlopen for this purpose.
Another option is to use the same generic libssl.so in both libraries.
jilles
source share