COBOL Manual for TNS and TNS/R Programs
Issues Related to Binding and Linking
HP COBOL Manual for TNS and TNS/R Programs—522555-006
24-4
Binding or Linking
When external references in two code blocks are resolved to entry points in each other,
the two code blocks are called “crossbound.” The system code block and the system
library blocks are all crossbound—a routine in any of these blocks can call a routine in
any other of these blocks. The blocks of a multiblock user code space are all
crossbound, as are the blocks of user library space.
Binding or Linking
Binding (the TNS term) or linking (the native term) is the operation of examining,
collecting, and modifying code and data blocks from one or more object files to
produce a single object file. Two important aspects of binding or linking a program are:
•
Validating references to other programs or routines—determining whether the
actual parameters of the calling program or routine correspond to the formal
parameters of the called program or routine.
•
Resolving references to other programs or routines—generating the code that will
transfer control from the calling program or routine to the called program or routine
at execution time.
A typical compilation resolves some references and leaves others unresolved. (In
Figure 24-2, the reference to program Y is resolved, and the reference to program Z is
unresolved.)
Topics:
•
Binder
•
BINSERV
•
BIND
•
Linker
•
How the Compiler Validates and Resolves References
•
Unresolved References
Binder
The COBOL85 compiler validates and resolves internal and external references with
the help of Binder, the HP object file building utility. Binder accepts commands that
direct it to read, operate on, and produce object files. Binder has two forms, BINSERV
and BIND.
Note. This topic applies only to the COBOL85 compiler. The NMCOBOL compiler does not
use Binder, it uses the Linker.