ESD - External Symbol Dictionary
The External Symbol Dictionary (ESD) is a crucial component within an `object module` or `load module` on z/OS. It serves as a directory that lists all external symbols—such as `control sections (CSECTs)`, `entry points`, and `external references`—that are defined within or referenced by that module. Its primary purpose is to provide the `linkage editor` or `binder` with the necessary information to resolve cross-module references and combine separately compiled program units into an executable `load module` or `program object`. The External Symbol Dictionary (ESD) is a critical component of an object module or `LOAD` module on z/OS, containing a list of all external symbols defined within the module, as well as those referenced from other modules. It provides essential information for the z/OS `Linkage Editor` or `Binder` to resolve cross-module references and construct an executable program.
Key Characteristics
-
- Symbol Information: Each entry in the ESD typically includes the symbol name, its type (e.g.,
SDforCSECT,LDforENTRY,ERforEXTRN), its length, and its relative address or offset within the module. - Resolution Mechanism: The
linkage editororbinderuses the ESD from all inputobject modulesto matchexternal references(ERtype) in one module withentry points(LDtype) orcontrol sections(SDtype) defined in another. - Module Structure: The ESD is one of several sections within an
object module, alongside theText (TXT)section (containing executable code and data) and theRelocation Dictionary (RLD). - Load Module Content: For a
load moduleorprogram object, the ESD contains the resolved addresses and definitions of all external symbols, enabling the operating system to correctly load and execute the program. - Control Section (CSECT): A
CSECTis a named, contiguous block of code or data within a program that can be independently relocated. EachCSECTtypically has an entry in the ESD. - Entry Point: An
ENTRYsymbol in the ESD designates a specific address within aCSECTthat can be called or branched to from another program unit.
- Symbol Information: Each entry in the ESD typically includes the symbol name, its type (e.g.,
Use Cases
-
- Program Linking: The fundamental use case is enabling the
linkage editororbinderto combine multipleobject modules(e.g., compiled COBOL programs, assembled routines) into a single executableload module. - Subroutine Calls: Facilitates calls to subroutines or functions that reside in different
object modulesorload librariesby providing thelinkage editorwith the necessary address information. - Shared Data Areas: Allows programs to reference and share common data areas (
CSECTs) that are defined in separate modules, promoting modularity and reusability. - Dynamic Program Loading: For
program objectsinPDSEs, the ESD information is used by the z/OSloaderto resolve external references at load time, supporting dynamic linking concepts. - Debugging and Analysis: Utilities like
AMBLISTorIPCScan display the ESD information ofobject modulesorload modules, which is invaluable for diagnosinglinkage editorerrors (e.g.,UNRESOLVED EXTERNAL REFERENCE) or understanding program structure.
- Program Linking: The fundamental use case is enabling the
Related Concepts
The ESD is intrinsically linked to the object module and load module formats, forming a critical part of how programs are constructed and executed on z/OS. The linkage editor or binder is the utility that processes the ESDs from various input object modules, along with their Text and Relocation Dictionary sections, to produce a final load module or program object. Control Sections (CSECTs) and Entry Points are the primary types of symbols defined within the ESD, while External References (EXTRNs) are symbols referenced by the module but defined elsewhere, requiring resolution by the linkage editor.
- Descriptive Symbol Names: Use clear and meaningful names for
CSECTsandENTRYpoints to improve readability, maintainability, and debugging efforts. - Avoid Duplicate Entry Points: Ensure that
ENTRYnames are unique across allobject modulesthat will be linked together to preventlinkage editorerrors (e.g.,DUPLICATE SYMBOL DEFINITION). - Manage External References Carefully: Explicitly declare all
external references(EXTRNin assembler,EXTERNALin some compilers) and ensure that the correspondingentry pointsorCSECTsare available in the inputobject modulesorload librariesduring the link-edit step. - Utilize
AMBLISTorMAPOption: Generate aload mapusing theAMBLISTutility or theMAPoption in thelinkage editorto review the ESD information, identify unresolved references,