Creating Memory Gaps. NXP CodeWarrior Development Studio
Реклама
Реклама
Chapter 13 Linker for AIOP
The dot keyword ("
.
"), is a convenient way to set the linker's place in the current output section.
shows an example.
Listing 13-9. Skipping areas of memory
SECTIONS
{
GROUP :
{
.ISR_Table : {}
. = 0x2000
} > flash
GROUP :
{
.paramsection : {}
} > flash
}
This example defines two sections. The first section,
.ISRTable
, will be loaded at beginning of the memory area named flash
on the target platform at runtime. The second section,
.paramsection
, will be loaded at the address that is
0x2000
bytes past the beginning of the memory area named flash
.
13.8 Creating Memory Gaps
You can create gaps in memory by performing alignment calculations such as
. = (. + 0x20) & ~0x20;
This kind of calculation can occur between output_specs
, between input_specs,
or even in address_modifiers
. A "." refers to the current address. You may assign the
.
to a specific unallocated address or just do alignment as the example shows. The gap is filled with zeroes, in the case of an alignment (but not with
ALIGN()
).
You can specify an alternate fill pattern with
= <short_value>
, as in
.text : { . = (. + 0x20) & ~0x20; *(.text) } = 0xAB > text short_value
is 2 bytes long. Note that the fill pattern comes before the memory_spec
. You can add a fill to a
GROUP
or to an individual output_spec
section. Fills cannot be added between
.bss
type sections. All calculations must end in a "
;
".
CodeWarrior Development Studio for Advanced Packet Processing Build Tools Reference Manual, Rev.
10.2, 01/2016
Freescale Semiconductor, Inc.
211
Завантажити
Реклама