DLL Programmer's Guide for TNS/E Systems
Advanced DLL Facility Controls
DLL Programmer’s Guide for TNS/E Systems—527252-006
5-5
Controlling Which Symbols Your Loadfile Exports
Controlling Which Symbols Your Loadfile Exports
Symbols offered for export are those made available to other loadfiles. By default, the
linker offers for export those symbols designated by the compiler to be exported. If you
insert the -export_all option, the linker offers all defined global symbols except for
the following:
Special initialization, construction, destruction, and termination procedures with
reserved name prefixes, namely __INIT__, __sti__, __std__, and __TERM__.
Symbols that the linker creates, only for use within the current loadfile.
The linker interprets the option -ul as synonymous with the combination of the -dll
(or -shared) option and the -export_all option. As the option name -ul
suggests, it is often convenient, but not necessary, to use this option when linking a
user library. This option can be used when linking any DLL.
To assure that a particular symbol is unconditionally offered for export, insert the
-export <symbolname> option. To assure that a symbol is unconditionally not
offered, insert the -export_not <symbolname> option or its synonym
-hidden_symbol.
Special initialization and termination procedures
Special initialization, construction, destruction, and termination procedures are
procedures whose names begin with certain prefixes. These prefixes and their order of
execution are as follows:
__INIT__
Alphabetical order of procedure names.
__sti__
The order in which eld sees the procedures.
__std__
The reverse of the order in which eld sees the procedures.
__TERM__
Reverse alphabetical order of procedure names.
As the names suggest, these procedures are called during the initialization (__INIT__
and __sti__) and termination of a process (__std__ and __TERM__). These
procedures are called without the program explicitly calling them.
__sti__ and __std__
The C++ compiler generates local functions to invoke static constructors and
destructors for global variables that are instances of classes. The linker builds two










