DLL Programmer's Guide for TNS/R Systems
Finding Symbol Definitions
DLL Programmer’s Guide for TNS/R Systems—522203-002
4-6
The SearchList for a Localized Loadfile
1. [Initialize] To an empty searchList add the name of the localized loadfile being
linked and set a reference pointer pointing to this entry, making it the currently
referenced loadfile.
2. If the referenced loadfile is a program that has a user library, add the user library’s
name to the searchList.
3. If the referenced loadfile has a non-empty libList, add the libList entries from the
loadfile in the same order they appear in the libList.
4. [Begin loop] If there is another searchList entry immediately below the referenced
loadfile, set the reference pointer to it and make it the reference loadfile. If there
are no more searchList entries, the searchList is finished.
5. Append to the searchList, in the same order, the libList entries of the referenced
loadfile that are designated in the libList as re-exported and that are not already on
the searchList.
6. Return to step 4.
As an example of how the foregoing algorithm works, consider Figure 4-3 on page 4-7,
which shows Program and the libraries in its loadList. Program references the symbol
xray and DLLs C and D both export it. Assume that Program is a localized loadfile.
Program’s imported symbols are resolved by searching UL, A, B, and C in that order,
where UL stands for User Library. Suppose also, that UL does not re-export H, that A
re-exports D but not E, and that neither B nor C re-exports F. Figure 4-4 on page 4-9
shows the development of the localized searchList for Program following the algorithm
listed above. For each run through the loop, the rows in that figure show the situations
after the execution of algorithm steps 4 and 5.