COBOL Manual for TNS/E Programs (H06.03+)
Issues Related to Linking
HP COBOL Manual for TNS/E Programs—520347-003
24-7
Loadfiles, Linkfiles, and Processes
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.
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 13-2. 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.










