Building and Using Shared Libraries on Linux course outline
 
        - Course Introduction
- Fundamentals of Shared Libraries
            
                - Background
- The static linker and the dynamic linker
- Static vs shared libraries
- Basics of shared library creation and use
- Position-independent code (PIC)
- The shared library soname
- In pictures: library creation, linking, and loading
 
- Versioning and Installation
            
                - Shared library versioning
- Shared library real names, sonames, and linker names
- Installing shared libraries
- ldconfig
 
- ELF (Executable and Linkable Format)
            
                - ELF file layout
- The program header table (PHT)
- The section header table (SHT)
- Program header table vs section header table
- ELF sections
- Useful commands: readelf and objdump
 
- The Dynamic Linker
            
                - Rpath: specifying library search paths in an object
- Dynamic string tokens
- Finding shared libraries at run time
- How programs get run
 
- Symbol Interposition and Library Load Order
            
                - Symbol resolution and symbol interposition
- Symbol resolution and library load order
- Link-map lists (namespaces)
- The global look-up scope
- LD_DEBUG: tracing the dynamic linker
 
- Dynamically Loaded Libraries (dlopen)
            
                - Opening a shared library: dlopen()
- Obtaining the address of a symbol: dlsym()
- The dlopen API: example
- The dlopen API: further details
 
- Shared Libraries and the Static Linker
            
                - Recording dynamic dependencies
- How the static linker finds library dependencies
- Handling secondary dependencies at link time
 
- Symbol Visibility
            
                - Controlling symbol visibility
- Controlling symbol visibility: –Bsymbolic
- Symbol attributes: binding and visibility
- Controlling visibility on a per-symbol bases
- Using version scripts to control symbol visibility
- Summary of techniques for build-time visibility control
- Run-time visibility control: dlopen()-ed libraries
 
- Look-up Scopes
            
                - Look-up scopes
- LD_DEBUG=scopes
 
- Preloading
            
                - Preloading shared libraries
- Preloading example
- Use cases for preloading
 
- Weak Symbols (*)
            
                - Weak symbols
- Linker rules for strong and weak symbols
- Use cases for weak symbols
 
- Symbol Versioning
            
                - Creating a symbol-versioned library
- An aside: version "dependencies"
- Summary: assigning a version to a symbol
- ELF and symbol versioning
- Symbol versioning and symbol resolution
- Advantages of symbol versioning
- Referencing a nondefault symbol version
- Removing a public versioned symbol
- The library base version
- Appendix: version node syntax
- Appendix: the .symverassembler directive
 
- Symbol Versioning: Further Topics (*)
            
                - Symbol versioning design approaches
- Transitioning an existing library to symbol versioning
- Further details on symbol versioning
- Symbol-version matching rules
- Addendum: a few C++ details
 
- Lazy Binding (*)
            
                - Lazy binding
- Immediate binding
- Lazy binding versus immediate binding
 
- GOT and PLT (*)
            
                - The GOT and PLT
- Relocation and the PLT: in pictures
- Relocation and the PLT: code
- Observing the effect of lazy binding on the GOT
- Performance considerations
 
Return to the course overview