Shared objects (.so) static linking and opening other shared object, is the static library code shared between them?
I have one shared object (a.so) which has statically linked (s.so). b.so a开发者_运维问答lso has a static link of s.so.
a.so does a dlopen on b.so , will "s.so" code be shared between the two?
The .so are built on gcc 4.1 on RedHat linux.
The s.so is compiled against a.so and b.so with -Bstatic and --no-whole-archive option.
Static library code (s.a) is never shared between binaries.
Whenever you link with a static library, the code for the functions you use is taken from the static library and placed in the executable or shared library you are producing. So in your case, each shared library will contain its own copy of code from the static library.
精彩评论