Table of Contents        Previous topic       Next topic       

LINKER->Overview and Command Line Operation

The linker combines object modules created with the compiler and/or the assembler to create the final code that will run on your target system.  It carries out the following functions:

The linker will also construct a call tree of your C functions.  It will use this to perform an overlay analysis of the local data areas of any non-reentrant functions, sharing memory wherever possible.  It will report potential recursion of non-reentrant functions.  At the same time, the parameter space for non-reentrant functions with variable numbers of arguments will be sized to the maximum required by any of the calls to that function.

The target program can be produced in a number of different formats including Intel hex, Intel OMF51, Motorola 'S' record, HP/Microtec IEEE695 format or as a binary rom image.  No conversion utility has to be used - the linker directly outputs the program in the specified format.

An optional link map will show the final location and sizes of all segments and the values of all global variables.
The linker can be automatically invoked when the CL command is used.  However, the linker can also be run separately with the command line:

LINK [ofiles], [pfile], [mfile], [lfiles] [/options]
where    [ofiles] is a list (separated by spaces) of the object files to be linked
[pfile] is the name of the file in which the program code will be placed
[mfile] is the name of the file in which the link map will be placed
[lfiles] is a list (separated by spaces) of the library files which should be searched for unresolved references
[/options] is a list (separated by spaces) of linker options.

A semicolon placed after a file name causes default filenames to be used for the remaining filenames.