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.40 Type 3 image, two load regions and non-contiguous execution regions<br />
Type 3 images consist of two load regions in load view and three execution regions in execution<br />
view. They are similar to images of type 2 except that <strong>the</strong> single load region in type 2 is now<br />
split into two load regions.<br />
Relocate and split load regions using <strong>the</strong> following linker options:<br />
--reloc The combination --reloc --split makes an image similar to simple type 3, but<br />
<strong>the</strong> two load regions now have <strong>the</strong> RELOC attribute.<br />
--ro_base=address1<br />
--rw_base=address2<br />
Specifies <strong>the</strong> load and execution address of <strong>the</strong> region containing <strong>the</strong> RO output<br />
section.<br />
Specifies <strong>the</strong> load and execution address for <strong>the</strong> region containing <strong>the</strong> RW output<br />
section.<br />
--split Splits <strong>the</strong> default single load region (that contains <strong>the</strong> RO and RW output<br />
sections) into two load regions. One load region contains <strong>the</strong> RO output section<br />
and one contains <strong>the</strong> RW output section.<br />
The following example shows <strong>the</strong> scatter-loading description equivalent to using<br />
--ro_base=0x010000 --rw_base=0x040000 --split:<br />
Example 8-26 Multiple load regions<br />
LR_1 0x010000 ; The first load region is at 0x010000.<br />
{<br />
ER_RO +0 ; The address is 0x010000.<br />
{<br />
* (+RO)<br />
}<br />
}<br />
LR_2 0x040000 ; The second load region is at 0x040000.<br />
{<br />
ER_RW +0 ; The address is 0x040000.<br />
{<br />
* (+RW) ; All RW sections are placed consecutively into this region.<br />
}<br />
ER_ZI +0 ; The address is 0x040000 + size of ER_RW region.<br />
{<br />
* (+ZI) ; All ZI sections are placed consecutively into this region.<br />
}<br />
}<br />
In this example:<br />
• This description creates an image with two load regions, named LR_1 and LR_2, that have<br />
load addresses 0x010000 and 0x040000.<br />
• The image has three execution regions, named ER_RO, ER_RW and ER_ZI, that contain <strong>the</strong> RO,<br />
RW, and ZI output sections respectively. The execution address of ER_RO is 0x010000.<br />
• The ER_RW execution region is not contiguous with ER_RO, because its execution address is<br />
0x040000.<br />
<strong>ARM</strong> DUI 0474C Copyright © 2010-2011 <strong>ARM</strong>. All rights reserved. 8-65<br />
ID080411 Non-Confidential