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-3
Position-Independent Code (PIC) in TNS/E
Position-Independent Code (PIC) in TNS/E
All code on a TNS/E system is position-independent. Code that can be relocated in
virtual memory at load time without alteration is called position-independent code
(PIC). If you use DLLs in your application, your program and these DLLs must be PIC.
All references in PIC files to global or external symbols are made indirectly through
addresses stored in a data area so that the loader can find and bind them to reflect
their virtual-memory locations at load time without modifying code. The TNS/E
compilers can generate PIC files, the PIC linker (eld) creates either PIC programs or
DLLs, and the loader and operating system load and bind the results.
PIC is more position-independent than one might imagine from the term. PIC can even
be simultaneously mapped to different addresses for different processes in the same
CPU.
What is a DLL?
A DLL is a type of library that is constructed of PIC. When using DLLs on TNS/E, a
complete, executable application comprises one (main) program and zero or more
DLLs. The program is the root of the application, while the DLLs provide functions and
data needed by the program or other DLLs. DLLs allow you to structure your
applications in functional units (the DLLs). A DLL might be a library that supports a
single program, it might be available to a project or a group with common
computational needs, or it might be a library that is available to all users.
Figure 1-2 on page 1-4, shows an application comprising a program and the DLLs that
it requires in order to run. Some of these (A, B, and C) offer symbol definitions that the
program itself may need; others offer symbol definitions that the various libraries, but
not the program, may need.
A, B, and C might be libraries that, along with Program, constitute the basic logic of the
application. D and E might be libraries of supporting routines for A. F and G might be
more general purpose libraries.
A DLL is written as an ordinary program with no main procedure and is designated a
DLL in the course of construction.
A DLL can be a 32-bit, 64-bit, or neutral loadfile on a TNS/E OSS platform and 32-bit
loadfile on all other platforms. 64-bit and neutral DLLs are supported from
H06.24/J06.13 RVU onwards.










