Title and Copyright Information
 
About this Manual
Audience
Necessity
Organization
Related Documents
Reader's Comments
Conventions
 
1    Introduction
1.1    Definitions
1.2    History and Applicability
1.3    Producers and Consumers
1.3.1    Compilers
1.3.2    Assemblers
1.3.3    Linkers
1.3.4    Loaders
1.3.5    Debuggers
1.3.6    Object Instrumentation Tools
1.3.6.1    Post-Link Optimizers
1.3.6.2    Profiling Tools
1.3.7    Archivers
1.3.8    Miscellaneous Object Tools
1.3.8.1    Object Dumpers
1.3.8.2    Object Manipulators
1.4    Object File Overview
1.4.1    Main Components of Object Files
1.4.1.1    Object File Headers
1.4.1.2    Instructions and Data
1.4.1.3    Object File Relocation Information
1.4.1.4    Symbol Table
1.4.1.5    Dynamic Loading Information
1.4.1.6    Comment Section
1.4.2    Kinds of Object Files
1.4.3    Object File Compression
1.4.4    Object Archives
1.4.5    Object File Versioning
1.4.6    Object File Abstract Data Types
1.5    Source Language Support
1.6    System Dependencies
1.7    Architectural Dependencies
1.8    Relevant Header Files
 
2    Headers
2.1    New or Changed Header Features
2.2    Structures, Fields, and Values for Headers
2.2.1    File Header (filehdr.h)
2.2.2    a.out Header (aouthdr.h)
2.2.3    Section Headers (scnhdr.h)
2.3    Header Usage
2.3.1    Object Recognition
2.3.2    Image Layout
2.3.2.1    OMAGIC
2.3.2.2    NMAGIC
2.3.2.3    ZMAGIC
2.3.3    Address Space
2.3.3.1    Address Selection
2.3.3.2    TASO Address Space
2.3.3.2.1    Runtime Identification of TASO programs
2.3.4    GP (Global Pointer) Ranges
2.3.5    Alignment
2.3.6    Section Types
2.3.7    Special Symbols
2.3.7.1    Accessing
2.4    Language-Specific Header Features
 
3    Instructions and Data
3.1    New or Changed Instructions and Data Features
3.2    Structures, Fields, and Values for Instructions and Data
3.2.1    Code Range Descriptor (pdsc.h)
3.2.2    Run-time Procedure Descriptor (pdsc.h)
3.3    Instructions and Data Usage
3.3.1    Minimal Objects
3.3.2    Position-Independent Code (PIC)
3.3.3    Lazy-Text Stubs
3.3.4    Constant Data
3.3.5    INIT/FINI Driver Routines
3.3.5.1    Linking
3.3.5.2    Execution Order
3.3.5.2.1    Dynamic Executables
3.3.5.2.2    Static Executables
3.3.5.2.3    Ordering Within Objects
3.3.5.2.4    Subsystem Control of INIT/FINI Order
3.3.6    Initialized Data and Zero-Initialized Data (bss)
3.3.7    Permissions/Protections
3.3.8    Exception Handling Data
3.3.9    Thread Local Storage (TLS) Data
3.3.10    User Text and User Data Sections
3.4    Language-Specific Instructions and Data Features
 
4    Object Relocation
4.1    New or Changed Object Relocation Features
4.2    Structures, Fields, and Values for Object Relocation
4.2.1    Relocation Entry (reloc.h)
4.2.2    Section Header
4.3    Object Relocations Usage
4.3.1    Relocatable Objects
4.3.2    Relocation Processing
4.3.2.1    Local and External Entries
4.3.2.2    Relocation Entry Ordering
4.3.2.3    Shared Object Transformation
4.3.3    Kinds of Relocations
4.3.3.1    Direct Relocations
4.3.3.2    GP-Relative Relocations
4.3.3.3    Self-Relative (PC-Relative) Relocations
4.3.3.4    Literal Relocations
4.3.3.5    Relocation Stack Expressions
4.3.3.6    Immediate Relocations
4.3.3.7    TLS Relocations
4.3.4    Relocation Entry Types
4.3.4.1    R_ABS
4.3.4.2    R_REFLONG
4.3.4.3    R_REFQUAD
4.3.4.4    R_GPREL32
4.3.4.5    R_LITERAL
4.3.4.6    R_LITUSE: R_LU_BASE
4.3.4.7    R_LITUSE: R_LU_JSR
4.3.4.8    R_GPDISP
4.3.4.9    R_BRADDR
4.3.4.10    R_HINT
4.3.4.11    R_SREL16
4.3.4.12    R_SREL32
4.3.4.13    R_SREL64
4.3.4.14    R_OP_PUSH
4.3.4.15    R_OP_STORE
4.3.4.16    R_OP_PSUB
4.3.4.17    R_OP_PRSHIFT
4.3.4.18    R_GPVALUE
4.3.4.19    R_GPRELHIGH
4.3.4.20    R_GPRELLOW
4.3.4.21    R_IMMED: GP16
4.3.4.22    R_IMMED: GP_HI32
4.3.4.23    R_IMMED: SCN_HI32
4.3.4.24    R_IMMED: BR_HI32
4.3.4.25    R_IMMED: LO32
4.3.4.26    R_TLS_LITERAL
4.3.4.27    R_TLS_HIGH
4.3.4.28    R_TLS_LOW
4.4    Language-Specific Relocations Features
 
