The result produced by the C/C++ compiler on compiling a source program consists of a link-and-load module or LLM. This module already consists of machine code, but cannot be executed on the computer until all generated modules have been combined (i.e. linked) with other modules to create an executable unit.
The additionally required modules are usually modules of the runtime system, but other modules (e.g. modules of subroutines in other languages or separately compiled C/C++ program segments) can also be linked in, if required. These additional modules may include modules that were compiled by different compilers at various times.
The main function of the linkage editor is to select the modules required for the loadable unit from various sources (files, libraries) and link them to one another. Linkage basically means that the linkage editor supplements each module with the addresses that refer to areas external to the module (external references).
Before the unit generated during the linkage phase can be run, a loader must load it into memory so that the processor can access the code and execute it.
The following functional units are available in the Binder-Loader-Starter system of BS2000 for performing the linking and loading tasks:
Dynamic binder loader DBL
The dynamic binder loader DBL combines three steps into a single operation by linking modules (object modules, LLMs) into a temporary loadable unit, loading it immediately into memory and then starting it.
Linkage editor BINDER
BINDER links modules (object modules, LLMs) to form a logically and physically structured loadable unit. This unit is called a link-and-load module (Link and Load Module, LLM). BINDER stores an LLM as a type-L element in a PLAM library.
There are two ways of linking programs with BINDER:
directly, i.e. by calling BINDER with the START-BINDER command, and
implicitly, i.e. with the compiler statements BIND and MODIFY-BIND-PROPERTIES
The above compiler statements are not dealt with here, since they are described in detail the sections "BIND" and "MODIFY-BIND-PROPERTIES" in chapter "Compilation".
Modules generated in the compilers C modes or Cfront-C++ mode, can be linked dynamically with the DBL, statically with the BINDER and with the BIND statement of the compiler (i.e. implicitly with the BINDER).
C++ V3, C++ 2017 and C++ 2020 modules have to be linked with the BIND statement of the compiler. See also section "Restriction on linking C++ programs".
The C and C++ runtime modules needed for linking C/C++ programs are a component of the CRTE runtime system. An overview of all C/C++-specific CRTE libraries is provided in section “Specific CRTE components required for C/C++”. More detailed information, with appropriate notes on linking the C++ runtime libraries, in particular, can be found in chapter “The C++ libraries and C++ runtime system”.