DLL Programmer's Guide for TNS/R Systems

Advanced DLL Facility Controls
DLL Programmers Guide for TNS/R Systems522203-002
5-2
Augmenting Library Names Automatically in
Searches
Also, recall that if the linker is searching for both archives and DLLs,
-allow_missing_libs can cause the linker to overlook missing archives as well;
see Allowing Missing Libraries on page 2-11. However, if -b static is in effect, then
the linker can only be looking for archives, and even if -allow_missing_libs has
been inserted, the linker will terminate in error if it doesn’t find the specified archive file.
Augmenting Library Names Automatically in Searches
By convention in OSS and Windows, names for DLLs and archives have a common
prefix, lib, and have distinguishing suffixes (filename extensions), .so for DLLs and
.a for archives. However, especially if the linker host is Windows but the target is
Guardian, it might be convenient to use simple filenames directly. Therefore, if you tell
the linker to search using -l gofish, it first attempts to open gofish. If it fails to
find that file, and -b static is not in effect, it looks for libgofish.so. If it still has not found
a file and -b dllsonly is not in effect, it looks for libgofish.a. The prefix and the suffixes
are appended automatically at each location in the search path list, except the public
library set.
Guardian, however, does not allow this flexibility, because file names are limited to
eight characters and lack extensions. So, for Guardian, an archive and a DLL must be
specified using distinct names. It is an error if the linker opens that file and finds that it
is not the type you specified with -b static or -b dllsonly.
The augmentation of library names occurs only in the linker. The loader searches only
for the name found in the libList, which the linker takes from the DLL name of the target
file.
For hybrid public SRLs, the DLL name is the (lower-case) Guardian file name, of the
form z*srl. These names are only vaguely related to the file names (of the form lib*.srl)
with which these SRLs are installed for the Enterprise ToolKit on Windows. The public
hybrid SRLs are not installed in the OSS file system. Therefore, when the linker runs
in either Guardian or OSS, it must be given the proper file names of the public SRLS.
(When the C or C++ compiler driver runs the linker for you, it supplies the names of the
usual public libraries for your language.)
Handling Duplicate Symbols among Linkfiles in a Link
The same symbol can be defined in more than one linkfile in a link, and the linker may
or may not treat this as an error. The following subsections tell when duplication is
treated as an error and when it is accepted.
Deciding When to Accept Duplicate Symbol Definitions in
Linkfiles
Either Data or Procedure Definitions
The linker treats multiple definitions of the same symbol in linkfiles as an error when
either all the definitions of a symbol are not data items or all are not procedures.