42ADVANCED FEATURES OF SHARED LIBRARIES
The previous chapter covered the fundamentals of shared libraries. This chapter describes a number of advanced features of shared libraries, including the following:
• dynamically loading shared libraries;
• controlling the visibility of symbols defined by a shared library;
• using linker scripts to create versioned symbols;
• using initialization and finalization functions to automatically execute code when a library is loaded and unloaded;
• shared library preloading; and
• using LD_DEBUG to monitor the operation of the dynamic linker.
42.1 Dynamically Loaded Libraries
When an executable starts, the dynamic linker loads all of the shared libraries in the program’s dynamic dependency list. Sometimes, however, ...
Get The Linux Programming Interface 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.