You can (just extract all the .o
files and associate them with -shared
to make .so
), but whether it works and how well it works depends on the platform and whether the static library is compiled as position-independent code (PIC). On some platforms (e.g. x86_64), non-PIC code is not allowed in shared libraries and will not work (in fact, I think the linker will refuse to do .so
). On other platforms, non-PIC code will work in shared libraries, but a copy of the library inside the memory cannot be used between different programs that use it or even different instances of the same program, so this will lead to huge memory bloating.
R ..
source share