HELP LINK — VMS 5.2
Invokes the VMS Linker to link one or more object modules into a
program image, and defines execution characteristics of the image.
For a complete description of the linker, including more information
about the LINK command, see the VMS Linker Utility Manual.
Format:
LINK file-spec[,...]
Additional information available:
ParametersCommand QualifiersPositional QualifiersExamples
Parameters
file-spec[,...] Specifies one or more input files (wildcard characters not allowed). Input files may be object modules, libraries to be searched for external references or from which specific modules are to be included, shareable images to be included in the output image or option files to be read by the linker. Separate multiple input file specifications with commas (,) or plus signs (+). In either case, the linker creates a single image file. If you omit the file type in an input file specification, the linker supplies default file types, based on the nature of the file. For object modules, file type OBJ is assumed.
Command Qualifiers
Additional information available:
/BRIEF/CONTIGUOUS/CROSS_REFERENCE/DEBUG/EXECUTABLE
/FULL/HEADER/MAP/OPTIONS/P0IMAGE/PROTECT/SHAREABLE
/SYMBOL_TABLE/SYSLIB/SYSSHR/SYSTEM/TRACEBACK
/USERLIBRARY
/BRIEF
/BRIEF Requests the linker to produce a brief map (memory allocation) file. /BRIEF is valid only if /MAP is also specified. A brief form of the map contains: o A summary of the image characteristics o A list of all object modules included in the image o A summary of link-time performance statistics
/CONTIGUOUS
/CONTIGUOUS /NOCONTIGUOUS (default) Controls whether the output image file is contiguous.
/CROSS_REFERENCE
/CROSS_REFERENCE /NOCROSS_REFERENCE (default) Controls whether the memory allocation listing ( map ) contains a symbol cross-reference list with entries for each global symbol referenced in the image, its value, and all modules in the image that refer to it.
/DEBUG
/DEBUG[=file-spec] /NODEBUG (default) Controls whether a debugger is included in the output image. If the object module contains local symbol table or traceback information, you can specify /DEBUG to include the information in the image as well. If the object module does not contain local symbol table or traceback information, only global symbols are available for symbolic debugging. If you specify the /DEBUG qualifier, by default, the VAX Symbolic Debugger is linked with the image. However, you can use the file- spec option to specify an alternate debugger (wildcard characters are not allowed). For information on using the VMS Debugger, see the VMS Debugger Manual.
/EXECUTABLE
/EXECUTABLE[=file-spec] /NOEXECUTABLE Permits you to specify whether or not the linker creates an executable image. By default the linker creates an executable image with the same file name as the first input file and a file type of EXE but this qualifier gives you the option of assigning the image a file specification (wildcard characters not allowed). The placement of the command qualifier determines the output file specification defaults. You can use /NOEXECUTABLE or /EXECUTABLE=NL: to test a set of qualifiers, options, or input object modules, without creating an image file. However, it is recommended that you use /EXECUTABLE=NL: because the linker will not process certain qualifiers if /NOEXECUTABLE is used.
/FULL
/FULL
Requests the linker to produce a full map (memory allocation)
listing. /FULL is valid only if /MAP is specified.
A full listing contains the following information:
o All the information included in the brief listing (see /BRIEF)
o Detailed descriptions of each program section and image section
in the image file
o Lists of global symbols by name and by value
/HEADER
/HEADER Provides a system image header when used with the /SYSTEM qualifier. All other images always have headers. However, by default, system images do not have headers.
/MAP
/MAP[=file-spec] /NOMAP Permits you to specify whether or not a memory allocation listing (map) is produced and gives you the option of assigning it a file specification. In interactive mode, the default is /NOMAP; in batch mode, the default is /MAP. You can specify the map's contents using either the /BRIEF, /FULL, or /CROSS_REFERENCE qualifiers. If you do not specify any of these qualifiers, the map contains the following information: o All the information contained in a brief listing (see /BRIEF) o A list of user-defined global symbols by name o A list of user-defined program sections When you specify /MAP, you can control the defaults applied to the output file specification, as described in the VMS DCL Concepts Manual. In interactive mode, the default is /NOMAP. However, in batch mode, the default is /MAP.
/OPTIONS
Positional qualifier. Indicates that the associated input file (default file type OPT) contains a list of linking options. For complete details on the contents of an options file, see the VMS Linker Utility Manual.
/P0IMAGE
/P0IMAGE Directs the linker to create an image that is stored only in P0 address space. The linker places the stack and VAX RMS buffers that usually go in P1 address space in P0 address space. The /P0IMAGE qualifier is used to create executable images that modify P1 address space. See the VAX Architecture Handbook for a description of P0 and P1 address space.
/PROTECT
/PROTECT When used with the /SHAREABLE qualifier, the /PROTECT qualifier directs the linker to create a protected shareable image that can execute privileged change mode instructions even when it is linked into a nonprivileged executable image.
/SHAREABLE
/SHAREABLE[=file-spec] /NOSHAREABLE Command qualifier. By default, the linker creates an executable image. If you specify the /SHAREABLE qualifier, the linker creates a shareable image file instead. Optionally, you may designate a name for the output file; however, wildcard characters are not permitted. Shareable images are not executable; however, they can be linked with object modules to create executable images. If you specify both the /EXECUTABLE and the /SHAREABLE qualifier, the /SHAREABLE qualifier takes precedence. When you specify /SHAREABLE, you can control the defaults applied to the output file specification by the placement of the qualifier in the command. To specify an input shareable image, the /SHAREABLE qualifier must be used as an input file qualifier in an options file. See the description of the linker in the VMS Linker Utility Manual.
/SYMBOL_TABLE
/SYMBOL_TABLE[=file-spec] /NOSYMBOL_TABLE The default is /NOSYMBOL_TABLE (do not create a symbol table). Use the /SYMBOL_TABLE qualifier when you want the linker to create a symbol table object module file (default file type STB) that contains symbol definitions for all global symbols in the image being linked. The symbol table file can be subsequently specified in LINK commands to provide the symbol definitions to other images. If you specify /DEBUG, the linker creates a separate symbol table file and it includes within the image the global symbol definitions that are used by the debugger. When you specify /SYMBOL_TABLE, you can control the defaults applied to the output file specification. Optionally, you may designate a name for the symbol table file, but you may not use wildcard characters.
/SYSLIB
/SYSLIB /NOSYSLIB The default is /SYSLIB (search the system libraries). Use the /NOSYSLIB qualifier to prevent the linking operation from automatically searching the default system libraries, SYS$LIBRARY:IMAGELIB.OLB and then SYS$LIBRARY:STARLET.OLB, for unresolved references in the input files.
/SYSSHR
/SYSSHR /NOSYSSHR The default is /SYSSHR (search the default system shareable image library). Use the /NOSYSSHR qualifier to prevent the linking operation from automatically searching the default system shareable image library, SYS$LIBRARY:IMAGELIB.OLB, for unresolved references. By default, the linker automatically searches the object module library SYS$LIBRARY:STARLET.OLB and then the SYS$LIBRARY:IMAGELIB.OLB library when it cannot resolve references in the input files.
/SYSTEM
/SYSTEM[=base-address] /NOSYSTEM The default is /NOSYSTEM (do not produce a system image). Use the /SYSTEM qualifier to produce a system image and optionally assign it a base address. You cannot use the /SYSTEM qualifier with either the /SHAREABLE qualifier or the /DEBUG qualifier. A system image cannot be run with the RUN command; it must be bootstrapped or otherwise loaded into memory. The base address specifies where the image is to be loaded in virtual memory It can be expressed in decimal, hexadecimal, or octal format, using the radix specifiers %D, %X, or %O, respectively. The default base address is %X80000000. System images are intended for special purposes, such as stand- alone operating system diagnostics. When the linker creates a system image, it orders the program sections in alphanumeric order and ignores all program section attributes.
/TRACEBACK
/TRACEBACK (default) /NOTRACEBACK Default is /TRACEBACK (include traceback information in the image file to help the system trace the call stack when an error occurs). Use the /NOTRACEBACK qualifier to prevent the linker from including traceback information. If you specify /DEBUG, /TRACEBACK is assumed.
/USERLIBRARY
/USERLIBRARY[=(table[,...])]
/NOUSERLIBRARY
You use this qualifier to specify which user-defined default
libraries (process, group, system or, by default, all three) the
linker searches after it has searched any specified user libraries.
(The discussion of the linker in the VMS Linker Utility Manual
explains user-defined default libraries.) You can specify the
following tables for the linker search:
ALL By default, the linker searches the process, group
and system logical name tables for user-defined library
definitions.
GROUP The linker searches the group logical name table for
user-defined library definitions.
NONE The linker does not search any logical name table; this
specification is equivalent to /NOUSERLIBRARY.
PROCESS The linker searches the process logical name table for
user-defined library definitions.
SYSTEM The linker searches the system logical name table for
user-defined library definitions.
If you do not specify either /NOUSERLIBRARY or /USERLIBRARY=(table),
the linker assumes /USERLIBRARY=ALL by default.
The /NOUSERLIBRARY qualifier tells the linker not to search any
user-defined default libraries.
Positional Qualifiers
Additional information available:
/INCLUDE/LIBRARY/OPTIONS/SELECTIVE_SEARCH/SHAREABLE
/INCLUDE
/INCLUDE=(module-name[,...]) Positional qualifier. Selects modules from the associated object module library or image library as input to the linking operation. No wildcard characters are allowed in the module name specifications. At least one module name must be specified. If you specify several modules, separate them with commas and enclose the list in parentheses. If you specify /INCLUDE, you can also specify /LIBRARY; the library is then searched for unresolved references.
/LIBRARY
/LIBRARY Positional qualifier. Indicates that the associated input file is a library (default file type OLB) whose modules should be searched to resolve undefined symbols. You are not permitted to specify a library as the first input file unless you also specify the /INCLUDE qualifier to indicate which modules in the library are to be included in the input. You can use both /INCLUDE and /LIBRARY to qualify a file specification. In this case, the explicit inclusion of modules occurs first, then the library is used to search for unresolved references.
/OPTIONS
/OPTIONS Positional qualifier. Indicates that the associated input file (default file type OPT) contains a list of linking options. For complete details on the contents of an options file, see the VMS Linker Utility Manual.
/SELECTIVE_SEARCH
/SELECTIVE_SEARCH Positional qualifier. Use this qualifier when you want the linker to omit from the output image symbol table, all symbols from the associated input object module that are not needed to resolve outstanding references. These symbols are also excluded from the symbol table file, if /SYMBOL_TABLE is specified. The binary code in the object module is always included.
/SHAREABLE
/SHAREABLE /SHAREABLE=NOCOPY Positional qualifier. Use this positional qualifier in the context of an options file only to identify an input file as a shareable image file. The keyword NOCOPY tells the linker not to bind a private copy of the shareable image to the executable image. /SHAREABLE and /SHAREABLE=NOCOPY are equivalent.
Examples
1. $ LINK ORION
The linker links the object module in the file ORION.OBJ and creates
an executable image named ORION.EXE.
2. $ LINK/MAP/FULL DRACO,CYGNUS,LYRA
The linker links the modules DRACO.OBJ, CYGNUS.OBJ, and LYRA.OBJ and
creates an executable image named DRACO.EXE. The /MAP and /FULL
qualifiers request a full map of the image, with descriptions of
each program section, lists of global symbols by name and by value,
and a summary of the image characteristics. The map file is named
DRACO.MAP.
3. $ LINK [SSTEST]SERVICE/INCLUDE=DRACO, -
$_[]CYGNUS/EXECUTABLE
The LINK command links the object module DRACO from the library
SERVICE.OLB in the directory SSTEST with the module CYGNUS.OBJ in
the current default directory. The executable image is named
CYGNUS.EXE. The placement of the /EXECUTABLE qualifier provides the
output file name default.
4. $ LINK/MAP/CROSS_REFERENCE/EXECUTABLE=DBGWEATH -
$_/DEBUG -
$_WEATHER,MATHLIB/LIBRARY
$ RUN DBGWEATH
VAX DEBUG V5.2
%DEBUG-I-INITIAL, language is FORTRAN, module set to 'WEATHER'
DBG>
The LINK command in this example links the object module WEATHER.OBJ
with the debugger. If any unresolved references are encountered, the
linker searches the library MATHLIB.OLB before searching the system
library. The /CROSS_REFERENCE qualifier requests a cross-reference
listing in the map file; the map file is named, by default,
WEATHER.MAP. The /EXECUTABLE qualifier requests the linker to name
the output file DBGWEATH.EXE. The RUN command executes the image;
the message from the debugger indicates that it is ready to accept
debug commands.