Linker and Libraries Guide
  Buscar sólo este libro
Descargar este libro en PDF

............................Contents


Preface
xiii

1. Introduction
1
...Link-Editing 2
...Runtime Linking 3
......Dynamic Executables 3
......Shared Objects 4
...Related Topics 4
......Dynamic Linking 4
......Application Binary Interfaces 5
......Support Tools 5

2. Link-Editor
7
...Overview 7
...Invoking the Link-Editor 8
......Direct Invocation 9
......Using a Compiler Driver 9
...Specifying the Link-Editor Options 10
...Input File Processing 11
......Archive Processing 12
......Shared Object Processing 13
......Linking with Additional Libraries 14
......Initialization and Termination Sections 19
...Symbol Processing 21
......Symbol Resolution 21
......Undefined Symbols 27
......Tentative Symbol Order Within the Output File 31
......Defining Additional Symbols 32
......Reducing Symbol Scope 37
...Generating the Output Image 42
...Link-Editor Support Interface 43
......Invoking the Support Interface 43
......Support Interface Functions 44
......Support Interface Example 46
...Debugging Aids 48

3. Runtime Linker
53
...Overview 53
...Locating Shared Object Dependencies 54
......Directories Searched by the Runtime Linker 55
...Relocation Processing 57
......Symbol Lookup 59
......When Relocations are Performed 60
......Relocation Errors 61
...Loading Additional Objects 62
...Initialization and Termination Routines 64
...Security 64
...Runtime Linking Programming Interface 65
......Loading Additional Objects 67
......Relocation Processing 69
......Obtaining New Symbols 73
...Debugging Aids 77

4. Shared Objects
83
...Overview 83
...Naming Conventions 84
......Recording a Shared Object Name 86
...Shared Objects with Dependencies 89
...Dependency Ordering 90
...Shared Objects as Filters 91
......Generating a Standard Filter 92
......Generating an Auxiliary Filter 95
... Performance Considerations 96
......Useful Tools 97
......The Underlying System 100
......Position-Independent Code 100
......Maximizing Shareability 102
......Minimizing Paging Activity 105
......Relocations 106
......Profiling Shared Objects 111

5. Versioning
115
...Overview 115
...Interface Compatibility 116
...Internal Versioning 117
......Creating a Version Definition 118
......Binding to a Version Definition 126
......Specifying a Version Binding 132
......Relocatable Objects 135
...External Versioning 135
......Coordination of Versioned Filenames 136

6. Object Files
139
...Introduction 139
...File Format 140
......Data Representation 141
......ELF Header 142
......ELF Identification 146
......Sections 148
......Special Sections 157
......String Table 161
......Symbol Table 162
......Relocation 167
......Versioning Information 181
......Note Section 187
...Dynamic Linking 189
......Program Header 189
......Program Loading (Processor-Specific) 195
......Runtime Linker 205
......Hash Table 224
......Initialization and Termination Functions 225

7. Mapfile Option
227
...Introduction 227
...Using the Mapfile Option 228
...Mapfile Structure and Syntax 228
......Segment Declarations 229
......Mapping Directives 233
......Size-Symbol Declarations 236
......File Control Directives 236
...Mapping Example 236
...Mapfile Option Defaults 239
...Internal Map Structure 240
...Error Messages 243
......Warnings 243
......Fatal Errors 244

A. Link-Editor Quick Reference
245
...Static Mode 245
......Building a Relocatable Object 246
......Building a Static Executable 246
...Dynamic Mode 246
......Building a Shared Object 246
......Building a Dynamic Executable 248

B. Versioning Quick Reference
249
...Naming Conventions 250
...Defining a Shared Object's Interface 251
...Versioning a Shared Object 252
......Versioning an Existing (Non-versioned) Shared Object 253
...Updating a Versioned Shared Object 253
......Adding New Symbols 254
......Internal Implementation Changes 255
......New Symbols and Internal Implementation Changes 255
......Migrating Symbols to a Standard Interface 256

Index
261