The most important function of DBL is to form an executable unit from the object modules (OMs) and LLMs of the input. It therefore has to adjust the addresses in the individual control sections to match the overall program (relocation) and also search for the matching entry addresses for any still unresolved external references and V-type constants.
An OM and an LLM contain relocation records which define how the program addresses relate to one another. This information is used by DBL to assign the definitive addresses for the overall program.
Address relocation for object modules (OMs)
The start address for CSECTs depends on the two attributes READ-ONLY and PAGE, entered by the compiler:
READ-ONLY means that the CSECT is to be read-only during the program run, i.e. it may not be overwritten. DBL must therefore load the CSECT into a new page if the current page does not also have the READ-ONLY attribute.
PAGE declares that the CSECT is to be loaded at the start of a new page, i.e. at an address that is a multiple of 4096 bytes (X’1000’).
Examples of how control sections are processed by DBL
X CSECT PAGE,READ ..................... Y CSECT READ .....................
Control section X is to be aligned on a page boundary and be read-only. The next control section, Y, does not need to be page-aligned and is likewise read-only. DBL therefore loads Y into the same page as X, at the next doubleword boundary.
ABC CSECT READ .................. XYZ CSECT ..................
DBL automatically aligns control section ABC on a page boundary if it is the first CSECT of the object module. It loads ABC into a read-only page. Control section XYZ is aligned on the page boundary of a new page by DBL because read and write access are allowed for the CSECT.
Address relocation for LLMs
The start address is dependent on the following properties of the LLM:
LLM with CSECT attributes PAGE and READ-ONLY
If the PAGE and READ-ONLY attributes have been passed by BINDER, the following applies:
PAGE specifies that the CSECT is to be loaded at the start of a new page, i.e. at an address that is a multiple of 4096 bytes (X’1000’).
READ-ONLY means that the CSECT may only be read during the program run, i.e. it must not be overwritten. DBL must therefore load the CSECT into a new page if the current page does not also possess the READ-ONLY attribute.
This applies to LLMs with the following physical structure (see the “BINDER” manual [1]):single slices
user-defined slices
slices by attributes, where the READ-ONLY attribute has not been used for creating the slices.
LLM without relocation information (LRLD)
If the LLM has been stored without relocation information (see the BINDER statement SAVE-LLM, operand RELOCATION-DATA=*NO [1]), DBL determines the start address specified with the LOAD-ADDRESS operand in the SAVE-LLM statement. If this is not possible, the loading operation is aborted.
LLM with relocation information (LRLD)
If the LLM has been stored with relocation information (see the BINDER statement SAVE-LLM, operand RELOCATION-DATA=*YES [1], DBL determines the start address as follows:
First, it tries to assign the address specified with the LOAD-ADDRESS operand in the BINDER statement SAVE-LLM as the start address. If this is possible, relocation is limited to the unresolved external references and to the references to COMMON sections. (Address relocation within the LLM was already done during the BINDER run.)
If the address defined with the LOAD-ADDRESS operand cannot be assigned as the start address, DBL selects an arbitrary address and performs a complete relocation.