DLL Programmer's Guide for TNS/R Systems
Essential DLL Facility Controls
DLL Programmer’s Guide for TNS/R Systems—522203-002
2-17
Unresolved Symbols at Load Time
The loader quietly ignores invalid path names, so you can mix OSS paths and
Guardian subvolumes to create a loader search path that will work on either.
As mentioned above, the loader offers the ability to specify paths at load time, but for
security reasons, you may wish to ensure that the loader accepts no load-time
directives and uses only the paths in 1 through 4 above. To disable such run-time
directives, insert the linker option -limit_runtime_paths, which is a one-time
option.
The following command-stream fragment might appear when linking on Win32. It
directs the linker to look for dllfile1 in a directory called mydir before it searches
the public libraries.
ld... -lib dllfile1 L mydir... -o mainout
However, this example passes no search directions to the loader running on the
execution target; so the loader will search for dllfile1 in only the target’s default
places. If dllfile1 (or its equivalent) is stored on the execution target in a private
subvolume named pvtsvol, you can direct the loader to search there before looking
anywhere but in the public libraries by altering the previous example:
ld... -lib dllfile1 L mydir... -o mainout & -RLD_L pvtsvol
The -RLD_first_L option is rarely necessary, because the public libraries have
unique names that should not overlap those supplied by the user or other agencies.
It is more efficient to have the public libraries first on the path search list at load time,
because the set of public libraries can be searched very quickly using a table in
memory.
Unresolved Symbols at Load Time
The loader always searches for every symbol definition that your loadfile must import.
Until it finds a library that offers a symbol definition that your loadfile needs, it considers
that symbol unresolved. The loader’s search path can be as described under The Link-
Time-Defined Search Path of the Loader on page 2-16, but it might be more extensive,
as described in Finding Symbol Definitions
on page 4-1. After looking in all the files
specified for this search and in the implicit system and millicode libraries, if the loader
cannot resolve a symbol reference, it will likely deem this an error; see the definition of
RLD_unresolved under How to Set Run-Time Attributes of Your Loadfile
on
page 5-5.
Also, you may want the linker to help you to find unresolved symbols prior to load time.
For this, see Making the Linker Look for Unresolved Symbols on page 5-4.
Simultaneously Using Different Versions of a DLL
By controlling the loader’s search path, you can allow two different versions of the
same DLL with the same name to be loaded and run in two different processes
simultaneously. This can be useful when testing a new version of a DLL with existing
application code that you do not want to modify. One way to substitute a test DLL for a