Specifications
8
Linker and Librarian
After a program is compiled or assembled, it must be linked to produce an
application that can run on an OpenVMS VAX or OpenVMS AXP system. The
OpenVMS Linker Utility (linker) performs the following major steps:
• Resolves references to global symbols among the input modules
• Allocates virtual memory for the image
• Initializes the image
You can supply linker options to the linker in an options file. The use of an
options file eliminates the need to retype a long linker command every time you
relink your module or application.
You can use output from the linker to debug programs. Use the image map to
locate an instruction that caused a run-time error, translate a number displayed
by the debugger to its related symbol or address, and locate definitions of
symbols.
This chapter briefly describes the features of the linker and the Librarian utility.
For complete information about using the linker, refer to the OpenVMS Linker
Utility Manual.
8.1 Linker Input and Output
Depending on the needs of your program, the linker can accept input from the
following sources:
• Object file—Any object module created after compiling or assembling a source
program.
• Shareable image file—A separate image that was already linked but which
cannot be run as a separate file.
• Symbol table file—A separate symbol table produced by a previous link
operation. The symbol table contains global symbols and values of an image.
• Library file—The linker accepts object module libraries and shareable image
libraries.
• Options file—Input file specifications and link options that cannot be defined
at the DCL command level can be specified in this file.
Primarily, the linker produces an executable image of the program. In addition,
the linker has the capability to produce the following:
• A shareable image—An image that can be used by other programs but cannot
be executed independently.
• A system image—An image that does not execute under the control of the
operating system; rather it operates standalone on VAX or AXP hardware.
8–1