5    Image Relocation
5.1    New or Changed Image Relocations Features
5.2    Structures, Fields, and Values for Image Relocation
5.2.1    Compact Relocation Records
5.2.2    Linkerdef Relocation Records (scncomment.h)
5.2.2.1    Linkerdef Symbol Enumeration
5.3    Image Relocation Usage
5.3.1    Compact Relocations
5.3.1.1    Overview
5.3.1.2    File Format
5.3.1.2.1    Compact Relocation Version
5.3.1.2.2    Compact Relocations File Header
5.3.1.2.3    Compact Relocations Section Header
5.3.1.2.4    Compact Relocations Table
5.3.1.2.5    Stack Relocation Table
5.3.1.2.6    GP Value Tables
5.3.1.3    Basic Algorithm for Compact Relocations Production
5.3.1.4    Basic Algorithm for Compact Relocations Consumption
5.3.2    Linkerdef Relocations
5.4    Language-Specific Image Relocations Features
 
6    Symbol Table
6.1    New or Changed Symbol Table Features
6.2    Structures, Fields and Values for Symbol Tables
6.2.1    Symbolic Header (HDRR)
6.2.2    Relative File Descriptor Entry (RFDT)
6.2.3    Optimization Symbol Entry (PPODHDR)
6.3    Symbol Table Usage
6.3.1    Levels of Symbolic Information
6.3.1.1    Compilation Levels
6.3.1.2    Locally Stripped Images
6.3.1.3    (Fully) Stripped Images
6.3.2    Source File Merging
6.3.3    Optimization Symbols
 
7    Line Number Information
7.1    New or Changed Line Number Features
7.2    Structures, Fields, and Values for Line Numbers
7.2.1    Line Number Entry (LINER)
7.3    Line Number Usage
7.3.1    Line Number Information
7.3.1.1    The Line Number Table
7.3.1.2    Extended Source Location Information (ESLI)
 
8    Run-Time Information
8.1    New or Changed Run-Time Information Features
8.2    Structures, Fields, and Values for Run-Time Information
8.2.1    File Descriptor Entry (FDR)
8.2.2    Procedure Descriptor Entry (PDR)
8.3    Run-Time Information Usage
8.3.1    Procedure Addresses
8.3.2    Stack Frames
8.3.3    Local Symbol Addresses
8.3.4    Uplevel Links
8.3.5    Finding Thread Local Storage (TLS) Symbols
 
9    Profile Feedback Data
9.1    New or Changed Profile Feedback Data Features
9.2    Structures, Fields, and Values for Profile Feedback Data
9.3    Profile Feedback Data Usage
 
10    Object Annotation Data
10.1    New or Changed Object Annotation Data Features
10.2    Structures, Fields, and Values for Object Annotation Data
10.2.1    Annotation Summary Header
10.2.2    Annotation Restricted Offset Flags
10.2.3    Annotation Restricted Instruction Flags
10.2.4    Annotation Restricted Sequence Flags
10.2.5    Annotation Restricted Call Flags
10.2.6    Annotation Restricted Entry Flags
10.2.7    Annotation Restricted Return Flags
10.2.8    Annotation Linkage Flags
10.3    Object Annotation Data Usage
10.3.1    Representation of Object Annotation Data
10.3.1.1    Object Annotation Summary
10.3.1.2    Restricted Offset Annotation
10.3.1.3    Restricted Instruction Annotation
10.3.1.4    Restricted Instruction Sequence Annotation
10.3.1.5    Restricted Call Annotation
10.3.1.6    Restricted Entry Annotation
10.3.1.7    Restricted Return Annotation
10.3.1.8    Jump Table Annotation
10.3.1.9    Call Specified Linkage Annotation
10.3.1.10    Entry Specified Linkage Annotation
10.3.1.11    Entry Utilized Linkage Annotation
10.3.1.12    Entry Implemented Linkage Annotation
10.3.1.13    Return Specified Linkage Annotation
 
