DLL Programmer's Guide for TNS/E Systems
Essential DLL Facility Controls
DLL Programmer’s Guide for TNS/E Systems—527252-006
2-15
How to Make Your Loadfile Re-Export Symbols of
Other DLLs
How to Make Your Loadfile Re-Export Symbols of Other DLLs
When you link your DLL, you can make it re-export the exported symbols of any library
in its libList. To do this you insert the -reexport option, after which you insert directly
or in a -lib option the libraries which are to be re-exported. -reexport and
-no_reexport are a toggle-option pair telling the linker that all libraries inserted after
the -reexport option are re-exported until the linker encounters a -no_reexport
option. -no_reexport is the undeclared mode at the start of the command stream.
In the following example, -reexport makes available the symbols in dllfile1 to
any localized loadfile that has mainout in its libList.
eld linkfile1 linkfile2 -reexport -lib dllfile1 &
-first_L pvtsvol... -dll -o mainout
Some Examples Using Re-Exportation
Splitting a DLL into Two DLLs
One use of re-exportation is to allow you to split a DLL into multiple DLLs without
having to relink the clients of the original DLL. You might make such a split because it
is expedient to assign responsibility for parts of the original DLL to different individuals
or groups. To split a DLL in two, you give one of the new DLLs the name of the original
and have it re-export the other.
Figure 2-1 on page 2-15 illustrates DLL D exporting symbols Alpha, Beta, and Gamma,
while its client, DLL A, imports those symbols. Suppose that you want to replace D with
two loadfiles, one which provides the Gamma definition and the other which provides
the Alpha and Beta definitions, and you do not want to affect D’s client loadfiles. You
can do this as follows.
1. Split the source for D to create the two new loadfiles: one that exports Alpha and
Beta, the other that exports Gamma.
Figure 2-1. DLL A Imports DLL D’s Symbols.
DLL A
Alpha
Beta
Gamma
DLL D
Alpha
Beta
Gamma
VST021.vsd










