CONTENTS Title Page Copyright Page Preface Part I-Linker Utility Description 1 Introduction 1.1 Overview 1.2 The LINK Command 1.3 LINK Qualifiers 1.3.1 Command Qualifiers 1.3.2 Positional Qualifiers 1.4 Linker Input 1.5 Linker Output 1.6 Linker Functions 1.7 Image Activation 1.8 Options Files 1.9 Shareable Images 1.9.1 Writing Source Programs for Shareable Images 1.9.2 Rules for Creating Upwardly Compatible Shareable Images 1.9.3 Creating a Shareable Image 1.9.4 Creating Privileged Shareable Images 1.9.5 Using Shareable Images 1.10 Image Map 1.11 Additional Linking Control Functions 1.11.1 Modifying Program Section Attributes 1.11.2 Controlling Program Section Location 2 Linker Overview 2.1 Reasons for Having a Linker 2.2 Input to the Linker 2.2.1 Object File 2.2.2 Shareable Image File 2.2.3 Symbol Table File 2.2.4 Library File 2.2.5 Options File 2.3 Output of the Linker 2.3.1 Executable Image 2.3.2 Shareable Image 2.3.3 System Image 2.3.4 Image Map 2.3.5 Symbol Table File 2.4 Linker Functions 2.4.1 Resolution of Symbolic References 2.4.1.1 Types of Symbols 2.4.1.2 Designation of Local, Global, and Universal Symbols 2.4.1.3 Weak and Strong Global Symbols 2.4.2 Virtual Memory Allocation 2.4.3 Image Initialization 2.5 Image Activation 3 Options Files 3.1 When to Use an Options File 3.1.1 Entering Frequently Used Input Specifications 3.1.2 Identifying a Shareable Image as Input 3.1.3 Entering Very Long Commands 3.1.4 Entering Link Options 3.2 How to Create and Specify an Options File 3.3 Link Options 4 Shareable Images 4.1 Benefits and Uses of Shareable Images 4.1.1 Conserving Disk Storage Space 4.1.2 Conserving Main Physical Memory 4.1.3 Reducing Paging I/O 4.1.4 Sharing Memory-Resident Databases 4.1.5 Making Software Updates Compatible 4.2 Writing Source Programs for Shareable Images 4.2.1 Shareability 4.2.2 Position Independence 4.2.3 Transfer Vectors 4.2.3.1 Advantages of Transfer Vectors 4.2.3.2 Creating Transfer Vectors 4.2.4 Rules for Creating Upwardly Compatible Shareable Images 4.3 Creating a Shareable Image 4.3.1 Using the UNIVERSAL= Option 4.3.2 Using the GSMATCH= Option 4.3.3 Creating Privileged Shareable Images 4.4 Using Shareable Images 4.5 Examples of Shareable Images 4.5.1 Sharing Resource Allocation 4.5.2 Complex Shareable Images 5 Image Map 5.1 Types of Image Map 5.2 Image Map Sections 5.3 Example of a Full Map 6 Linker Operations 6.1 Types of Image 6.1.1 Executable Image 6.1.2 Shareable Image 6.1.3 System Image 6.2 Input to the Linker 6.2.1 Object Modules 6.2.1.1 Program Section Name 6.2.1.2 Program Section Size 6.2.1.3 Program Section Alignment 6.2.1.4 Program Section Attributes 6.2.2 Shareable Images 6.3 The Linker's Processing Algorithm 6.3.1 Command Processing 6.3.1.1 Processing Nonoptions Files 6.3.1.2 Processing Options Files 6.3.1.3 Considerations in Specifying Input 6.3.2 After Command Processing 6.3.3 Pass 1 6.3.3.1 Processing Object Files 6.3.3.2 Processing Other Files 6.3.3.3 Processing Default Libraries 6.3.4 After Pass 1 6.3.4.1 Generation of Image Sections 6.3.4.2 Memory Allocation for the Cluster 6.3.4.3 Relocation of Image Sections 6.3.5 Pass 2 6.3.6 After Pass 2 6.3.6.1 Demand-Zero Compression 6.3.6.2 Insertion of the Fix-Up Image Section 6.3.6.3 Writing of the Image File 7 VAX Object Language 7.1 Object Language Overview 7.2 Header Records 7.2.1 Main Module Header Record (MHD$C_MHD) 7.2.2 Language Processor Name Header Record (MHD$C_LNM) 7.2.3 Source Files Header Record (MHD$C_SRC) 7.2.4 Title Text Header Record (MHD$C_TTL) 7.3 Global Symbol Directory Records 7.3.1 Program Section Definition Subrecord (GSD$C_PSC) 7.3.2 Global Symbol Specification Subrecord (GSD$C_SYM) 7.3.2.1 GSD Subrecord for a Symbol Definition 7.3.2.2 GSD Subrecord for a Symbol Reference 7.3.3 Entry-Point-Symbol-and-Mask-Definition Subrecord (GSD$C_EPM) 7.3.4 Procedure-with-Formal-Argument-Definition Subrecord(GSD$C_PRO) 7.3.5 Symbol-Definition-with-Word-Psect Subrecord (GSD$C_SYMW) 7.3.6 Entry-Point-Definition-with-Word-Psect Subrecord (GSD$C_EPMW) 7.3.7 Procedure-Definition-with-Word-Psect Subrecord (GSD$C_PROW) 7.3.8 Entity-Ident-Consistency-Check Subrecord (GSD$C_IDC) 7.3.9 Environment-Definition/Reference Subrecord (GSD$C_ENV) 7.3.10 Module-Local Symbol Definition/Symbol Reference Subrecord (GSD$C_LSY) 7.3.10.1 Module-Local Symbol Definition 7.3.10.2 Module-Local Symbol Reference 7.3.11 Module-Local Entry-Point-Definition Subrecord (GSD$C_LEPM) 7.3.12 Module-Local Procedure-Definition Subrecord (GSD$C_LPRO) 7.3.13 Program-Section-Definition-in-Shareable-Image Subrecord (GSD$C_SPSC) 7.3.14 Vectored-Symbol-Definition Subrecord (GSD$C_SYMV) 7.3.15 Vectored-Entry-Point-Definition Subrecord (GSD$C_EPMV) 7.3.16 Vectored-Procedure-Definition Subrecord (GSD$C_PROV) 7.3.17 Symbol-Definition-with-Version-Mask Subrecord (GSD$C_SYMM) 7.3.18 Entry-Point-Definition-with-Version-Mask Subrecord (GSD$C_EPMM) 7.3.19 Procedure-Definition-with-Version-Mask Subrecord (GSD$C_PROM) 7.4 Text Information and Relocation Records (OBJ$C_TIR) 7.4.1 Stack Commands 7.4.2 Store Commands 7.4.3 Operator Commands 7.4.4 Control Commands 7.5 End of Module Record 7.6 End of Module with Word Psect Record 7.7 Debugger Information Records 7.8 Traceback Information Records 7.9 Link Option Specification Records Part II-Linker Qualifiers LINKER Command Qualifiers /BRIEF /CONTIGUOUS /CROSS_REFERENCE /DEBUG /EXECUTABLE /FULL /HEADER /MAP /P0IMAGE /PROTECT /SHAREABLE /SYMBOL_TABLE /SYSLIB /SYSSHR /SYSTEM /TRACEBACK /USERLIBRARY LINKER Positional Qualifiers /INCLUDE /LIBRARY /OPTIONS /SELECTIVE_SEARCH /SHAREABLE LINKER Examples EXAMPLES 4-1 Transfer Vector Coded for a Procedure Call 4-2 Transfer Vector Coded for a Subroutine Call 4-3 Sharing Resource Allocation Procedures Among Shareable Images 4-4 Using Complex Shareable Images FIGURES 2-1 Symbol Resolution 4-1 Shareable Image Without Transfer Vectors 4-2 Shareable Image with Transfer Vectors 7-1 Order of Records in an Object Module 7-2 GSD Record with Multiple Subrecords TABLES 3-1 Link Options 5-1 Image Map Sections 6-1 Order of Image Sections in Clusters 7-1 Types of GSD Subrecords 7-2 Stack Commands 7-3 Store Commands 7-4 Operator Commands 7-5 Control Commands LINK-1 Command Qualifiers LINK-2 Positional Qualifiers