DLL Programmer's Guide for TNS/R Systems
Essential DLL Facility Controls
DLL Programmer’s Guide for TNS/R Systems—522203-002
2-6
Linkfile Inputs
output loadfile references directly or indirectly. The following subsections describe each
of these inputs in detail.
Linkfile Inputs
The linker’s main purpose is to combine linkfiles to produce a loadfile. You must insert
directly in the command stream the name of the linkfiles that are the primary inputs to
the link. The names of these linkfile inputs can be unqualified if the linkfile is in the
same subvolume or directory from which you invoke the linker or else they must be
fully qualified file names; they cannot be part of any option. These names can be
inserted anywhere as long as they do not separate another option from its parameters.
The linker always resolves symbol references in linkfiles being linked with symbol
definitions those linkfiles themselves provide. In particular, if a loadfile refers to a
symbol that it also exports, the linker binds that reference to that loadfile’s definition. If
the loadfile is localized, which the linker assigns by default, then at load time, the
loader will accept this resolution. If the loadfile is not localized, the loader may revise
the linker’s resolution, as discussed in Ambiguity Example 2 on page 4-9.
Selecting Linkfiles from Archives
Like named linkfiles, by inserting their qualified names, you can specify archives for the
linker to access. To learn how the linker searches for an archive, see Specifying Where
the Linker Can Find Its Inputs on page 2-8. Two options allow you to select which
linkfiles are brought into the link from an open archive:
-include_whole and -no_include_whole are toggle options you can insert
multiple times in the command stream to set the mode for archives that are
subsequently specified in the command stream. You can also insert the same archive
more than once in the command stream. At the beginning of the command stream, the
default mode is -no_include_whole.
The following example brings into the link only those linkfiles in an archive called
archfile1 that resolve symbols at the time the linker has archfile1 open, since
-no_include_whole is the undeclared mode at the beginning of the command
stream.
ld linkfile1 linkfile2 archfile1 -dll -o mainout
If, instead, you want the linker to bring into the link all the linkfiles in
archfile1, insert the following:
ld linkfile1 linkfile2 -include_whole archfile1 -dll -o mainout
Linkfiles to Bring into the Link Option
Bring in all linkfiles in this archive. -include_whole
Bring in only those linkfiles that resolve
currently unresolved symbols.
-no_include_whole