The Shared Library

In this section, you'll learn how to create and use shared libraries. You've already seen hints about the shared library, in Figure 13.1.

Limitations of Static Libraries

Figure 13.2 shows how the linker automatically extracts object modules from an archive and loads them as required. Although linking only what you need with your program provides a certain amount of economy, there is still duplication when looking at the system-wide picture. Imagine a huge hypothetical static library that contains 90% of the functions used by the Netscape Web browser. Netscape is then linked with this library, producing perhaps a 5MB executable file. Approximately 90% of this executable file will be a copy of what was contained in ...

Get Advanced UNIX Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.