FORTRAN Reference Manual

Program Compilation
FORTRAN Reference Manual528615-001
9-21
Separate Compilation
Separate Compilation
You can use Binder to bind together object files created from separate runs of the
FORTRAN compiler in addition to object files created by C, COBOL85, PASCAL, and
TAL compilations. Binder also allows you to examine, combine, or modify object files. It
operates as either of two processes:
BINSERV, the compile-time binder, which is driven by compiler directives
BIND, which is driven by commands that you enter interactively or that it reads
from a file
Compilation Unit
A compilation unit consists of all the input to a single run of the compiler. A compilation
unit can include any number of program units in the compiler’s input source file and
additional source files named in SOURCE directives.
FORTRAN organizes the compiled object code into blocks of code and data that
BINSERV uses to build the object file.
BINSERV can also include copies of previously compiled object code in the new object
file that it creates. This happens if the compilation unit includes a SEARCH directive
that names object files from which BINSERV can retrieve code or data to satisfy
references to other program units or to common data. These are called external
references.
The output object file from a binder process is called a target file. If the target file
includes a main program unit, the file is an executable program file. An object file can
have only one main program unit.
If you plan to use the compile time binder, see Section 10, Compiler Directives, for a
detailed description of the directives that affect building of the object file: SEARCH,
LMAP, COMPACT, and SYNTAX.
If you want to use Binder as a separate process, see the Binder Manual.
Code Blocks and Data Blocks
Blocks are the smallest relocatable (bindable) units of code or data. For FORTRAN,
these rules apply:
Each program unit results in a separate code block. FORTRAN uses the name
given in the PROGRAM, SUBROUTINE, or FUNCTION statement to identify the
program unit’s code block. If you omit the PROGRAM statement, FORTRAN uses
the default name MAIN^ for the main program unit. A block data subprogram does
not have a code block.
A program unit can have up to two OWN data blocks containing local data items
that are statically allocated as a result of DATA and SAVE statements. Each block
name has the same name as its program unit. The name is preceded by a plus