7.8.3
Allocation
The linker assigns each output section two locations in target memory: the
location where the section will be loaded and the location where it will be run.
Usually, these are the same, and you can think of each section as having only
a single address. In any case, the process of locating the output section in the
target's memory and assigning its address(es) is called allocation. For more
information about using separate load and run allocation, see Section 7.9,
Specifying a Section's Runtime Address , on page 7-41.
If you do not tell the linker how a section is to be allocated, it uses a default
algorithm to allocate the section. Generally, the linker puts sections wherever
they fit into configured memory. You can override this default allocation for a
section by defining it within a SECTIONS directive and providing instructions
on how to allocate it.
You control allocation by specifying one or more allocation parameters. Each
parameter consists of a keyword, an optional equal sign or greater-than sign,
and a value optionally enclosed in parentheses. If load and run allocation is
separate, all parameters following the keyword LOAD apply to load allocation,
and those following RUN apply to run allocation. Possible allocation
parameters are:
Binding
allocates a section at a specific address.
.text: load = 0x1000
Memory
allocates the section into a range defined in the MEMORY
directive with the specified name (like ROM) or attributes.
.text: load > ROM
Alignment
uses the align keyword to specify that the section should
start on an address boundary.
.text: align = 0x80
To force the output section containing the assignment to also
be aligned, assign . (dot) with an align expression. For exam-
ple, the following will align bar.obj, and it will force outsect to
align on a 0x40 word boundary:
SECTIONS
{
outsect:
}
The SECTIONS Directive
{
bar.obj(.bss)
. = align(0x40);
}
Linker Description
7-35
Need help?
Do you have a question about the TMS320C54x and is the answer not in the manual?