VSI Openvms Linker Utility Manual
Total Page:16
File Type:pdf, Size:1020Kb
VSI OpenVMS Linker Utility Manual Document Number: DO–DLKRRM–01A Publication Date: August 2019 This manual describes the OpenVMS Linker utility. The linker creates images containing binary code and data that run on OpenVMS x86-64, OpenVMS I64, OpenVMS Alpha, or OpenVMS VAX systems. These images are primarily executable images activated at the DCL command line. The linker also creates shareable images that can be called by executable or by other shareable images. Revision Update Information: This is a new manual. Operating System and Version: VSI OpenVMS x86-64 Version 9.0 VSI OpenVMS I64 Version 8.4-1H1 VSI OpenVMS Alpha 8.4-2L1 VMS Software, Inc., (VSI) Bolton, Massachusetts, USA Linker Utility Manual: Copyright © 2019 VMS Software, Inc. (VSI), Bolton, Massachusetts, USA Legal Notice Confidential computer software. Valid license from VSI 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. The information contained herein is subject to change without notice. The only warranties for VSI products and services are set forth in the express warranty statements accompanying such products and services. Nothing herein should be construed as constituting an additional warranty. VSI shall not be liable for technical or editorial errors or omissions contained herein. HPE, HPE Integrity, HPE Alpha, and HPE Proliant are trademarks or registered trademarks of Hewlett Packard Enterprise. Intel, Itanium, and IA-64 are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries. UNIX is a registered trademark of The Open Group. The VSI OpenVMS documentation set is available on DVD. ii Linker Utility Manual Preface .................................................................................................................................... ix 1. About VSI ..................................................................................................................... ix 2. Intended Audience ......................................................................................................... ix 3. Document Structure ....................................................................................................... ix 4. Related Documents ......................................................................................................... x 5. VSI Encourages Your Comments ..................................................................................... x 6. How to Order Additional Documentation ......................................................................... x 7. Typographical Conventions ............................................................................................. x Chapter 1. Introduction ........................................................................................................ 1 1.1. Overview ..................................................................................................................... 1 1.1.1. Terminology Used in this Manual ...................................................................... 1 1.1.2. Linker Overview ............................................................................................... 2 1.1.3. Linker Functions ............................................................................................... 4 1.1.4. Using the Linker ............................................................................................... 4 1.2. Specifying Input to the Linker ...................................................................................... 6 1.2.1. Object Modules as Linker Input Files ................................................................. 7 1.2.2. Shareable Images as Linker Input Files .............................................................. 7 1.2.2.1. Including a Shareable Image in a Link Operation ...................................... 8 1.2.2.2. Installing a Shareable Image .................................................................... 9 1.2.3. Library Files as Linker Input Files ..................................................................... 9 1.2.3.1. Creating a Library File ............................................................................ 9 1.2.3.2. Including a Library File in a Link Operation .......................................... 10 1.2.4. Symbol Table Files as Linker Input Files (VAX Only) ....................................... 11 1.2.5. Options Files as Linker Input Files ................................................................... 11 1.3. Specifying Linker Output Files ................................................................................... 13 1.3.1. Creating an Executable Image .......................................................................... 14 1.3.2. Creating a Shareable Image .............................................................................. 14 1.3.3. Creating a System Image (Alpha and VAX) ...................................................... 14 1.3.4. Creating a Symbol Table File ........................................................................... 15 1.3.5. Creating a Map File ......................................................................................... 15 1.3.6. Creating a Debug Symbol File (64-Bit Systems) ............................................... 16 1.4. Controlling a Link Operation ...................................................................................... 16 1.4.1. Linker Qualifiers ............................................................................................. 16 1.4.2. Link Options ................................................................................................... 19 1.5. Linking for Different Architectures (Alpha and VAX) .................................................. 21 Chapter 2. Understanding Symbol Resolution (x86-64 and I64) .................................... 23 2.1. Overview ................................................................................................................... 23 2.1.1. Types of Symbols ............................................................................................ 23 2.1.1.1. Understanding Strong and Weak Symbols .............................................. 24 2.1.1.2. Group Symbols ..................................................................................... 24 2.1.1.3. The C Extern Common Model ............................................................... 24 2.1.1.4. Tentative Definitions in C ..................................................................... 25 2.1.1.5. Considerations for C Language Extensions ............................................. 25 2.1.2. Linker Symbol Resolution Processing ............................................................... 25 2.2. Input File Processing for Symbol Resolution ............................................................... 29 2.2.1. Processing Object Modules .............................................................................. 30 2.2.2. Processing Shareable Images ............................................................................ 32 2.2.2.1. Implicit Processing of Shareable Images ................................................ 34 2.2.3. Processing Library Files ................................................................................... 34 2.2.3.1. Identifying Library Files Using the /LIBRARY Qualifier ......................... 35 iii Linker Utility Manual 2.2.3.2. Including Specific Modules from a Library Using the /INCLUDE Qualifier ........................................................................................................... 36 2.2.3.3. Processing Default Libraries .................................................................. 36 2.2.4. Processing Input Files Selectively ..................................................................... 37 2.3. Ensuring Correct Symbol Resolution ........................................................................... 38 2.3.1. Understanding Cluster Creation ........................................................................ 38 2.3.2. Controlling Cluster Creation ............................................................................. 40 2.3.2.1. Using the CLUSTER= Option to Control Clustering ............................... 40 2.3.2.2. Using the COLLECT= Option to Control Clustering ............................... 40 2.4. Resolving Symbols Defined in the OpenVMS Executive .............................................. 41 2.5. Processing Weak and Strong Global Symbols .............................................................. 42 2.5.1. Overview of Weak and Strong Global Symbol Processing .................................. 42 2.5.1.1. Strong Symbols .................................................................................... 43 2.5.1.2. VMS-Style Weak Symbols .................................................................... 43 2.5.1.3. UNIX-Style Weak Symbols ................................................................... 43 2.5.2. Strong and Weak Definitions ............................................................................ 43 2.5.3. Resolving Strong and Weak Symbols ............................................................... 44 2.5.4. Creating and Using VMS-style Weak Symbols .................................................