11    Symbol Information
11.1    New or Changed Symbol Information Features
11.2    Structures, Fields, and Values for Symbol Information
11.2.1    Local Symbol Entry (SYMR)
11.2.2    Auxiliary Symbol Table Entry (AUXU)
11.2.2.1    Type Information Record (TIR)
11.2.2.2    Relative Index Record (RNDXR)
11.2.3    String Table
11.2.4    Symbol Type Combinations
11.3    Symbol Information Usage
11.3.1    Scopes
11.3.1.1    Local Symbols with External Linkage
11.3.1.2    Procedure Scope
11.3.1.3    File Scope
11.3.1.4    Block Scope
11.3.1.5    Namespaces (C++)
11.3.1.5.1    Namespace Components
11.3.1.5.2    Namespace Aliases
11.3.1.5.3    Unnamed Namespace
11.3.1.5.4    Usage of Namespaces
11.3.1.6    Fortran Modules
11.3.1.6.1    Modules with Use Statements
11.3.1.6.2    Fortran Generic Interfaces
11.3.1.7    Exception Handling Blocks (C++)
11.3.1.8    Fortran Common Blocks
11.3.1.9    Alternate Entry Points
11.3.2    Data Types in the Symbol Table
11.3.2.1    Basic Types
11.3.2.2    Type Qualifiers
11.3.2.3    Interpreting Type Descriptions in the Auxiliary Table
11.3.3    Individual Type Representations
11.3.3.1    Pointer Type
11.3.3.2    Array Type
11.3.3.3    Structure, Union, and Enumerated Types
11.3.3.4    Typedef Type
11.3.3.5    Function Pointer Type
11.3.3.6    Class Type (C++)
11.3.3.6.1    Empty Class or Structure (C++)
11.3.3.6.2    Opaque Class or Structure (C++)
11.3.3.6.3    Base and Derived Classes (C++)
11.3.3.7    Template Type (C++)
11.3.3.8    Interlude Type (C++)
11.3.3.9    Array Descriptor Type (Fortran90)
11.3.3.10    Conformant Array Type (Pascal)
11.3.3.11    Variant Record Type (Pascal and Ada)
11.3.3.12    Subrange Type (Pascal and Ada)
11.3.3.13    Set Type (Pascal)
11.3.4    Special Debug Symbols
11.4    Language-Specific Symbol Information Features
11.4.1    Fortran77 and Fortran90
11.4.2    C++
11.4.3    Pascal and Ada
 
12    Optimized Debugging
12.1    New or Changed Optimized Debugging Features
12.2    Structures, Fields, and Values for Optimized Debugging
12.2.1    OPTRNDX
12.3    Optimized Debugging Usage
12.3.1    Semantic Events
12.3.2    Split Lifetime Variables
12.3.2.1    Target Variable Identifier
12.3.2.2    Child Description Scheme
12.3.2.3    Child Descriptions
12.3.2.4    Split Lifetime Variable Example
12.3.3    Discontiguous Scopes
 
13    Symbol Resolution
13.1    New or Changed Symbol Resolution Features
13.2    Structures, Fields, and Values for Symbol Resolution
13.2.1    External Symbol Entry (EXTR)
13.3    Symbol Resolution Usage
13.3.1    Library Search
13.3.2    Resolution of Symbols with Common Storage Class
13.3.3    Mangling and Demangling
13.3.4    Mixed Language Resolution
13.3.5    TLS Symbols
 
