| |||
| Home > Using the Basic Linker Functionality > Using command-line options to create simple images > Type 2: one load region and non contiguous output regions | |||
An image of this type consists of a single load region, and three execution regions in execution view. The RW execution region is not contiguous with the RO execution region. This approach is used, for example, for ROM-based embedded systems (see Figure 3.4).
In the load view, the single load region consists of the RO and RW output sections placed consecutively, in ROM for example. The ZI output section does not exist at load time. It is created before execution using the description of the output section contained in the image file.
In the execution view, the first execution region contains the RO output section and the second execution region contains the RW and ZI output sections.
The execution address of the region containing the RO output section is the same as its load address, so the RO output section does not have to be moved.
The execution address of the region containing the RW output section is different from its load address, so the RW output section is moved from its load address (from the single load region) to its execution address (into the second execution region). The ZI execution region, and its output section, is placed contiguously with the RW execution region.
Use armlink options -ro-base to
specify the load and execution address for the RO output section,
and address-rw-base to
specify the execution address of the RW output section. If you do
not use the exec_address-ro-base option to specify the address,
the default value of 0x8000 is used by armlink.
For an embedded system, 0x0 is typical for the -ro-base value.
If you do not use the -rw-base option to specify
the address, the default is to place RW directly above RO.