SPRU514Z July 2001 – October 2023 SM320F28335-EP
Linker Command File (COFF Example) shows a typical linker command file that links a C program. The command file in this example is named lnk.cmd. It links three object files (x.c.obj, y.c.obj, and z.c.obj) and creates a program (prog.out) and a map file (prog.map).
To link the program, enter the following:
cl2000 --run_linker lnk.cmd
The MEMORY and possibly the SECTIONS directives, might require modification to work with your system. See the TMS320C28x Assembly Language Tools User's Guide for more information on these directives.
x.c.obj y.c.obj z.c.obj /* Input filenames */
--output_file=prog.out /* Options */
--map_file=prog.map
--library=rts2800_ml.lib /* Get run-time support */
MEMORY /* MEMORY directive */
{
RAM: origin = 100h length = 0100h
ROM: origin = 01000h length = 0100h
}
SECTIONS /* SECTIONS directive */
{
.text: > ROM
.data: > ROM
.ebss: > RAM
.pinit: > ROM
.cinit: > ROM
.switch: > ROM
.econst: > RAM
.stack: > RAM
.esysmem: > RAM
If you are using EABI instead of COFF, change the following sections as needed: