The process during which these external references are resolved (i.e. the additionally required modules are linked with the generated module into an executable unit) is called linking; the utility routine which performs this task is called a linkage editor.
A linkage editor processes either the result of a compilation (object module or LLM) or a module already prelinked in a linkage run. A prelinked module may consist of one or more object modules or a link-and-load module. Object modules and prelinked modules are referred to collectively using the term “object module”. This term is used in the following whenever the object to be described can be both an object module and a prelinked module.
To enable the unit generated during linking to run, a loader must be used to bring it into memory to allow the processor to access and execute the code.
The Binder-Loader-Starter system in BS2000 provides the following functional units for linking and loading:
The binder BINDER
links modules (object modules, link-and-load modules) to form a logically and physically structured loadable unit. This unit is referred to as a link-and-load module (LLM) and is stored by BINDER as an element of type L in a PLAM library.
The static linkage editor TSOSLNK (TSOS LINKage editor)
links one or more object modules into an object program (also called a load module) and saves it in a cataloged file or as an element of type C in a PLAM library;
or
links a number of object modules into a single prelinked module and stores it as an element of type R in a PLAM library or in a temporary EAM file.The dynamic binder loader DBL
combines modules (i.e. object modules and LLMs, possibly generated by an earlier linkage run with BINDER) into a temporary loadable unit, which it then loads into main memory and executes immediately. COBOL programs that call at least one external subprogram with “CALL identifier” can only be executed by this method (see section "Linking and loading subprograms").
The static loader ELDE
loads a program that was linked by TSOSLNK and stored in a file or as an element of type C in a PLAM library.
The COBOL2000 compiler generates object modules or LLMs at compilation. Object modules are placed in the temporary EAM file of the current task or in a PLAM library as an element of type R.
LLMs are stored as elements of type L in a PLAM library.
The following table shows which modules are generated and/or processed by the individual functional units of the Binder-Loader-Starter system.
Module type | System component | |||
BINDER | DBL | TSOSLNK | ELDE | |
Object module | yes | yes | yes | no |
Link-and-load module (LLM) | yes | yes *) | no | no |
Prelinked module | yes | yes | yes | no |
Object program (load module) | no | no | yes | yes |
*) Only in ADVANCED run mode
The linkage run in the POSIX subsystem is explained in the chapter "COBOL2000 and POSIX".
The following diagram shows an overview of the various options that are provided to generate and call temporary and permanent executable COBOL programs in BS2000.
Figure 2: Generating and calling permanent and temporary executable COBOL programs in BS2000