The SECTIONS Directive
7.8.3.3 Alignment and blocking
7.8.3.4 Specifying input sections
Example 7–5. The Most Common Method of Specifying Section Contents
7-38
You can tell the linker to place an output section at an address that falls on an
n-word boundary, where n is a power of 2. For example:
.text: load = align(128)
allocates .text so that it falls on a 128-word boundary.
Blocking is a weaker form of alignment that allocates a section anywhere
within a block of size n. If the section is larger than the block size, the section
will begin on that boundary. As with alignment, n must be a power of 2. For
example:
bss: load = block(0x80)
allocates .bss so that the section either is contained in a single 128-word page
or begins on a page.
You can use alignment or blocking alone or in conjunction with a memory area,
but alignment and blocking cannot be used together.
An input section specification identifies the sections from input files that are
combined to form an output section. The linker combines input sections by
concatenating them in the order in which they are specified. The size of an
output section is the sum of the sizes of the input sections that comprise it.
Example 7–5 shows the most common type of section specification; note that
no input sections are listed.
SECTIONS
{
.text:
.data:
.bss:
}
In Example 7–5 the linker takes all the .text sections from the input files and
combines them into the .text output section. The linker concatenates the .text
input sections in the order that it encounters them in the input files. The linker
performs similar operations with the .data and .bss sections. You can use this
type of specification for any output section.
Need help?
Do you have a question about the TMS320C54x and is the answer not in the manual?