Execution region attributes
An execution region has attributes that allow you to control where parts of your image are loaded in the target memory at runtime.
The execution region attributes are:
ABSOLUTE
- The content is placed at a fixed address that does not change after linking. A base designator specifies the execution address of the region.
ALIGN
alignment
Increase the alignment constraint for the execution region from 4 to
.alignment
must be a positive power of 2. If the execution region has aalignment
, then the address must bebase_address
aligned. If the execution region has aalignment
+
, then the linker aligns the calculated base address of the region to anoffset
boundary.alignment
Note
ALIGN
on an execution region causes both the load address and execution address to be aligned. This alignment can result in padding being added to the ELF file. To align only the execution address, use theAlignExpr
expression on the base address.ALIGNALL
value
Increases the alignment of sections within the execution region.
The value must be a positive power of 2 and must be greater than or equal to 4.
ANY_SIZE
max_size
Specifies the maximum size within the execution region that
armlink
can fill with unassigned sections. You can use a simple expression to specify themax_size
. That is, you cannot use functions such asImageLimit()
.Note
SpecifyingANY_SIZE
overrides any effects that--any_contingency
has on the region.Be aware of the following restrictions when using this keyword:
max_size
must be less than or equal to the region size.- You can use
ANY_SIZE
on a region without a.ANY
selector butarmlink
ignores it.
AUTO_OVERLAY
-
Use to indicate regions of memory where armlink assigns the overlay sections for loading into at runtime. Overlay sections are those named
.ARM.overlay
in the input object.N
The execution region must not have any section selectors.
The addresses that you give for the execution regions are the addresses that armlink expects the overlaid code to be loaded at when running. The load region containing the execution regions is where armlink places the overlay contents.
By default, the overlay manager loads overlays by copying them into RAM from some other memory that is not suitable for direct execution. For example, very slow Flash or memory from which instruction fetches are not enabled. You can keep your unloaded overlays in peripheral storage that is not mapped into the address space of the processor. To keep such overlays in peripheral storage, you must extract the data manually from the linked image.
armlink allocates every overlay to one of the
AUTO_OVERLAY
execution regions, and has to be loaded into only that region to run correctly.You must use the
--overlay_veneers
command-line option when linking with a scatter file containing theAUTO_OVERLAY
attribute.Note
With theAUTO_OVERLAY
attribute, armlink decides how your code sections get allocated to overlay regions. With theOVERLAY
attribute, you must manually arrange the allocation of the code sections. EMPTY [–]
length
Reserves an empty block of memory of a given size in the execution region, typically used by a heap or stack. No section can be placed in a region with the
EMPTY
attribute.length
represents a stack that grows down in memory. If the length is given as a negative value, the
is taken to be the end address of the region.base_address
FILL
value
Creates a linker generated region containing a
. If you specifyvalue
FILL
, you must give a value, for example:FILL
. The0xFFFFFFFF
FILL
attribute replaces the following combination:EMPTY ZEROPAD PADVALUE
.In certain situations, such as a simulation, filling a region with a value is preferable to spending a long time in a zeroing loop.
FIXED
Fixed address. The linker attempts to make the execution address equal the load address. If it succeeds, then the region is a root region. If it does not succeed, then the linker produces an error.
Note
The linker inserts padding with this attribute.NOCOMPRESS
- RW data compression is enabled by default. The
NOCOMPRESS
keyword enables you to specify that RW data in an execution region must not be compressed in the final image. OVERLAY
Use for sections with overlaying address ranges. If consecutive execution regions have the same
+
, then they are given the same base address.offset
The content is placed at a fixed address that does not change after linking. The content might overlap with other regions designated as
OVERLAY
regions.PADVALUE
value
Defines the
to use for padding. If you specifyvalue
PADVALUE
, you must give a value, for example:EXEC 0x10000 PADVALUE 0xFFFFFFFF EMPTY ZEROPAD 0x2000
This example creates a region of size
full of 0xFFFFFFFF.0x2000
PADVALUE
must be a word in size.PADVALUE
attributes on load regions are ignored.PI
-
This region contains only position independent sections. The content does not depend on any fixed address and might be moved after linking without any extra processing.
Note
PI
is not supported for AArch64 state.Note
This attribute is not supported if an image contains execute-only sections. SORTTYPE
algorithm
Specifies the sorting
for the execution region, for example:algorithm
ER1 +0 SORTTYPE CallTree
Note
This attribute overrides any sorting algorithm that you specify with the--sort
command-line option.UNINIT
Use to create execution regions containing uninitialized data or memory-mapped I/O.
Note
ARM® Compiler does not support systems with ECC or parity protection where the memory is not initialized.ZEROPAD
Zero-initialized sections are written in the ELF file as a block of zeros and, therefore, do not have to be zero-filled at runtime.
This attribute sets the load length of a ZI output section to
Image$$
.region_name
$$ZI$$LengthOnly root execution regions can be zero-initialized using the
ZEROPAD
attribute. Using theZEROPAD
attribute with a non-root execution region generates a warning and the attribute is ignored.In certain situations, such as a simulation, filling a region with a value is preferable to spending a long time in a zeroing loop.