14    Dynamic Loading Information
14.1    New or Changed Dynamic Loading Information Features
14.2    Structures, Fields, and Values for Dynamic Loading Information
14.2.1    Dynamic Header Entry
14.2.2    Dynamic Symbol Entry
14.2.3    Dynamic Relocation Entry
14.2.4    Msym Table Entry
14.2.5    Library List Entry
14.2.6    Conflict Entry
14.2.7    GOT Entry
14.2.8    Hash Table Entry
14.2.9    Dynamic String Table
14.3    Dynamic Loading Information Usage
14.3.1    Shared Object Identification
14.3.2    Shared Library Dependencies
14.3.2.1    Identification
14.3.2.2    Searching
14.3.2.3    Validation
14.3.2.3.1    Backward Compatibility
14.3.2.4    Loading
14.3.2.4.1    Dynamic Loading and Unloading
14.3.3    Dynamic Symbol Information
14.3.3.1    Finding Symbol Addresses
14.3.3.2    Scope and Binding
14.3.3.3    Multiple GOT Representation
14.3.3.4    Msym Table
14.3.3.5    Hash Table
14.3.4    Dynamic Symbol Resolution
14.3.4.1    Symbol Preemption and Namespace Pollution
14.3.4.2    Weak Symbols
14.3.4.3    Search Order
14.3.4.4    Precedence
14.3.4.5    Lazy Text Resolution
14.3.4.6    Levels of Resolution
14.3.5    Dynamic Relocation
14.3.6    Quickstart
14.3.6.1    Quickstart Levels
14.3.6.2    Conflict Table
14.3.6.3    Repairing Quickstart
 
15    Comment Section
15.1    New and Changed Comment Section Features
15.2    Structures, Fields, and Values of the Comment Section
15.2.1    Subsection Headers
15.2.2    Tag Descriptor Entry
15.2.2.1    Comment Section Flags
15.3    Comment Section Usage
15.3.1    Comment Section Formatting Requirements
15.3.2    Comment Section Contents
15.3.3    Comment Section Processing
15.3.4    Special Comment Subsections
15.3.4.1    Tag Descriptors (CM_TAGDESC)
15.3.4.2    Tool Version Information (CM_TOOLVER)
 
16    Archives
16.1    New and Changed Archive Features
16.2    Structures, Fields, and Values for Archives
16.2.1    Archive Magic String
16.2.2    Archive Header
16.2.3    Hash Table (ranlib) Structure
16.3    Archive Implementation
16.3.1    Archive File Format
16.3.2    Symdef File Implementation
16.4    Archive Usage
16.4.1    Role As Libraries
16.4.2    Portability
 
17    Symbol Table Examples
17.1    C
17.1.1    Unnamed Structure
17.2    C++
17.2.1    Base and Derived Classes
17.2.2    Virtual Function Tables and Interludes
17.2.3    Namespace Definitions and Uses
17.2.4    Unnamed Namespaces
17.2.5    Namespace Aliases
17.2.6    Exception-Handling
17.3    Fortran
17.3.1    Common Data
17.3.2    Alternate Entry Points
17.3.3    Array Descriptors
17.3.4    Fortran Modules
17.3.5    Contained Procedures in Fortran Modules
17.3.6    Interface Declarations in Fortran Modules
17.3.7    Generic Interfaces in Fortran Modules
17.4    Pascal
17.4.1    Sets
17.4.2    Subranges
17.4.3    Variant Records
 
18    Programming Examples
18.1    Packed Line Numbers
18.2    Extended Source Location Information
18.3    Mapping GOT Addresses to Dynamic Symbol Entries
 
