| |||
| Home > Using the Basic Linker Functionality > Using command-line options to create simple images > Type 3: two load regions and noncontiguous output regions | |||
This type of image is similar to images of type 2 except that the single load region in type 2 is now split into two load regions (see Figure 3.5).
In the load view, the first load region consists of the RO output section, and the second load region consists of the RW output section. 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 RO region is the same as its load address, so the contents of the RO output section are not moved from their load address to their execution address.
The execution address of the RW region is also the same as its load address, so the contents of the RW output section are not moved from their load address to their execution address. However, the ZI output section is created before execution begins and placed after the RW region.
Specify the load and execution address using the following linker options:
-relocThe combination -reloc -split makes
an image similar to Simple type 3, but the two load regions now
have the RELOC attribute.
-splitThis
option splits the default single load region (that contains both
the RO and RW output sections) into two load regions (one containing
the RO output section and one containing the RW output section)
so that they can be separately placed using -ro-base and -rw-base.
-ro-base address This option instructs armlink to set the load and
execution address of the region containing the RO section at a 4-byte
aligned (for example,
the address of the first location in ROM). If address-ro-base option
is not used to specify the address, the default value of 0x8000 is
used by armlink.
-rw-base address This option instructs armlink to set the execution
address of the region containing the RW output section at a 4-byte
aligned . If
this option is used with address-split, both the load
and execution addresses of the RW region are specified.
Using -reloc -rw-base without also using -split causes
an error.