DLL Programmer's Guide for TNS/R Systems
Finding Symbol Definitions
DLL Programmer’s Guide for TNS/R Systems—522203-002
4-7
The SearchList for a Localized Loadfile
The final searchList is shown at the bottom of Figure 4-4. This shows how to develop a
localized searchList for Program when A re-exports D and no other DLLs re-export.
The arrows point to the referenced libraries in the algorithm after the indicated loop
run.
Program will use C’s definition of xray, since C precedes D in the searchList. But,
assuming D is localized, D will use its own definition of xray.
If we change the conditions so that B re-exports F, then Program’s searchList becomes
Program, UL, A, B, C, D, F. If now D re-exports G, then Program’s searchList becomes
Program, UL, A, B, C, D, F, G. Then if User Library re-exports H, the searchList
becomes Program, UL, A, B, C, H, D, F, G. If E re-exports G, this has no effect on the
searchList, because E itself is not re-exported; hence, E does not appear on the
searchList.
Localized import gives the programmer tight control over how imported symbols are
resolved. It is consistent with previous conventions used on HP NonStop systems;
SRLs are inherently localized. Localized import facilitates (future) load-time
optimizations, because the linker's search list is the same as the loader's. Finally,
localized import will be necessary for security in future when PIC programs and DLLs
support license and privilege.
Figure 4-3. The Loadfiles of Figure 1-5, Now Showing the Use and Availability of
the Global Symbol xray.
Program
DLL A
DLL B
DLL C
DLL D
DLL E
Lib G
Lib F
Lib A
Lib B
Lib C
Lib F
Lib D
Lib E
Lib F
Lib G
Lib G
Code
and
Data
libList
VST042.vsd
User Library
(DLL)
Lib H
Lib H
Imports xray
Exports xray
Exports xray