SLAU131V October 2004 – February 2020
a.c.obj /* First input filename */
b.c.obj /* Second input filename */
--output_file=prog.out /* Option to specify output file */
--map_file=prog.map /* Option to specify map file */
The sample file in Example 1 contains only filenames and options. (You can place comments in a command file by delimiting them with /* and */.) To invoke the linker with this command file, enter:
cl430 --run_linker link.cmd
You can place other parameters on the command line when you use a command file:
cl430 --run_linker --relocatable link.cmd x.c.obj y.c.obj
The linker processes the command file as soon as it encounters the filename, so a.c.obj and b.c.obj are linked into the output module before x.c.obj and y.c.obj.
You can specify multiple command files. If, for example, you have a file called names.lst that contains filenames and another file called dir.cmd that contains linker directives, you could enter:
cl430 --run_linker names.lst dir.cmd
One command file can call another command file; this type of nesting is limited to 16 levels. If a command file calls another command file as input, this statement must be the last statement in the calling command file.
Blanks and blank lines are insignificant in a command file except as delimiters. This also applies to the format of linker directives in a command file. Example 2 shows a sample command file that contains linker directives.