The general syntax for invoking the linker is:
cl430 --run_linker [options] filename1 .... filenamen |
cl430 --run_linker | is the command that invokes the linker. The --run_linker option's short form is -z. |
options | can appear anywhere on the command line or in a linker command file. (Options are discussed in Section 8.4.) |
filename1, filenamen | can be object files, linker command files, or archive libraries. The default extensions for input files are .c.obj (for C source files) and .cpp.obj (for C++ source files). Any other extension must be explicitly specified. The linker can determine whether the input file is an object or ASCII file that contains linker commands. The default output filename is a.out, unless you use the --output_file option to name the output file. |
NOTE
The default file extensions for object files created by the compiler have been changed. Object files generated from C source files have the .c.obj extension. Object files generated from C++ source files have the .cpp.obj extension. Object files generated from assembly source files still have the .obj extension.
There are two methods for invoking the linker:
cl430 --run_linker file1.c.obj file2.c.obj --output_file=link.out
--output_file=link.out file1.c.obj file2.c.obj
Now you can invoke the linker from the command line; specify the command filename as an input file:
cl430 --run_linker linker.cmd
When you use a command file, you can also specify other options and files on the command line. For example, you could enter:
cl430 --run_linker --map_file=link.map linker.cmd file3.c.obj
The linker reads and processes a command file as soon as it encounters the filename on the command line, so it links the files in this order: file1.c.obj, file2.c.obj, and file3.c.obj. This example creates an output file called link.out and a map file called link.map.
For information on invoking the linker for C/C++ files, see Section 8.11.