Building and using dynamic link libraries (DLLs)

The z/OS dynamic link library (DLL) facility provides a mechanism for packaging programs and data into load modules (DLLs) that may be accessed from other separate load modules. A DLL can export symbols representing routines that may be called from outside the DLL, and can import symbols representing routines or data or both in other DLLs, avoiding the need to link the target routines into the same load module as the referencing routine. When an application references a separate DLL for the first time, it is automatically loaded into memory by the system.

There are two types of DLLs: simple and complex. A simple DLL contains only DLL code in which special code sequences are generated by the compiler for referencing functions and external variables, and using function pointers. With these code sequences, a DLL application can reference imported functions and imported variables from a DLL as easily as it can non-imported ones.

A complex DLL contains mixed code, that is, some DLL code and some non-DLL code. A typical complex DLL might contain some C++ code, which is always DLL code, and some C object modules compiled with the NODLL compiler option bound together.

This topic defines DLL concepts and shows how to build simple DLLs and DLL Applications.