| |||
| Home > Using Scatter-loading Description Files > Formal syntax of the scatter-loading description file > Load region description | |||
A load region has:
a name (this is used by the linker to identify different load regions)
a base address (the start address for the code and data in the load view)
attributes (optional)
a maximum size (optional)
a list of execution regions (these identify the type and location of modules in the execution view).
Figure 5.6 shows the components of a typical load region description.
The syntax, in BNF, is:
load_region_description::=load_region_name(base_address| ("+"offset)) [attribute_list] [max_size] "{"execution_region_description+ "}"
where:
load_region_nameThe linker generates a Load$$ symbol
for each execution region. This symbol holds the load address of
the execution region (see Execution region description). The exec_region_name$$base,
however, is used only to identify each region, that is, it is not
used to generate load_region_nameLoad$$ symbols. region_name
An image created for use by a debugger requires a unique base address for each region because the debugger must load regions at their load addresses. Overlapping load region addresses result in part of the image being overwritten.
A loader or operating system, however, can correctly load overlapping position-independent regions. One or more of the position-independent regions is automatically moved to a different address.
base_addressThis specifies 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 load region. The value of offset must
be zero modulo four. If this is the first load region, then offset+ means
that the base address begins offset bytes
after zero.offset
attribute_listThis specifies the properties of the load region contents:
ABSOLUTEAbsolute address.
PIPosition-independent.
RELOCRelocatable.
OVERLAYOverlaid.
NOCOMPRESSShould not be compressed.
You can specify only one of the attributes ABSOLUTE, PI, RELOC,
and OVERLAY. The default load region attribute
is ABSOLUTE.
Load regions that have one of PI, RELOC, or OVERLAY attributes
can have overlapping address ranges. The linker faults overlapping address
ranges for ABSOLUTE load regions.
The OVERLAY keyword enables you to have
multiple execution regions at the same address. ARM does not provide
an overlay mechanism in RVDK. To use multiple execution regions
at the same address, you must provide your own overlay manager.
RW data compression is enabled by default. The NOCOMPRESS keyword
enables you to specify that a load region should not be compressed
in the final image.
max_sizeThis specifies the maximum size of the load region.
(If the optional max_size value is specified, armlink generates
an error if the region has more than max_size bytes
allocated to it.)
execution_region_descriptionThis specifies the execution region name, address, and contents. See Execution region description.