DLL Programmer's Guide for TNS/R Systems

Finding Symbol Definitions
DLL Programmers Guide for TNS/R Systems522203-002
4-13
System Library and Millicode
program, the loader looks first in hybrid public SRLs (because the loader cannot rebind
references in SRLs). At most one public SRL in the process should define a gblzd
symbol; the loader issues a warning if more than one such definition is encountered.
System Library and Millicode
The TNS/R system and millicode libraries are implicitly attached to the end of every
searchList and cannot be mentioned in the command stream. So, if the loader does not
find a needed symbol definition in the loadfiles in the searchList, it will automatically
look for one in the system and millicode libraries.
Symbol Resolution at a Glance
Globalized symbols defined in C++ receive special handling, described above. The
following statements apply to all other symbols:
Whether a given loadfile is declared localized, semi-globalized, or globalized
determines how its imported symbols are resolved. That declaration has no effect
on how imported symbols of other loadfiles are resolved.
A loadfile’s searchList names the loadfiles to search in the sequence they are to be
searched in order to find symbols referenced by the loadfile.
For a globalized loadfile, at load time, symbols are resolved using the globalized
searchList for the program with which the loadfile is loaded.
For a semi-globalized loadfile, at load time, symbols are resolved using that
loadfile itself followed by the globalized searchList for the program with which it is
loaded.
For a localized loadfile, at load time, symbols are resolved using the localized
searchList for that loadfile, which begins with the loadfile itself. If that loadfile’s
libList includes DLLs that re-export other libraries, then that searchList can include
libraries that are not listed in the loadfile’s libList.
The loader appends the load list of any dynamically loaded DLLs to the end of the
globalized searchList of the prior operating load set.
Example: Intercepting an Exported Symbol
This allows you to introduce a new function that modifies an existing one in an existing
library. This modified function may be used by some loadfiles in the installation, but
need not be used by all; they can still access the original function without modification.
This case is similar to previous examples in Section 2, but it takes advantage of
searchList order to override a symbol definition and leaves the existing library
unmodified, as illustrated in Figure 4-6 below. The following description assumes the
starting condition shown in Figure 2-1 on page 2-14.