DLL Programmer's Guide for TNS/R Systems
DLLs on a TNS/R System
DLL Programmer’s Guide for TNS/R Systems—522203-002
1-8
Finding the Needed libraries
The system automatically arranges loadfiles in virtual memory so there is no address
overlap and interference.
Finding the Needed libraries
A loadfile must be loaded with all the libraries that it directly references, that is, the
libraries in its libList. However, loading only the directly referenced libraries might not
be enough, because some of these libraries might directly reference still other libraries.
Therefore these other libraries must also be loaded, and they might further require still
other libraries. Proceeding in this way can lead to an arbitrarily long succession of
required libraries, all of which must be loaded to run the given loadfile.
The loader generates a list of all the libraries that must be loaded in order to run a
given loadfile by starting from the libList of that loadfile and proceeding through the
libLists of all the required libraries. This generated list is that loadfile’s loadList, and
the loader orders it in the sequence that these libraries are to be loaded, as discussed
in The SearchList for a Globalized Loadfile on page 4-8. Subsequently, the loader uses
the loadList to effect the loading operation.
Among the libraries on its loadList, the loadfile directly references those libraries on its
own libList, while the rest are indirectly referenced libraries. Figure 1-4, below, shows a
more detailed view of what Figure 1-2 on page 1-4 suggests. Figure 1-4 illustrates how
the program directly references libraries A, B, and C, which were specified to the linker
by the programmer and consequently appear in Program’s libList. Also, A directly
references D and E; B directly references F; and C directly references F. The
programmers of A, B, and C stated these requirements for these libraries when each
was linked. Likewise, D and E both directly reference G. Finally, neither F nor G
reference any other libraries.
For the loadfiles in Figure 1-4:
Figure 1-4. Loadfiles and Their libLists (to create the structure in Figure 1-2)
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
VST014.vsd