Keil™, An ARM® Company

RealView Linker and Utilities Guide

Load region description

5.2.3. Load region description

A load region has:

  • a name (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 (used to identify the type and location of modules in the execution view).

Figure 5.6 shows the components of a typical load region description.

Figure 5.6. Components of a 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_name

The linker generates a Load$$exec_region_name$$base symbol for each execution region. This symbol holds the load address of the execution region (see Execution region description). The load_region_name, however, is used only to identify each region, that is, it is not used to generate Load$$region_name symbols.

Note

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_address

Specifies the address where objects in the region are to be linked. base_address must be word-aligned.

+offset

Describes a base address that is offset 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 the base address of the load region.

attribute_list

Specifies the properties of the load region contents:

ABSOLUTE

Absolute address.

PI

Position-independent.

RELOC

Relocatable.

OVERLAY

Overlaid.

NOCOMPRESS

Must not be compressed.

ALIGN alignment

Increase the alignment constraint for the load region from 4 to alignment. alignment must be a positive power of 2. If the load region has a base_address then this must be alignment aligned. If the load region has a +offset then the linker aligns the calculated base address of the region to an alignment boundary.

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 RVCT. Therefore, 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 must not be compressed in the final image.

max_size

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_description

Specifies the execution region name, address, and contents. See Execution region description.

Copyright © 2007 ARM Limited. All rights reserved.ARM DUI 0377A