User`s guide
ELF Linker and Command Language
Linker Command File Keyword Listing
303Targeting MC56F83xx/DSP5685x Controllers
Example
memory{
code (RWX) : ORIGIN = 0x8000, LENGTH = 0
overlay1 (RWX) : ORIGIN = AFTER(code), LENGTH = 0
overlay2 (RWX) : ORIGIN = AFTER(code), LENGTH = 0
data (RW) : ORIGIN = 0x1000, LENGTH = 0
}
ORIGIN is the assigned address.
LENGTH is one of the following:
NOTE
There is no overflow checking with autolength. The linker can
produce an unexpected result if you use the autolength feature
without leaving enough free memory space to contain the memory
segment. For this reason, when you use autolength, use the AFTER
keyword to specify origin addresses.
> fileName is an option to write the segment to a binary file on disk instead of an
ELF program header. The binary file is put in the same folder as the ELF output file.
This option has two variants:
a memory address Specify a hex address, such as 0x8000.
an AFTER command Use the AFTER(name [,name]) command to tell the linker to
place the memory segment after the specified segment. In the
example below, overlay1 and overlay2 are placed after the
code segment. When multiple memory segments are specified
as parameters for AFTER, the highest memory address is
used.
a value greater than zero If you try to put more code and data into a memory segment
than your specified length allows, the linker stops with an error.
autolength by specifying
zero
When the length is 0, the linker lets you put as much code and
data into a memory segment as you want.
>fileName
Writes the segment to a new file.
>>fileName
Appends the segment to an existing file.