DLL Programmer's Guide for TNS/R Systems

DLL Programmer’s Guide for TNS/R Systems522203-002
2-1
2 Essential DLL Facility Controls
You control the TNS/R DLL facility by using the linker and the loader options, many of
which normally run using automatic defaults. This section explains the linker’s most
commonly used controls, but Advanced DLL Facility Controls on page 5-1 tells you
how to get more precise control over the process and its results.
The execution target for code produced by the linker is either OSS or Guardian on
TNS/R (or possibly both, for a DLL); but you will often link on an auxiliary system,
which usually means a Win32 workstation that supports development or administration.
Certain linker options facilitate this capability. Wherever the linker performs its link is
called the linker host platform, whether or not it is an auxiliary system. Distinct
implementations of the linker utility run on each host: Guardian, OSS, or Win32.
The Linkers Command Stream
You operate the linker by:
Starting it as a new process
Providing the appropriate inputs that tell the linker what to do
Examining the textual output it produces
Most of this section describes direct use of the ld utility. It can also be used indirectly
in several ways:
Compiler drivers, such as NMC and NMCPLUS (Guardian) or c89 (OSS) can run
the linker during the compilation. The compiler driver provides the linker's
command stream, based on defaults and some compiler options.
c89 also has syntax
-Wld=...
to pass options through to the linker.
The Enterprise ToolKit has facilities to invoke the linker automatically.
Direct Use of the Linker
You invoke the linker by a single command, ld, and control its subsequent link
operation by tokens inserted following the command on the command line. These
tokens come in three varieties:
Option – a directive to the linker, which might be modified by arguments that
immediately follow it. These arguments are either file names or parameters.
Options without parameters are sometimes called flags.
File name – a name of a file, which may or may not be an argument of an option.
In this document, a file name in the command stream that is not a part of an option
is said to be directly inserted in the command stream.