DLL Programmer's Guide for TNS/E Systems
DLLs on a TNS/E System
DLL Programmer’s Guide for TNS/E Systems—527252-006
1-7
Loading
You invoke the linker by a single command, eld, and control it by items you enter in its
command stream, which comprises the options, file names, and parameters that
modify the eld command.
Later, the loader brings together programs with their required libraries in structures like
that shown in Figure 1-2 on page 1-4. To enable the linker to find the required libraries
when it links a loadfile, the loadfile’s programmer must enter in the command stream
the names of libraries that can provide symbols that this loadfile needs. From these
names, the linker creates in the loadfile a libList, which lists the names and certain
attributes of each of these libraries. A library that is listed in a loadfile’s libList is said to
be directly referenced by that loadfile.
In simple compile-and-link operations, the compiler runs the linker automatically. When
it does this, the compiler tells the linker the names of certain standard libraries. If those
are the only libraries required, you need do nothing more. But if you require other
libraries, you can command the compiler to pass them to the linker, or, you can run the
linker yourself. In the latter case you must provide to the linker with the required library
names, including the ones the compiler would have automatically done for you.
The linker can run on a TNS/E machine in either the Guardian or OSS environment.
It can also run on Win32 support machines, usually in an ETK environment. In this
document, these support machines are called auxiliary systems. The object file
produced can only be run on TNS/E systems.
Loading
Once a program and its DLLs have been processed by the PIC linker, they can be
loaded for execution by a special library program (the run-time linker rld) that works
with the operating system. This combined facility of rld and the operating system that
loads programs and libraries into virtual memory for execution is called, in this
document, the loader.
FastLoad
Required libraries are not statically linked with the program. Instead, at load time, the
program and its DLLs are brought into virtual memory, and the loader resolves
references among them. The loader does not alter the stored file image of the loadfile;
rather, it changes only the loaded memory image of the loadfile’s tables and other
initialized data. So this load-time adjustment might be repeated every time a program
and its DLLs are loaded, although the FastLoad facility loads a preset loadfile without
having to rebind it.
Automatic Update
If rld has to rebind a loadfile and the loadfile import control is localized, it will update
the preset bindings in the loadfile with the cooperation of the NonStop operating
system. This is called automatic update. rld and the operating system only
automatically update loadfiles at process creation time. If a loadfile is loaded via a call
to dlopen(), the loadfile is not automatically updated.










