User manual
Linker ST Assembler-Linker
38/89 Doc ID 11392 Rev 4
5 Linker
5.1 What the linker does
After having separately assembled all the component modules in your program, the next
step is to link them together into a .COD file which can then be sent on to its final destination
using OBSEND.
This linking process is not just as a simple concatenation of the object modules. It resolves
all the external references. If a referenced label is not defined as PUBLIC, an error is
detected. It also checks the type of relocation to do, places the segment according to your
mapping, and checks if any of them is overrun.
5.2 Invoking the linker
5.3 Command line
5.3.1 Arguments
The linker needs the following arguments:
LYN [-no_overlap_error] <.OBJ file>[+<.OBJ file>...],
[<.COD file>],[<lib>][+<lib>...]
-no_overlap_error forces the generation of the .cod executable even if some
segments overlap.
If all or any arguments are left out of the command line, you will be prompted. For example:
LYN
STMicroelectronics - Linker - rel 3.00
.OBJ files: begin
.COD file [begin.cod]: begin
Libraries:
The .OBJ files are simply a list of all the object files that form your program. The .OBJ suffix
may be left out, and if more than one is specified they should be separated by '+' characters,
for example game+scores+keys would tell the linker to link game.obj, scores.obj and
key.obj. Object file path names should not include '-' or ';' characters. Character '.'
should be avoided, except for suffixes.
The .COD file has a default name formed of the first object file's name with forced suffix of
.COD. This will be the name of the file produced at the end of the link session. It contains all
the information from the link session in a special format: however, OBSEND must be used on
the .COD file before it is ready to use. If the default filename is not what you want, the
filename given at the prompt is used instead. The suffix will be forced to .COD if left blank.
The default is selected by leaving this argument blank at the command line, or pressing
<ENTER> at the prompt.
The Libraries prompt asks for a list of library files generated by the lib utility that should
be searched in case of finding unresolved external references. The format for giving multiple
libraries is the same as for the .OBJ list, except the suffix .LIB is assumed.