Linker and Libraries Guide
  Search only this book
Download this book in 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 20
......Symbol Resolution 21
......Undefined Symbols 27
......Tentative Symbol Order Within the Output File 31
......Defining Additional Symbols 32
...Generating the Output Image 33
...Debugging Aids 34

3. Runtime Linker
39
...Overview 39
...Locating Shared Object Dependencies 40
......Directories Searched by the Runtime Linker 40
...Relocation Processing 43
......Symbol Lookup 45
......When Relocations are Performed 46
......Relocation Errors 47
...Adding Additional Objects 48
...Initialization and Termination Routines 50
...Runtime Linking Programming Interface 50
......Adding Additional Objects 52
......Relocation Processing 54
......Obtaining New Symbols 58
...Debugging Aids 62

4. Shared Objects
67
...Overview 67
...Naming Conventions 68
......Recording a Shared Object Name 69
...Versioning 73
......Coordination Of Binding Requirements 74
...Shared Objects With Dependencies 76
...Dependency Ordering 77
...Shared Objects as Filters 78
...Performance Considerations 81
......Useful Tools 81
......The Underlying System 84
......Position-Independent Code 85
......Maximizing Shareability 86
......Minimizing Paging Activity 89
......Relocations 90

5. Object Files
97
...Introduction 97
...File Format 98
......Data Representation 99
...ELF Header 100
......Section Header 106
......String Table 118
......Symbol Table 119
......Relocation 124
...Dynamic Linking 131
......Program Header 132
......Program Loading (Processor-Specific) 140
......Runtime Linker 147
......Hash Table 161

6. Mapfile Option
165
...Introduction 165
...Using the Mapfile Option 166
...Mapfile Structure and Syntax 166
......Segment Declarations 167
......Mapping Directives 171
......Size-Symbol Declarations 173
...Mapping Example 173
...Mapfile Option Defaults 175
...Internal Map Structure 176
...Error Messages 179
......Warnings 179
......Fatal Errors 180

A. Link-Editor Quick Reference
183
...Static Mode 183
......Building a Relocatable Object 184
......Building a Static Executable 184
...Dynamic Mode 184
......Building a Shared Object 184
......Building a Dynamic Executable 185

Index
187