COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
warning messages, but are allowed. They are expected to be resolved by the fixup operation of
the system loader. If the compiler cannot resolve an external reference to a non-COBOL routine,
it must at least be able to validate it.
When the compiler processes a CALL statement that calls another COBOL program, but cannot
find the other COBOL program, it delivers a warning message and produces an object file.
When the compiler processes an ENTER statement that calls a routine, but cannot find the routine,
it delivers an error message and does not produce object code for the calling program. The reason
that the compiler cannot produce object code for the calling program is that the compiler is unable
to verify that the parameters of the call match those expected by the routine (and, where necessary,
to generate code that converts parameters in the HP COBOL program into the form required by
the routine).
For more information, see How the Compiler Resolves Unqualified References (page 517).
Loadfiles, Linkfiles, and Processes
The single object file that results from linking is a loadfile if exactly one program in it is a main
program; otherwise, it is a linkfile.
A single execution of a loadfile is called a process. The operating environment creates a process
by loading a loadfile into memory, creating entries for the process in various operating environment
tables, and transferring control to the entry point of the main routine of the process.
In memory, a process occupies code spaces, data spaces, and a process file segment. The code
spaces and data spaces (memory areas) are described in Table 87: Memory Area Characteristics
(page 600). The process file segment is an extended data segment available only to the operating
environment, which uses it for things such as managing the status of communication with files.
Fixup
The first time you instruct the operating environment to execute a loadfile as a process, the system
loader performs a fixup operation on the file and attempts to resolve all unresolved external
references.
External references call routines in:
• Other code blocks in the same user code space
• Code blocks in DLLs
• The system code space
If the system loader cannot resolve an external reference, it reports that there are still unresolved
externals (?EXT: name ). The process executes until it attempts to call an unresolved external
procedure, and then it calls the selected debugger.
The fixup operation is the reason that the first execution of a newly compiled program is less
efficient than subsequent executions. After the system loader has performed the fixup, subsequent
executions of the program do not need this operation until the contents of the loadfile are changed
or the operating environment is changed.
This run-time resolution helps to reduce object file size and compilation times. It also reduces the
likelihood that you will have to recompile an HP COBOL program when a run-time routine that it
calls is enhanced or corrected.
Linking HP COBOL Programs
An HP COBOL program can be linked automatically, as part of compilation: If you specify the
RUNNABLE or SEARCH directive, the ECOBOL compiler also calls the eld utility. If you do not link
the program automatically, you must use the eld utility to link it after compilation.
816 Issues Related to Linking










