DLL Programmer's Guide for TNS/E Systems

Essential DLL Facility Controls
DLL Programmer’s Guide for TNS/E Systems527252-006
2-3
Specifying the Linker’s Output
Specifying the Linkers Output
By default, the linker merges linkfiles to produce loadfiles. Following the eld
command, you should list the names of the linkfiles to be combined, as illustrated in
this command-stream fragment:
eld linkfile1 linkfile2
where linkfile1 and linkfile2 are names of linkfiles to be combined in the link.
Choosing the Output File
The output file is where the linker stores the loadfile that results from a link. To specify
an output file name, insert the -o <filename> option, where <filename > is the
desired name of a file. For example:
eld linkfile1 linkfile2 -o mainout
This specifies that the linkfiles from the previous example are to be linked and the
output loadfile is to be stored in mainout. -o is a one-time option.
Choosing to Create a Program or a DLL
By default, the linker combines specified linkfiles to produce a loadfile that is a
program, not a DLL. Thus, the previous example will cause the linker to produce a
program that it stores in mainout. To explicitly cause the linker to produce that
program, insert the -call_shared option.
To create a DLL in mainout, insert the option -dll, or its synonym, -shared, as in
the following example.
eld linkfile1 linkfile2 -dll -o mainout
-call_shared and -dll are mutually exclusive, one-time options.
Naming DLLs
Unlike programs, every DLL has an internal name that is also the name of the file
where that DLL is (to be) stored on the execution target; see Choosing a DLL Name on
page 2-6. This name is specified when the DLL is linked and is recorded in the DLL
itself. The -dllname option gives the DLL its internal name, independently of the
name of the file in which you store it. The -dllname option can be used to create an
arbitrary DLL name, for example, a fully qualified file name.
You may use -soname as a synonym for -dllname. (so stands for shared object.)
The following example might be used to link on a Win32 system, to give the resulting
DLL the name maindll, and to store it in a file named mainoutput.dll in a
directory named C:\myfiles\dlls.
eld linkfile1 linkfile2 -dll -dllname maindll &
-o C:\myfiles\dlls\mainoutput.dll