SPNU118Y September 1995 – February 2020
/*****************************************************************************/
/*** Specify Link Options ***/
/*****************************************************************************/
--entry_point SETUP /* Define the program entry point */
--output_file=demo.out /* Name the output file */
--map_file=demo.map /* Create an output map file */
/*****************************************************************************/
/*** Specify the Input Files ***/
/*****************************************************************************/
demo.c.obj
ctrl.c.obj
tables.c.obj
/*****************************************************************************/
/*** Specify the Memory Configurations ***/
/*****************************************************************************/
MEMORY
{
FAST_MEM : org = 0x00000000 len = 0x00001000 /* PROGRAM MEMORY (ROM) */
SLOW_MEM : org = 0x00001000 len = 0x00001000 /* DATA MEMORY (RAM) */
EEPROM : org = 0x08000000 len = 0x00000400 /* COEFFICIENTS (EEPROM) */
}
/*****************************************************************************/
/* Specify the Output Sections */
/*****************************************************************************/
SECTIONS
{
.text : {} > FAST_MEM /* Link all .text sections into ROM */
.intvecs : {} > 0x0 /* Link interrupt vectors at 0x0 */
.data : /* Link .data sections */
{
tables.c.obj(.data)
. = 0x400; /* Create hole at end of block */
} > EEPROM, fill = 0xFF00FF00 /* Fill and link into EEPROM */
ctrl_vars: /* Create new sections for ctrl variables */
{
ctrl.c.obj(.bss)
} > SLOW_MEM, fill = 0x00000100 /* Fill with 0x100 and link into RAM */
.bss : {} > SLOW_MEM /* Link remaining .bss sections into RAM */
}
/*****************************************************************************/
/*** End of Command File ***/
/*****************************************************************************/
Invoke the linker by entering the following command:
armcl --run_linker demo.cmd
This creates the map file shown in Example 32 and an output file called demo.out that can be run on an ARM device.