DLL Programmer's Guide for TNS/E Systems

Advanced DLL Facility Controls
DLL Programmer’s Guide for TNS/E Systems527252-006
5-2
Augmenting Library Names Automatically in
Searches
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 abc:
1. eld first attempts to open abc.
2. If eld fails to find that file in the Guardian file system, and -b static is not in
effect, it looks for libabc.so.
3. If eld still has not found a file and -b dllsonly is not in effect, it looks for
libabc.a.
4. Again if -b static is not in effect, eld will try to open a file named zabcdll.
The prefix and the suffixes are appended automatically at each location in the search
path list, including the public library set.
The augmentation of library names occurs only in the linker, in all environments. (The
Guardian loader searches only for the name found in the libList, which the linker takes
from the DLL name of the target file.)
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.
Data Definitions
The linker accepts multiple data-item definitions of the same symbol in input linkfiles
when both of the following are true:
An item is defined in more than one file, and the compiler has marked every
instance of this symbol to allow multiple definition (so this will become a gblzd
symbol; see C++ Considerations: Globalized (Gblzd) Symbols
on page 4-12 .