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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

Example 8-5 <strong>Using</strong> <strong>the</strong> FIXED attribute<br />

LR_1 0x040000 ; load region starts at 0x40000<br />

{ ; start of execution region descriptions<br />

ER_RO 0x040000 ; load address = execution address<br />

{<br />

* (+RO) ; RO sections o<strong>the</strong>r than those in init.o<br />

}<br />

ER_INIT 0x080000 FIXED ; load address and execution address of this<br />

; execution region are fixed at 0x80000<br />

{<br />

init.o(+RO) ; all RO sections from init.o<br />

}<br />

... ; rest of scatter-loading description<br />

}<br />

8.9.1 Examples of misusing <strong>the</strong> FIXED attribute<br />

The following example shows common cases where <strong>the</strong> FIXED execution region attribute is<br />

misused:<br />

Example 8-6 Misuse of <strong>the</strong> FIXED attribute<br />

LR1 0x8000<br />

{<br />

ER_LOW +0 0x1000<br />

{<br />

*(+RO)<br />

}<br />

; At this point <strong>the</strong> next available Load and Execution address is 0x8000 + size of<br />

; contents of ER_LOW. The maximum size is limited to 0x1000 so <strong>the</strong> next available Load<br />

; and Execution address is at most 0x9000<br />

ER_HIGH 0xF0000000 FIXED<br />

{<br />

*(+RW+ZI)<br />

}<br />

; The required execution address and load address is 0xF0000000. The linker inserts<br />

; 0xF0000000 - (0x8000 + size of(ER_LOW)) bytes of padding so that load address matches<br />

; execution address<br />

}<br />

; The o<strong>the</strong>r common misuse of FIXED is to give a lower execution address than <strong>the</strong> next<br />

; available load address.<br />

LR_HIGH 0x100000000<br />

{<br />

ER_LOW 0x1000 FIXED<br />

{<br />

*(+RO)<br />

}<br />

; The next available load address in LR_HIGH is 0x10000000. The required Execution<br />

; address is 0x1000. Because <strong>the</strong> next available load address in LR_HIGH must increase<br />

; monotonically <strong>the</strong> linker cannot give ER_LOW a Load Address lower than 0x10000000<br />

}<br />

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

ID080411 Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!