.th BIND I "May 18, 1977"
.sh NAME
bind \*- .rel module linker
.sh SYNOPSIS
.bd bind
[ \fB\*-m\fR ] [ \fB\*-d\fR ] [ \fB\*-t\fIn\fR ] [ \fB\*-b\fIn\fR ]
outfile infile ...
.sh DESCRIPTION
.it Bind
concatenates one or more relocatable object modules (see `rel\ (V)') producing
a single relocatable object module as output. The primary use of
.it bind
is to combine the separate object modules which make up large programs into the
single object module required for input to
.it "relld (VI)."
In addition, all the inter-module references among the bound component modules
are pre-linked at bind time. Optionally,
.it bind
will produce a memory map and/or produce an output file suitable for use by
the absolute loader (see `lda\ (V)').
.s3
The options to
.it bind
are:
.s3
.lp +6 5
\fB\*-m\fR	Outputs a memory map of the result module to `\fIoutfile\fB.map\fR'.
.s3
.lp +6 5
\fB\*-d\fR	Prints debugging information. If the
.bd \*-m
switch is also specified, the map file will contain maps for each input file
following the map for the output file.
.s3
.lp +6 5
\fB\*-t\fIn\fR	Causes
.it bind
to output an absolute loader format file with the top location program at
.it n.
Since the absolute loader does not know about separate I and D space, each
input file is forced to be
.it mixid
(see the description of the assembler).
.s3
.lp +6 5
\fB\*-b\fIn\fR	Like
.bd \*-t
except
.it n
specifies the bottom location of the program.
.i0
.dt
.s2
The action of the binder depends on the options used. If neither
.bd \*-t
nor
.bd \*-b
are used, then \fIinfile1\fB.rel\fR \fIinfile2\fB.rel\fP ...
\fIinfilen\fB.rel\fR are bound together
and placed in \fIoutfile\fB.rel\fR.
If an absolute file is needed, then use either the
.bd \*-t
or
.bd \*-b
switch.
Both switches can be optionally followed by an octal number. Zero is assumed
if none is specified. The
.bd -t
switch tells the binder to make the top of your
program at the given number. A
.bd \*-t0
or just
.bd \*-t
is like
.bd \*-t200000,
which will put
your program at the very top of core. The
.bd \*-b
switch tells the binder to make
the bottom of your program at the given number. In either case,
the output will be in \fIoutfile\fB.lda\fR. If
.bd \*-m
is used, then a map file will be
produced containing memory maps of the output file and all the input files.
If -d was used then the program load point, the program start address, and the
program size will be typed along with some debugging information.
.s2
Since the binder has all the input files open at once, and UNIX
allows only 20 open files at once, there is a limit of 19 input files if
no map file is produced and 18 input files if a map file is produced.
.s3
.dt
Here are some example command lines:
.s2
.ft B
	>bind prog phase1 phase2 phase3 phase4 -m
.ft
.s2
The above will bind the four phases together and place the result in
.bd prog.rel.
In addition, a map of the output will be placed in
.bd prog.map.
.s2
.ft B
	>bind teco teco tec3 -t0 -m
.ft
.s2
The above will bind teco and tec3 together and produce
.bd teco.load
and
.bd teco.map.
When loaded,
.bd teco.load
will be at the top of core. The map file tells where
each csect and global symbol was allocated.
.sh FILES
.ta \w'outfile.map    'u
outfile.rel	output file
.br
outfile.map	map file
.br
infile.rel	input file
.sh "SEE ALSO"
relld(VI), macro(I), lda(V), rel(V),
`MACRO\*-11 Assembler Programmer's Manual'.
.sh DIAGNOSTICS
The diagnostics are supposed to be self-explanatory.
