z/OS MVS Program Management: Advanced Facilities
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Multiple-text class modules, load segments and ESD offsets

z/OS MVS Program Management: Advanced Facilities
SA23-1392-00

In a multi-text class module (supported in PO2 and later program object formats) the binder collects all the text for each class into a contiguous area. If a section has text elements in more than one class, these elements will each be placed in the appropriate class. Thus the text for a given section might no longer reside in a single contiguous area, and section offset is no longer a meaningful term. Therefore, for version 2 and higher buffers, offset information can no longer be obtained from an SD ESD record.

Each section contains ED records which define the characteristics of the text classes in that section. Since a section name and class name together define an element, these ED records can also be thought of as describing the attributes of an element. ED records are generated by the binder for load module input, and for traditional and XOBJ object modules. They are generated by the language translator for GOFF format input. The ESD_CLASS_OFFSET field in version 2 and greater buffers contains the offset of the element from the start of its containing class, and the ESD_LENG fields contains the length of the element. This information replaces the CSECT length and offset information in the SD record of a traditional one-dimensional program module.

For object module and load module input, the binder will generate an LD ESD record for each CSECT, with the same name as the CSECT, in class B_TEXT. The offset in the LD record will be the same as the offset in the B_TEXT ED record for the section. For XOBJ format input, the generated LD will be in class C_CODE.

Furthermore, the binder may collect text classes with compatible attributes into load segments. A given load segment will be loaded into contiguous virtual storage. The offset field (ESD_CLASS_OFFSET) in an ESD record in an ESD buffer is the offset from the start of the containing class, not the offset from the start of the segment. For a load segment which contains more than one class, you may want the segment offset rather than the class offset (for example if your intent is to produce a map of the module in virtual storage you will create an incorrect map if you use the class offset).

To compute the segment offset, you should first use the GETN API call to obtain the segment ID and the starting offset of each class from the start of the containing segment. For each ESD record, ESD_RES_CLASS will have the name of the class containing the symbol (the resident class). Then the segment offset can be computed by adding ESD_CLASS_OFFSET to the starting offset of the class within the segment. Segment 1 will always be the segment containing the entry point (the primary and any secondary entry points). In many cases it will be the only segment.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014