SPRU514Z July 2001 – October 2023 SM320F28335-EP
This section applies to applications that use the COFF ABI.
If your system configuration does not support allocating an initialized section such as .econst to data memory, then you have to allocate the .econst section to load in program memory and run in data memory. At boot time, copy the .econst section from program to data memory. The following sequence shows how you can perform this task.
ar2000 -x rts.src boot.asm
CONST_COPY .set 1
cl2000 boot.asm
ar2000 -r rts2800_ml.lib boot.c.obj
For an .econst section, link with a linker command file that contains the following entries:
SECTIONS
{ ...
.econst : load = PROG PAGE 1, run = DATA PAGE 1
{
/* GET RUN ADDRESS */
__econst_run = .;
/* MARK LOAD ADDRESS */
*(.ec_mark)
/* ALLOCATE .econst */
*(.econst)
/* COMPUTE LENGTH */
__econst_length = - .__econst_run;
}
}
In your linker command file, you can substitute the name PROG with the name of a memory area on page 0 and DATA with the name of a memory area on page 1. The rest of the command file must use the names as above. The code in boot.asm that is enabled when you change CONST_COPY to 1 depends on the linker command file using these names in this manner. To change any of the names, you must edit boot.asm and change the names in the same way.