DLL Programmer's Guide for TNS/R Systems
Essential DLL Facility Controls
DLL Programmer’s Guide for TNS/R Systems—522203-002
2-5
At a Glance: Controlling Linker Output When
Producing a Loadfile
Choosing a DLL Name
On the execution target, you must store a DLL in a file having the same name as that
DLL, or else the loader will be unable to find it. This is because when a loadfile being
linked requires that DLL, the linker uses that DLL’s internal name to enter in this
loadfile’s libList. Then, when the loader (on the execution target) searches for DLLs
this loadfile requires, it searches the file system using names from this loadfile’s libList.
Therefore, the ability to name a DLL differently from its linker-output file is useful when
linking on an auxiliary system, so you can name that DLL for the file you want to store
it in on the execution target.
On the other hand, names in a libList may be used on both the linker platform and the
execution target systems, so since libList names come from internal DLL names,
portable names are recommended. A portable name is a proper Guardian name,
which can be up to eight-characters long, expressed in lower-case.
There's one more issue for making simple names portable: If they are lower-case,
begin with a letter, contain only letters and digits, and are at most eight characters
long, they work as either Guardian or OSS names. This can be important for a DLL
that serves both environments.
To change a DLL’s internal name, you must relink it.
At a Glance: Controlling Linker Output When Producing a
Loadfile
The one command, ld, invokes the linker for all operations; options control all
subsequent linker steps.
The following table summarizes the options for creating loadfiles and for naming the
files they are stored in.
Specifying Which Inputs Go into a Link
Primary inputs to a link are the individual linkfiles inserted by name in the command
stream. Other linkfiles can come from archives that are inserted in the command
stream; an archive is a file that contains one or more linkfiles. Input linkfiles are merged
in the link process to form the output loadfile. Other inputs to a link are libraries that the
To: Action:
Output a program This happens by default
Output a DLL Insert the -dll option
Specify the name of the file in which to
store the result
Assign the file name with a -o option
Name the resulting DLL differently from
the output file
Assign the DLL name with the -dllname
option and the file name with a -o option.
Simultaneously give the same name to
the output DLL and the file it is stored in
Assign the name with a -o option and do not
use a -dllname option, or vice versa.