Using BINDER, object modules and LLMs can be linked into a single link-and-load module (LLM) and stored as a type-L element in a PLAM library. BINDER is described in detail in the “BINDER” manual [22]).
Important Note:
LLMs with a linked runtime system must not be stored in libraries
from which other LLMs that are not prelinked are also to be directly loaded or
which are used by BINDER to resolve external references by means of AUTOLINK.
Example 6-2
Generating an LLM from object modules
/START-BINDER ——————————————————————————————————————————————————— (1) % BND0500 ... //START-LLM-CREATION INT-NAME=PROG, COPYRIGHT = *NONE ——————————— (2) //INCLUDE-MODULES LIB=*OMF,ELEM=MAIN ———————————————————————————— (3) //INCLUDE-MODULES LIB=PLAM.BSP,ELEM=SUB ————————————————————————— (4) //RESOLVE-BY-AUTOLINK LIB=$.SYSLNK.CRTE ————————————————————————— (5) //SAVE-LLM LIB=PLAM.BSP,ELEM=TESTPROG ——————————————————————————— (6) % BND3101 SOME EXTERNAL REFERENCES UNRESOLVED % BND3102 SOME WEAK EXTERNS UNRESOLVED % BND1501 LLM FORMAT : '1 //END ——————————————————————————————————————————————————————————— (7) % BND1101 BINDER NORMALLY TERMINATED. SEVERITY CLASS: 'UNRESOLVED EXTERNAL' /START-PROG *MOD(LIB=PLAM.BSP,ELEM=TESTPROG,RUN-MOD=ADVANCED) ——— (8) % BLS0523 ELEMENT 'TESTPROG', VERSION '@' FROM LIBRARY 'PLAM.BSP' IN PROCESS % BLS0524 LLM 'TESTPROG', VERSION ' ' OF '2006-10-26:14:51:46' LOADED
(1) | BINDER is called. |
(2) | The START-LLM-CREATION statement generates a new LLM in the work area with the internal name PROG. The generated LLM is subsequently stored as an L-type element in a PLAM library by means of the SAVE-LLM statement (see “SORT” manual [6]). |
(3) | This INCLUDE-MODULES statement specifies the name of the module containing the main program (MAIN). The module is held in the temporary EAM file (*OMF). |
(4) | This INCLUDE-MODULES statement specifies the name of the module containing the subprogram (SUB). The module is held in the PLAM library PLAM.LIB. |
(5) | The RESOLVE-BY-AUTOLINK statement specifies the name of the runtime library from which external references are to be resolved. |
(6) | The SAVE-LLM statement stores the generated LLM under the name TESTPROG as an L-type element in the PLAM library PLAM.LIB. The BINDER message “SOME WEAK EXTERNS UNRESOLVED” refers to the ILCS module IT0INITS. This module contains weak external references to all languages potentially provided for ILCS. Only the language COBOL2000 is involved in this example and the other references remain unresolved. |
(7) | The END statement terminates the BINDER run. |
(8) | The LLM is loaded and started. |
With the INCLUDE-MODULES and RESOLVE-BY-AUTOLINK statements, LIB=*
BLS-LINK may also be specified instead of the library name (LIB=library). In this case the libraries to be searched must be assigned with the link name BLSLIBnn (00 <= nn <= 99). This is done by means of the SET-FILE-LINK command before BINDER is called, e.g.:
/ADD-FILE-LINK LINK-NAME=BLSLIB01,FILE-NAME=$.SYSLNK.CRTE
An LLM generated by means of BINDER can - provided all external references are resolved - be loaded and started using DBL with no assignment of alternative libraries:
START-PROGRAM *MODULE(LIB=library,ELEM=module,RUN-MODE=ADVANCED)
When the LLM format is generated, a CSECT is created with the name program-name&#
and with the following entries:
| for the start of the subprogram |
| for the start of the main program |
| for the service entry |
When shared-code is generated, the code CSECT program-name&@
is also created.