This context is a main memory area into which the modules of a load unit are loaded. The area is set up dynamically by DBL. In other words it is not possible for the user to reserve a fixed space for it. The area can be completely contained within a memory pool or spread over several pools. In the latter case, however, it may only be located within a single memory class. For the modules loaded in this main memory area, there is a symbol table in which an address is assigned to each symbol.
The context for linking and loading can be used as a link context or reference context:
Link context
The modules of a load unit are loaded into the link context. All symbols of a module which is loaded into this context are entered in the context symbol table. The link context is used by the autolink function of DBL for resolving external references in the loaded modules (see "Resolving external references").
It is also used to buffer unresolved external references if this is specified in the load call (operand UNRESOLVED-EXTRNS=*DELAY). If a new load unit is loaded into the link context, DBL tries to resolve the buffered external references with CSECTs and ENTRYs of the new load unit at the end of the loading operation. This process is repeated each time another load unit is loaded, for as long as the context exists.
The user defines the name of the link context in the BIND macro (LNKCTX@ or LNKCTX operand). If no name is specified, DBL selects LOCAL#DEFAULT as the default name. When DBL is invoked with a LOAD- or START-EXECUTABLE-PROGRAM (or LOAD- or START-PROGRAM) command, it defines LOCAL#DEFAULT as the default name.
Reference context
The reference context is used to resolve external references that are not found in the link context. A reference context originates as a link context in another loading operation. Multiple reference contexts (up to 200) may be present simultaneously. The user defines the names and number of possible reference contexts in the BIND macro (REFCTX@ and REFCTX# operands).