| |||
| Home > Using Scatter-loading Description Files > Formal syntax of the scatter-loading description file > Execution region description | |||
An execution region has:
a name
a base address (either absolute or relative)
an optional maximum size specification
attributes that specify the properties of the execution region
one or more input section descriptions (the modules placed into this execution region).
Figure 5.7 shows the components of a typical execution region description.
The syntax, in BNF, is:
execution_region_description ::=
exec_region_name (base_address | "+" offset) [attribute_list] [max_size | "–" length]
"{"
input_section_description*
"}"
where:
exec_region_nameNames the execution region.
base_addressSpecifies the address where objects in the region
are to be linked. must
be word-aligned.base_address
+offsetDescribes a base address that is bytes
beyond the end of the preceding execution region. The value of offset must
be zero modulo four.offset
If there is no preceding execution region (that is, if this
is the first execution region in the load region) then + means
that the base address begins offset bytes
after the base of the containing load region. offset
If the + form
is used and the encompassing load region has the offsetRELOC attribute,
the execution region inherits the RELOC attribute.
However, if a fixed is
used, future occurrences of base_address do
not inherit the offsetRELOC attribute.
attribute_listThis specifies the properties of the execution region contents:
ABSOLUTEAbsolute address. The execution address of the region is specified by the base designator.
PIPosition-independent.
OVERLAYOverlaid.
FIXEDFixed address. Both the load address and execution address of the region is specified by the base designator (the region is a root region). See Creating root execution regions. The base designator must be either an absolute base address, or an offset of +0.
EMPTYReserves an empty block of memory of a given length in the execution region, typically used by a heap or stack. See Reserving an empty region for further information.
PADVALUEDefines
the value of any padding. If you specify PADVALUE,
you must give a value, for example:
EXEC 0x10000 PADVALUE 0xffffffff EMPTY ZEROPAD 0x2000
This creates a region of size 0x2000 full
of 0xffffffff.
PADVALUE must be a word in size. PADVALUE attributes
on load regions are ignored.
ZEROPADZero initialized sections are written in the ELF file as a block of zeros and, therefore, do not have to be zero-filled at runtime.
In certain situations, for example, simulation, this is preferable to spending a long time in a zeroing loop.
NOCOMPRESSShould not be compressed.
UNINITMust not be zero initialized.
max_sizeAn optional number that instructs the linker to
generate an error if the region has more than bytes
allocated to it.max_size
–lengthIf the length is given as a negative value, the base_address is
taken to be the end address of the region. Typically used with EMPTY to represent
a stack that grows down in memory. See Reserving an empty region for more information.
input_section_descriptionSpecifies the content of the input sections. See Input section description.
When specifying the properties of the execution region:
You can specify only one of the attributes PI, OVERLAY, FIXED,
and ABSOLUTE. Unless one of the attributes PI, FIXED,
or OVERLAY is specified, ABSOLUTE is
the default attribute of the execution region.
Execution regions that use the form
of the base designator either inherit the attributes of the preceding
execution region, (or of the containing load region if this is the
first execution region in the load region), or have the +offsetABSOLUTE attribute.
Only root execution regions can be zero initialized
using the ZEROPAD attribute. Using the ZEROPAD attribute
with a non-root execution region generates a warning and the attribute
is ignored.
The attribute RELOC cannot be
explicitly specified for execution regions. The region can only
be RELOC by inheriting the attribute from a load
region.
It is not possible for an execution region that
uses the form
of the base designator to have its own attributes (other than the +offsetABSOLUTE attribute
that overrides inheritance). Use the combination +0 ABSOLUTE to
set a region to ABSOLUTE without changing the
start location.
Execution regions that are specified as PI or OVERLAY (or
that have inherited the RELOC attribute) are
permitted to have overlapping address ranges. The linker faults
overlapping address ranges for ABSOLUTE and FIXED execution
regions.
RW data compression is enabled by default. The NOCOMPRESS keyword
enables you to specify that an execution region must not be compressed
in the final image.
UNINIT specifies that any ZI
output section in the execution region must not be zero initialized.
Use this to create execution regions containing uninitialized data or
memory-mapped I/O.