DLL Programmer's Guide for TNS/R Systems
Advanced DLL Facility Controls
DLL Programmer’s Guide for TNS/R Systems—522203-002
5-3
Handling Duplicate Symbols among Linkfiles in a
Link
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 .
•
The linker can determine that they are the same size and that their initial values (if
any) are the same.
Otherwise, the linker treats multiple definitions of a data item in input linkfiles as an
error.
Procedure Definitions
Multiple procedure definitions of the same symbol are permitted when the compiler
generates and appropriately labels the duplicates. In this case, the linker checks that
the attributes of the duplicated procedures are identical except for EDITLINE. If the
others are not identical, the linker declares an error.
Choosing among Accepted Duplicate Symbol Definitions in
Linkfiles
In reading the following, be aware that the linker processes linkfiles in the order that
they, or the archives they come from, appear in the command stream.
Data Definitions
When the linker accepts duplicate data-item definitions of a symbol in linkfiles, it
chooses the instance to use according to the following priority:
1. An instance that is initialized over one that is not.
2. An instance which retains its symbol-table information over one that has been
stripped of this information.
3. An instance that come from the following sources in preferred order: C, C++, pTAL,
Cobol.
4. The first instance the linker finds in processing the linkfiles.
Procedure Definitions
When the linker accepts a duplicate procedure definition of a symbol in linkfiles, it
selects the instance to use from the first version of the procedure it finds in processing
the linkfiles.