Figures
1-1    Object File Producers and Consumers
1-2    Object File Contents
1-3    Object File Compression
1-4    LEB 128 Byte
1-5    LEB 128 Multi-Byte Data
1-6    Little Endian Byte Ordering
2-1    OMAGIC Layout
2-2    NMAGIC Layout
2-3    ZMAGIC Layout for Shared Object
2-4    ZMAGIC Layout for Static Executable Objects
2-5    Address Space Layout
2-6    TASO Address Space Layout
2-7    GP (Global Pointer) Ranges
3-1    Raw Data Sections of an Object File
3-2    INIT/FINI Routines in Shared Objects
3-3    INIT/FINI Recognition in Archive Libraries
3-4    INIT/FINI Example (I)
3-5    INIT/FINI Example (II)
3-6    INIT/FINI Example (III)
3-7    INIT/FINI Example (IV)
3-8    Data and Bss Segment Layout (1)
3-9    Data and Bss Segment Layout (II)
3-10    Exception-Handling Data Structures
3-11    Thread Local Storage Data Structures
4-1    Kinds of Relocations
4-2    Section Relocation Information in an Object File
4-3    Relocation Entry
4-4    External Relocation Entry
4-5    Processing an External Relocation Entry
4-6    Local Relocation Entry
4-7    Processing a Local Relocation Entry
4-8    Relocation Entry Ordering Requirements
6-1    Symbol Table Sections
6-2    Symbol Table Hierarchy
6-3    Relative File Descriptor Table Example
6-4    Optimization Symbols Section
7-1    Line Number Table
7-2    Line Number Byte Format
7-3    Line Number 3-Byte Extended Format
7-4    ESLI Data Mode Bytes
7-5    ESLI Command Byte
8-1    Fixed-Size Stack Frame
8-2    Variable-Size Stack Frame
8-3    Representation of Uplevel Reference
11-1    st/sc Combination Matrix
11-2    Basic Scopes
11-3    Procedure Representation
11-4    Procedure with No Text
11-5    File Representation
11-6    Block Representation
11-7    C++ Namespace Representation
11-8    Fortran 90 Module Representation
11-9    Fortran 90 Module with Interface Declaration
11-10    Fortran 90 Module USE (ALL) Representation
11-11    Fortran 90 Module USE with Renaming
11-12    Fortran 90 Module USE (ONLY) Representation
11-13    Fortran 90 Generic Interface Representation
11-14    C++ Exception Handler Representation
11-15    Fortran Common Block Representation
11-16    Alternate Entry Point Representation
11-17    Auxiliary Table Interpretation
11-18    Auxiliary Table "ti" Interpretation
11-19    Auxiliary Table "arrays" Interpretation
11-20    Auxiliary Table "bt vals" Interpretation
11-21    Auxiliary Table Range Interpretation
11-22    Auxiliary Table RNDXR Interpretation
11-23    Pointer Representation
11-24    Array Representation
11-25    64-Bit Array Representation
11-26    Structure Representation
11-27    Recursive Structure Representation
11-28    Nested Structure Representation
11-29    Typedef Representation
11-30    Function Pointer Representation
11-31    Function Pointer Alternate Representation
11-32    Class Representation
11-33    Empty Class or Structure (C++)
11-34    Opaque Class or Structure (C++)
11-35    Base Class Representation
11-36    Interlude Representation
11-37    Array Descriptor Representation
11-38    Array Descriptor Representation (retired)
11-39    Variant Record Representation
11-40    Variant Record Representation (retired)
11-41    Subrange Representation
11-42    64-bit Range Representation
11-43    Set Representation
14-1    Dynamic Object File Sections
14-2    Shared Library Dependencies
14-3    Valid Shared Library with Multiple Versions
14-4    Invalid Shared Library with Multiple Versions
14-5    Dynamic Symbol Table and Multiple-GOT
14-6    Msym Table
14-7    Hash Table
14-8    Hashing Example
14-9    Namespace Pollution
14-10    Weak Symbol Resolution (I)
14-11    Weak Symbol Resolution (II)
14-12    Symbol Resolution Search Order
14-13    Conflict Entry Example
15-1    Comment Section Data Organization
16-1    Archive File Organization
16-2    Symdef File Hash Table
 
Tables
1-1    COFF Basic Abstract Types
2-1    File Header Magic Numbers
2-2    File Header Flags
2-3    __EXEC_FLAGS flags
2-4    Build Revision Constants
2-5    a.out Header Magic Numbers
2-6    Section Header Constants for Section Names
2-7    Section Flags (s_flags field)
2-8    Special Symbols
3-1    Segment Access Permissions
4-1    Section Numbers for Local Relocation Entries
4-2    Relocation Types
4-3    Literal Usage Types
4-4    Immediate Relocation Types
4-5    R_GPDISP Flags
5-1    Compact Relocation Version Identifiers
6-1    Optimization Tag Values
6-2    Symbol Table Sections Produced at Various Compilation Levels
7-1    Line Number Example
7-2    ESLI Commands
7-3    ESLI Example
8-1    Source Language (lang) Constants
10-1    Architecture and Tuning Values
10-2    Object Annotation OS Revisions
11-1    Symbol Type (st) Constants
11-2    Storage Class (sc) Constants
11-3    Use Module Constants
11-4    Basic Type (bt) Constants
11-5    Type Qualifier (tq) Constants
11-6    Valid Placement for st/sc Combinations
11-7    Symbols with Auxiliary Type Descriptions
11-8    Special Debug Symbols
12-1    Semantic Event Codes
12-2    Split Lifetime Target Type Codes
12-3    Split Lifetime Target Scheme Codes
14-1    Dynamic Array Tags (d_tag)
14-2    DT_FLAGS Flags
14-3    Dynamic Symbol Type (st_info) Constants
14-4    Dynamic Symbol Binding (st_info) Constants
14-5    Dynamic Section Index (st_shndx) Constants
14-6    Library List Flags
14-7    Dynamic Symbol Categories
15-1    Comment Section Tag Values
15-2    Strip Flags
15-3    Combine Flags
15-4    Modify Flags
15-5    Default System Tag Flags
16-1    Archive Magic Strings
 
Index