06.02.2013 Views

ARM Compiler toolchain Using the Linker - ARM Information Center

ARM Compiler toolchain Using the Linker - ARM Information Center

ARM Compiler toolchain Using the Linker - ARM Information Center

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Image structure and generation<br />

4.7 Type 2 image, one load region and non-contiguous execution regions<br />

4.7.1 Load view<br />

RAM<br />

ROM<br />

4.7.2 Execution view<br />

A Type 2 image consists of a single load region, and three execution regions in execution view.<br />

The RW execution region is not contiguous with <strong>the</strong> RO execution region. This approach is<br />

used, for example, for ROM-based embedded systems, where RW data is copied from ROM to<br />

RAM at startup:<br />

RW output section<br />

RO output section<br />

Load view<br />

0xA000<br />

Copy/<br />

decompress<br />

Single<br />

load<br />

region<br />

0x0000<br />

Use <strong>the</strong> following command for images of this type:<br />

armlink --ro_base 0x0 --rw_base 0xA000<br />

ZI output section<br />

RW output section<br />

RO output section<br />

Execution view<br />

ZI execution<br />

region<br />

RW execution<br />

region<br />

--rw-base value<br />

RO execution<br />

region<br />

--ro-base value<br />

Figure 4-4 Simple type 2 image<br />

In <strong>the</strong> load view, <strong>the</strong> single load region consists of <strong>the</strong> RO and RW output sections placed<br />

consecutively, for example, in ROM. Here, <strong>the</strong> RO region is a root region, and <strong>the</strong> RW region<br />

is non-root. The ZI output section does not exist at load time. It is created at runtime.<br />

In <strong>the</strong> execution view, <strong>the</strong> first execution region contains <strong>the</strong> RO output section and <strong>the</strong> second<br />

execution region contains <strong>the</strong> RW and ZI output sections.<br />

The execution address of <strong>the</strong> region containing <strong>the</strong> RO output section is <strong>the</strong> same as its load<br />

address, so <strong>the</strong> RO output section does not have to be moved. That is, it is a root region.<br />

The execution address of <strong>the</strong> region containing <strong>the</strong> RW output section is different from its load<br />

address, so <strong>the</strong> RW output section is moved from its load address (from <strong>the</strong> single load region)<br />

to its execution address (into <strong>the</strong> second execution region). The ZI execution region, and its<br />

output section, is placed contiguously with <strong>the</strong> RW execution region.<br />

<strong>ARM</strong> DUI 0474C Copyright © 2010-2011 <strong>ARM</strong>. All rights reserved. 4-13<br />

ID080411 Non-Confidential

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!