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
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<strong>Using</strong> scatter files<br />
8.39 Type 2 image, one load region and non-contiguous execution regions<br />
An image of this type consists of a single load region in <strong>the</strong> load view and three execution<br />
regions in <strong>the</strong> execution view. It is similar to images of type 1 except that <strong>the</strong> RW execution<br />
region is not contiguous with <strong>the</strong> RO execution region.<br />
--ro_base=address1 specifies <strong>the</strong> load and execution address of <strong>the</strong> region containing <strong>the</strong> RO<br />
output section. --rw_base=address2 specifies <strong>the</strong> execution address for <strong>the</strong> RW execution region.<br />
The following example shows <strong>the</strong> scatter-loading description equivalent to using<br />
--ro_base=0x010000 --rw_base=0x040000:<br />
Example 8-24 Single load region and multiple execution regions<br />
LR_1 0x010000 ; Defines <strong>the</strong> load region name as LR_1<br />
{<br />
ER_RO +0 ; The first execution region is called ER_RO and starts at end of previous region.<br />
; Because <strong>the</strong>re is no previous region, <strong>the</strong> address is 0x010000.<br />
{<br />
* (+RO) ; All RO sections are placed consecutively into this region.<br />
}<br />
ER_RW 0x040000 ; Second execution region is called ER_RW and starts at 0x040000.<br />
{<br />
* (+RW) ; All RW sections are placed consecutively into this region.<br />
}<br />
ER_ZI +0 ; The last execution region is called ER_ZI.<br />
; The address is 0x040000 + size of ER_RW region.<br />
{<br />
* (+ZI) ; All ZI sections are placed consecutively here.<br />
}<br />
}<br />
8.39.1 rwpi example variant<br />
In this example:<br />
• This description creates an image with one load region, named LR_1, with a load address<br />
of 0x010000.<br />
• The image has three execution regions, named ER_RO, ER_RW, and ER_ZI, that contain <strong>the</strong><br />
RO, RW, and ZI output sections respectively. The RO region is a root region. The<br />
execution address of ER_RO is 0x010000.<br />
• The ER_RW execution region is not contiguous with ER_RO. Its execution address is 0x040000.<br />
• The ER_ZI execution region is placed immediately following <strong>the</strong> end of <strong>the</strong> preceding<br />
execution region, ER_RW.<br />
This is similar to images of type 2 with --rw_base where <strong>the</strong> RW execution region is separate<br />
from <strong>the</strong> RO execution region. However, --rwpi marks <strong>the</strong> execution regions containing <strong>the</strong> RW<br />
output section as position-independent.<br />
The following example shows <strong>the</strong> scatter-loading description equivalent to using<br />
--ro_base=0x010000 --rw_base=0x018000 --rwpi:<br />
<strong>ARM</strong> DUI 0474C Copyright © 2010-2011 <strong>ARM</strong>. All rights reserved. 8-63<br />
ID080411 Non-Confidential