DLL Programmer's Guide for TNS/R Systems

Essential DLL Facility Controls
DLL Programmer’s Guide for TNS/R Systems522203-002
2-8
Specifying Where the Linker Can Find Its Inputs
tell the linker which libraries can resolve those symbols, by inserting their file names in
the command stream. Using these names, the linker opens the corresponding files and
reads their internal names to build the libList in the resulting loadfile. There it lists the
libraries in the order that you inserted them; these libraries are called your loadfile’s
libListed libraries. Later, the loader uses this libList on the execution target to find the
libraries that will resolve your loadfile’s symbol references and to build your loadfile’s
loadList.
Thus, when linking your loadfile, the order in which you insert library names into the
linker’s command stream determines the order that the linker processes them and lists
them in your loadfile’s libList. The order of library names is unaffected by the mingling
in the command stream of other inserted tokens among these names.
Figure 1-4 on page 1-8 shows that when linking the program, the programmer inserted
the file names of DLLs A, B, and C, in that sequence. It also shows that:
A requires D and E
Both D and E require G
Both B and C require F
To get these results, when A was linked, its programmer inserted first the names D
then E. When D and E were linked, their programmers inserted G. Likewise, when B
and C were linked, their programmers inserted F.
Library names can safely be inserted anywhere in the command stream, because their
symbols are made available as needed in the link regardless of their inserted position.
Also remember, when a TNS/R compiler invokes the linker for you, the compiler
automatically ensures that the object files are linked to any required standard run-time
libraries.
Specifying Where the Linker Can Find Its
Inputs
The previous section discussed how to tell the linker what items go into a link. This
section focuses on how to tell the linker where to look for these items in the file system
of the linker platform. The linker can find files in four different ways:
If the linker is given a qualified file name inserted directly in the command stream,
it opens the file in the normal way for the linker host platform.
If the linker is given an unqualified file name inserted directly in the command
stream, it opens a file of that name in the current directory or subvolume.
If an unqualified file name is used in a -lib option, the linker searches for that file
following prescribed search paths, as discussed in Where The Linker Searches for
Libraries and Archives on page 2-10.