Memory Layout
The
The linker does not shuffle sections to fit into the available regions, but
does move the requested sections into the correct regions and issue errors when
the regions become too full. A command file may contain at most one use of the
name
For example, to specify that memory has two regions available for
allocation—one starting at 0 for 256 kilobytes, and the other starting at
{
name (attr) : ORIGIN = origin, LENGTH = len
...
}
name
(attr) is an optional list of attributes, permitted for compatibility with the AT&T
linker but not used by ld beyond checking that the attribute list is valid. Valid attribute lists must
be made up of the characters “LIRWX”. If you omit the attribute list, you may omit the parentheses around it as
well.
origin is the start address of the region in physical memory. It is an expression
that must evaluate to a constant before mem-ory allocation is performed. The
keyword ORIGIN may be abbreviated to org or o (but not, for example, ‘ORG’).
len is the size in bytes of the region (an expression). The keyword LENGTH may be abbreviated to len or l.
{
rom : ORIGIN = 0, LENGTH = 256K
ram : org = 0x40000000, l = 4M
}