DLL Programmer's Guide for TNS/E Systems

Essential DLL Facility Controls
DLL Programmer’s Guide for TNS/E Systems527252-006
2-14
Your Loadfile’s Exported Symbols
linkfile or loadfile. However, the compilation of the module that implements class foo
can contain
#define export_foo export$
ahead of the #include directive for this header file. As a result, this compilation will
define all the symbols associated with class foo, and mark them offered for export.
Your Loadfile’s Exported Symbols
By default, the linker causes your loadfile to offer for export those symbols for which
your compiler sets the xport bit in the external symbol table. To know which these
are, you must know which symbols your compiler designates this way. To ensure that
your loadfile offers for export all needed symbols, insert the -export_all option.
This causes the loadfile to offer all symbols except:
Those used internally by the compiler and linker
Those used only in starting up or shutting down the loadfile
Controlling Which Symbols Your Loadfile Exports on page 5-5 discusses how to
override the automatic exporting of symbols your compiler designates as exportable.
Re-Exported libraries
A DLL can also make available symbols exported by any library in its libList; that is, the
given DLL can re-export the other library. Thus, when a given DLL, call it A, re-exports
a library, B, any loadfile that has A in its libList can also use all the symbols offered for
export by B. When linking a given DLL, the programmer must designate which
libraries, if any, the given one is to re-export.
The fact that DLL A re-exports library B is only meaningful when a loadfile that has A in
its libList is localized, because if that loadfile is not localized, it has access to B’s
symbols anyway.
As an example, suppose that in Figure 1-5 on page 1-14, Program is localized. Then it
can only import symbols from User Library, A, B, and C, unless one of these four re-
exports libraries in its libList. Either B or C could re-export F, in which case Program
could use F’s symbols. And if A re-exported either D or E, Program could use the re-
exported library’s symbols. In the latter case, if the re-exported library (either D or E)
also re-exported G, then Program could use G’s symbols, as well. This is because re-
exportation is transitive, in that if Library X re-exports DLL Y and Y re-exports library Z,
then X re-exports Z. User Library could also re-export H for As use.
On the other hand, in Figure 1-5, if Program is globalized, then it can import symbols
from any libraries shown in that figure, regardless of which libraries are re-exported.