\documentstyle[a4,12pt]{article}
\begin{document}
\author{APM Manual pages}
\title{The LINK programs combine two or more compiled M68000 program modules}
\maketitle
\parskip .1 in
\setcounter{secnumdepth}{10}
\noindent
\section{Preamble}
into a single program module. The cross-references between the input
modules are discharged by the LINK program so that they no longer
require to be satisfied at execution time.

One of the reasons for carrying out this operation is to reduce the time
overhead in loading a program made up of a large number of fixed
modules. Another is to make a program more self-contained and less
dependent on the module environment in which it is run. Use of it
involves sacrificing the flexibility of load-time linking and
convenience of individual module development, so that it is appropriate
mainly for stable program suites.

Note also that, in the case of modules compiled with the V3 diagnostic
compilers, that diagnostic information from the constituent modules is
lost in the linking process.

The parameters to the program consist of a list of input module names
and a single name to be given to the output module. The file-name
extension .MOB is assumed for all of the names.

If the first input module is a main program, the resultant module will
also be a main program; otherwise the resultant module will simply be a
library of external procedures.

The import list of the output module will consist of all those imports
appearing in the import lists of the input modules which are NOT
satisfied by internal cross-reference.

By default, the export list of the output module will consist of all
those exports which are NOT used to satisfy internal cross-references.

The user may modify this behaviour by requesting that an export should
either be included irrespective (even if used internally) or excluded
irrespective (even if not used internally). This is done by following an
input module name with a list consisting of inclusions and/or
exclusions.

Parameters for the program may be provided as part of the
command line. If omitted from the command, they will be requested
on subsequent lines, one module per line.
For example
\\ \hspace*{ 0.2 in} \} LINK3 MAIN,SUB1,SUB2/NEWMAIN
or
\\ \hspace*{ 0.2 in} \} LINK3
\\ \hspace*{ 0.2 in} 1st file: MAIN
\\ \hspace*{ 0.2 in} 2nd file: SUB1
\\ \hspace*{ 0.2 in} 3rd file (or *): SUB2
\\ \hspace*{ 0.2 in} 4th file (or *): *
\\ \hspace*{ 0.2 in} New file: NEWMAIN

Inclusions and exclusions are specified by means of a + (inclusion)
or - (exclusion) followed by an export name (or * for all).
For example
\\ \hspace*{ 0.2 in} \} LINK
\\ \hspace*{ 0.2 in} 1st file: MAIN+*
\\ \hspace*{ 0.2 in} 2nd file: SUB1+PARSE-DIAGNOSE
\\ \hspace*{ 0.2 in} 3rd file (or *): SUB2-*+INITIALISE
\\ \hspace*{ 0.4 in} etc

Notes

This version of the LINK program can be applied only to
object modules compiled by the V3 compilers.

The process of linking does not alter the main code of the modules,
and the internally linked calls therefore use the same call sequence
as normally linked externals.

A linked module is itself acceptable as input to the LINK program.

If an import name could be satisfied by more than one export
name (by virtue of the presence of multiple exports with the same name)
the one that is used to satisfy the reference is not guaranteed to
match that which would be selected by load-time linking. In general,
this means that such duplication should be avoided.

Multiple occurrences of the same (unsatisfied) import name
will appear multiply in the linked file.

Diagnostic tables do not survive linking.

\vspace{.75in} view:link3 printed on 20/01/89 at 14.22

\newpage
\tableofcontents
\end{document}
