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.

<strong>Using</strong> scatter files<br />

Example 8-25 Position-independent data<br />

LR_1 0x010000 ; The first load region is at 0x010000.<br />

{<br />

ER_RO +0 ; Default ABSOLUTE attribute is inherited from parent. The execution address<br />

; is 0x010000. The code and RO data cannot be moved.<br />

{<br />

* (+RO) ; All <strong>the</strong> RO sections go here.<br />

}<br />

ER_RW 0x018000 PI ; PI attribute overrides ABSOLUTE<br />

{<br />

* (+RW) ; The RW sections are placed at 0x018000 and <strong>the</strong>y can be moved.<br />

}<br />

ER_ZI +0 ; ER_ZI region placed after ER_RW region.<br />

{<br />

* (+ZI) ; All <strong>the</strong> ZI sections are placed consecutively here.<br />

}<br />

}<br />

8.39.2 See also<br />

ER_RO, <strong>the</strong> RO execution region, inherits <strong>the</strong> ABSOLUTE attribute from <strong>the</strong> load region LR_1. The<br />

next execution region, ER_RW, is marked as PI. Also, because <strong>the</strong> ER_ZI region has an offset of +0,<br />

it inherits <strong>the</strong> PI attribute from <strong>the</strong> ER_RW region.<br />

Similar scatter-loading descriptions can also be written to correspond to <strong>the</strong> usage of o<strong>the</strong>r<br />

combinations of --ropi and --rwpi with type 2 and type 3 images.<br />

Concepts<br />

<strong>Linker</strong> Reference:<br />

• About load region descriptions on page 4-5<br />

• Considerations when using a relative address +offset for load regions on page 4-16<br />

• Considerations when using a relative address +offset for execution regions on page 4-17.<br />

Reference<br />

<strong>Linker</strong> Reference:<br />

• --ro_base=address on page 2-135<br />

• --rw_base=address on page 2-139<br />

• --rwpi on page 2-140<br />

• Load region attributes on page 4-7.<br />

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

ID080411 Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!