What are the advantages of statically linked shared libraries?
There are still a couple of advantages to statically linked shared libraries: • Simplicity. Statically linked shared libraries are pretty simple structures. There’s nothing to go wrong with relocations, symbol binding, path lookups, etc. at run time. That is the one debugging advantage that they hold over dynamically linked shared libraries. • Speed. Because your program needs no dynamic linking when it loads a statically linked shared library, because the libraries don’t need to be relocated after loading, and because libraries don’t need to make extra indirections for the sake of PIC, statically linked shared libraries are more efficient than dynamically linked shared libraries. The effects are largest for programs that run quickly or which make compute-intensive use of library code. (As a test, I built the cat program as a dynamically linked program (4777 bytes), as a statically linked program with shared libraries (2437 bytes), and as a statically linked program without shared libr