Openvms Linker Utility Manual
Total Page:16
File Type:pdf, Size:1020Kb
OpenVMS Linker Utility Manual Order Number: AA–PV6CD–TK April 2001 This manual describes the OpenVMS Linker utility. Revision/Update Information: This manual supersedes the OpenVMS Linker Utility Manual, Version 7.1 Software Version: OpenVMS Alpha Version 7.3 OpenVMS VAX Version 7.3 Compaq Computer Corporation Houston, Texas © 2001 Compaq Computer Corporation Compaq, VAX, VMS, and the Compaq logo Registered in U.S. Patent and Trademark Office. OpenVMS is a trademark of Compaq Information Technologies Group, L.P. in the United States and other countries. UNIX is a trademark of The Open Group. All other product names mentioned herein may be the trademarks or registered trademarks of their respective companies. Confidential computer software. Valid license from Compaq required for possession, use, or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor’s standard commercial license. Compaq shall not be liable for technical or editorial errors or omissions contained herein. The information in this document is provided "as is" without warranty of any kind and is subject to change without notice. The warranties for Compaq products are set forth in the express limited warranty statements accompanying such products. Nothing herein should be construed as constituting an additional warranty. ZK4548 The Compaq OpenVMS documentation set is available on CD–ROM. This document was prepared using VAX DOCUMENT Version 2.1. Contents Preface ............................................................ xi Part I Linker Utility Description 1 Introduction 1.1 Overview . ................................................ 1–1 1.1.1 Linker Functions . ........................................ 1–2 1.1.2 Using the Linker . ........................................ 1–3 1.2 Specifying Input to the Linker . ................................ 1–4 1.2.1 Object Modules as Linker Input Files . ....................... 1–6 1.2.2 Shareable Images as Linker Input Files ....................... 1–6 1.2.2.1 Including a Shareable Image in a Link Operation ............. 1–7 1.2.2.2 Installing a Shareable Image ............................. 1–8 1.2.3 Library Files as Linker Input Files ........................... 1–8 1.2.3.1 Creating a Library File . ................................ 1–8 1.2.3.2 Including a Library File in a Link Operation . ............... 1–9 1.2.4 Symbol Table Files as Linker Input Files ...................... 1–10 1.2.5 Options Files as Linker Input Files ........................... 1–11 1.3 Specifying Linker Output Files . ................................ 1–12 1.3.1 Creating an Executable Image ............................... 1–13 1.3.2 Creating a Shareable Image . ................................ 1–14 1.3.3 Creating a System Image . ................................ 1–14 1.3.4 Creating a Symbol Table File ................................ 1–14 1.3.5 Creating a Map File ....................................... 1–15 1.3.6 Creating a Debug Symbol File (Alpha Images Only) .............. 1–15 1.4 Optimizing the Performance of Alpha Images ...................... 1–15 1.4.1 Linker Default Image Optimizations (Alpha Images Only) . ....... 1–16 1.4.2 Installing Images as Resident Images (Alpha Systems Only) ....... 1–17 1.5 Controlling a Link Operation . ................................ 1–17 1.5.1 Linker Qualifiers . ........................................ 1–17 1.5.2 Link Options ............................................ 1–19 1.6 Linking for Different Architectures .............................. 1–21 2 Understanding Symbol Resolution 2.1 Overview . ................................................ 2–1 2.1.1 Types of Symbols . ........................................ 2–1 2.1.2 Linker Symbol Resolution Processing . ....................... 2–2 2.2 Input File Processing for Symbol Resolution ....................... 2–5 2.2.1 Processing Object Modules . ................................ 2–6 2.2.2 Processing Shareable Images ................................ 2–11 iii 2.2.3 Processing Library Files .................................... 2–12 2.2.3.1 Identifying Library Files Using the /LIBRARY Qualifier ........ 2–13 2.2.3.2 Including Specific Modules from a Library Using the /INCLUDE Qualifier . ............................................ 2–14 2.2.3.3 Processing Default Libraries . ............................ 2–14 2.2.3.4 Open Systems Library Support ........................... 2–15 2.2.4 Processing Input Files Selectively ............................ 2–16 2.3 Ensuring Correct Symbol Resolution . ............................ 2–17 2.3.1 Understanding Cluster Creation . ............................ 2–17 2.3.2 Controlling Cluster Creation ................................ 2–19 2.3.2.1 Using the CLUSTER= Option to Control Clustering ........... 2–19 2.3.2.2 Using the COLLECT= Option to Control Clustering ........... 2–19 2.4 Resolving Symbols Defined in the OpenVMS Executive ............... 2–20 2.5 Defining Weak and Strong Global Symbols ........................ 2–21 3 Understanding Image File Creation 3.1 Overview .................................................. 3–1 3.2 Creating Program Sections .................................... 3–3 3.3 Creating Image Sections . .................................... 3–9 3.3.1 Processing Clusters to Create Image Sections ................... 3–9 3.3.2 Combining Program Sections into Image Sections ................ 3–10 3.3.3 Processing Significant Program Section Attributes ............... 3–11 3.3.4 Allocating Memory for Image Sections ......................... 3–17 3.3.5 Image Section Attributes ................................... 3–18 3.3.6 Controlling Image Section Creation ........................... 3–22 3.3.6.1 Modifying Program Section Attributes . ................... 3–22 3.3.6.2 Manipulating Cluster Creation ........................... 3–23 3.3.6.3 Isolating a Program Section into an Image Section . ........... 3–23 3.4 Initializing an Image ......................................... 3–24 3.4.1 Writing the Binary Contents of Image Sections .................. 3–24 3.4.2 Fixing Up Addresses . .................................... 3–25 3.4.3 Keeping the Size of Image Files Manageable . ................... 3–26 3.4.3.1 Controlling Demand-Zero Image Section Creation . ........... 3–26 4 Creating Shareable Images 4.1 Overview .................................................. 4–1 4.2 Declaring Universal Symbols in VAX Shareable Images . ........... 4–2 4.2.1 Creating Upwardly Compatible Shareable Images (VAX Linking Only) .................................................. 4–4 4.2.1.1 Creating a Transfer Vector (VAX Linking Only) ............... 4–5 4.2.1.2 Fixing the Location of the Transfer Vector in Your Image (VAX Linking Only) ......................................... 4–7 4.2.2 Creating Based Shareable Images (VAX Linking Only) . ........... 4–7 4.3 Declaring Universal Symbols in Alpha Shareable Images . ........... 4–8 4.3.1 Symbol Definitions Point to Shareable Image Psects (Alpha Linking Only) .................................................. 4–9 4.3.2 Creating Upwardly Compatible Shareable Images (Alpha Linking Only) .................................................. 4–10 4.3.3 Deleting Universal Symbols Without Disturbing Upward Compatibility (Alpha Linking Only) ........................... 4–10 4.3.4 Creating Run-Time Kits (Alpha Linking Only) .................. 4–11 iv 4.3.5 Specifying an Alias Name for a Universal Symbol (Alpha Linking Only) . ................................................ 4–11 4.3.6 Improving the Performance of Installed Shareable Images (Alpha Linking Only) ............................................ 4–12 5 Interpreting an Image Map File 5.1 Overview . ................................................ 5–1 5.2 Components of an Image Map File ............................... 5–2 5.2.1 Object Module Synopsis .................................... 5–3 5.2.2 Module Relocatable Reference Synopsis (VAX Linking Only) . ....... 5–3 5.2.3 Image Section Synopsis Section .............................. 5–4 5.2.4 Program Section Synopsis Section ............................ 5–6 5.2.5 Symbols By Name Section . ................................ 5–8 5.2.6 Symbol Cross-Reference Section .............................. 5–8 5.2.7 Symbols By Value Section . ................................ 5–9 5.2.8 Image Synopsis Section .................................... 5–10 5.2.9 Link Run Statistics Section . ................................ 5–11 Part II LINK Command Reference LINK .....................................................LINKER–3 Qualifier Descriptions ...............................................LINKER–4 /ALPHA ................................................LINKER–5 /BPAGE................................................LINKER–6 /BRIEF . ................................................LINKER–8 /CONTIGUOUS . ........................................LINKER–9 /CROSS_REFERENCE .....................................LINKER–10 /DEBUG ................................................LINKER–11 /DEMAND_ZERO (Alpha Only) ..............................LINKER–12 /DSF (Alpha Only) ........................................LINKER–14 /EXECUTABLE . ........................................LINKER–15 /FULL . ................................................LINKER–16 /GST (Alpha Only) ........................................LINKER–17 /HEADER ...............................................LINKER–18 /INCLUDE ..............................................LINKER–19