Documentation Home
> Linker and Libraries Guide
Linker and Libraries Guide
Book Information
Preface
Chapter 1 Introduction
Overview
Link-Editing
Runtime Linking
Dynamic Executables
Shared Objects
Related Topics
Dynamic Linking
Application Binary Interfaces
32 and 64-bit Environments
Support Tools
New Features
Chapter 2 Link-Editor
Overview
Invoking the Link-Editor
Direct Invocation
Using a Compiler Driver
Specifying the Link-Editor Options
Input File Processing
Archive Processing
Shared Object Processing
Linking with Additional Libraries
Library Naming Conventions
Linking With a Mix of Shared Objects and Archives
Position of an Archive on the Command-Line
Directories Searched by the Link-Editor
Using a Command-Line Option
Using an Environment Variable
Directories Searched by the Runtime Linker
Initialization and Termination Sections
Symbol Processing
Symbol Resolution
Simple Resolutions
Complex Resolutions
Fatal Resolutions
Undefined Symbols
Generating an Executable
Generating a Shared Object
Weak Symbols
Tentative Symbol Order Within the Output File
Defining Additional Symbols
Reducing Symbol Scope
Generating the Output Image
Debugging Aids
Chapter 3 Runtime Linker
Overview
Locating Shared Object Dependencies
Directories Searched by the Runtime Linker
Configuring the Default Search Paths
Dynamic String Tokens
Relocation Processing
Symbol Lookup
Interposition
When Relocations Are Performed
Relocation Errors
Loading Additional Objects
Lazy Loading of Dynamic Dependencies
Initialization and Termination Routines
Security
Runtime Linking Programming Interface
Loading Additional Objects
Relocation Processing
Symbol Lookup
Default Symbol Lookup Model
Defining a Global Object
Isolating a Group
Object Hierarchies
Obtaining New Symbols
Testing for Functionality
Using Interposition
The Feature Checker
Debugging Aids
Chapter 4 Shared Objects
Overview
Naming Conventions
Recording a Shared Object Name
Inclusion of Shared Objects in Archives
Recorded Name Conflicts
Shared Objects With Dependencies
Dependency Ordering
Shared Objects as Filters
Generating a Standard Filter
Generating an Auxiliary Filter
Filtee Processing
Performance Considerations
Useful Tools
The Underlying System
Lazy Loading of Dynamic Dependencies
Position-Independent Code
Maximizing Shareability
Move Read-Only Data to Text
Collapse Multiply-Defined Data
Use Automatic Variables
Allocate Buffers Dynamically
Minimizing Paging Activity
Relocations
Symbol Lookup
When Relocations are Performed
Combined Relocation Sections
Copy Relocations
The Use of -Bsymbolic
Profiling Shared Objects
Chapter 5 Versioning
Overview
Interface Compatibility
Internal Versioning
Creating a Version Definition
Creating a Weak Version Definition
Defining Unrelated Interfaces
Binding to a Version Definition
Verifying Versions in Additional Objects
Specifying a Version Binding
Binding to Additional Version Definitions
Version Stability
Relocatable Objects
External Versioning
Coordination of Versioned Filenames
Compatibility Within a Process
Chapter 6 Support Interfaces
Overview
Link-Editor Support Interface
Invoking the Support Interface
32 and 64-bit Environments
Support Interface Functions
Support Interface Example
Runtime Linker Auditing Interface
Establishing a Name-space
Building an Audit Library
Invoking the Auditing Interface
Recording Local Auditors
Audit Interface Functions
Audit Interface Example
Audit Interface Demonstrations
Audit Interface Limitations
Functions That Directly Inspect the Stack
Runtime Linker Debugger Interface
Interaction Between Controlling and Target Process
Debugger Interface Agents
Debugger Exported Interface
Agent Manipulation
Error Handling
Scanning Loadable Objects
Event Notification
Procedure Linkage Table Skipping
Dynamic Object Padding
Debugger Import Interface
Chapter 7 Object Files
Overview
File Format
Data Representation
ELF Header
ELF Identification
Sections
Special Sections
String Table
Symbol Table
Symbol Values
Register Symbols
Syminfo Table
Relocation
Relocation Types (Processor-Specific)
SPARC: Relocation Types
64-bit SPARC: Relocation Types
IA: Relocation Types
Comdat Section
Versioning Information
Version Definition Section
Version Symbol Section
Version Dependency Section
Note Section
Move Section
Dynamic Linking
Program Header
Base Address
Segment Permissions
Segment Contents
Program Loading (Processor-Specific)
Program Interpreter
Runtime Linker
Dynamic Section
Shared Object Dependencies
Global Offset Table (Processor-Specific)
Procedure Linkage Table (Processor-Specific)
SPARC: Procedure Linkage Table
IA: Procedure Linkage Table
Hash Table
Initialization and Termination Functions
Chapter 8 Mapfile Option
Overview
Using the Mapfile Option
Mapfile Structure and Syntax
Segment Declarations
Mapping Directives
Section-Within-Segment Ordering
Size-Symbol Declarations
File Control Directives
Mapping Example
Mapfile Option Defaults
Internal Map Structure
Error Messages
Warnings
Fatal Errors
Provided Mapfiles
Appendix A Link-Editor Quick Reference
Overview
Static Mode
Building a Relocatable Object
Building a Static Executable
Dynamic Mode
Building a Shared Object
Building a Dynamic Executable
Appendix B Versioning Quick Reference
Overview
Naming Conventions
Defining a Shared Object's Interface
Versioning a Shared Object
Versioning an Existing (Non-versioned) Shared Object
Updating a Versioned Shared Object
Adding New Symbols
Internal Implementation Changes
New Symbols and Internal Implementation Changes
Migrating Symbols to a Standard Interface
Appendix C Establishing Dependencies with Dynamic String Tokens
Overview
Instruction Set Specific Shared Objects
Reducing Auxiliary Searches
System Specific Shared Objects
Locating Associated Dependencies
Introducing $ORIGIN
Dependencies Between Unbundled Products
Index
Numbers and Symbols
A
B
C
D
E
F
G
I
L
M
N
O
P
R
S
T
U
V
W
© 2010, Oracle Corporation and/or its affiliates