Linking an application containing relocatable sections

Applications containing relocatable sections must be linked. The linker parameter file must contain at least:

A minimal linker parameter file will look as shown in the following listing:

Listing: Minimal linker parameter file

/* Name of the executable file generated.      */
LINK test.abs

/* Name of the object file in the application. */

NAMES

  test.o      

END

SECTIONS

/* READ_ONLY memory area.  */

  MY_ROM  = READ_ONLY  0x2B00 TO 0x2BFF;

/* READ_WRITE memory area. */

  MY_RAM  = READ_WRITE 0x2800 TO 0x28FF;

END

PLACEMENT

/* Relocatable variable sections are allocated in MY_RAM.          */

  DEFAULT_RAM              INTO MY_RAM;

/* Relocatable code and constant sections are allocated in MY_ROM. */

  DEFAULT_ROM, constSec    INTO MY_ROM;

END

INIT entry                  /* Application entry point.            */

VECTOR ADDRESS 0xFFFE entry /* Initialization of the reset vector. */
Note: The programmer should ensure that the memory ranges he specifies in the SECTIONS block are valid addresses for the controller he is using. In addition, when using the SDI debugger the addresses specified for code or constant sections must be located in the target board ROM area. Otherwise, the debugger will not be able to load the application