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 />

The following table shows <strong>the</strong> effect of +offset when used with <strong>the</strong> OVERLAY attribute. REGION1<br />

appears immediately before REGION2 in <strong>the</strong> scatter file:<br />

The following example shows <strong>the</strong> use of relative offsets with overlays and <strong>the</strong> effect on<br />

execution region addresses:<br />

EMB_APP 0x8000{<br />

CODE 0x8000<br />

{<br />

*(+RO)<br />

}<br />

}<br />

REGION1 is set<br />

with OVERLAY<br />

# REGION1 Base = CODE limit<br />

REGION1 +0 OVERLAY<br />

{<br />

module1.o(*)<br />

}<br />

# REGION2 Base = REGION1 Base<br />

REGION2 +0 OVERLAY<br />

{<br />

module2.o(*)<br />

}<br />

# REGION3 Base = REGION2 Base = REGION1 Base<br />

REGION3 +0 OVERLAY<br />

{<br />

module3.o(*)<br />

}<br />

# REGION4 Base = REGION3 Limit + 4<br />

Region4 +4 OVERLAY<br />

{<br />

module4.o(*)<br />

}<br />

Table 8-7 <strong>Using</strong> relative offset in overlays<br />

+offset REGION2 Base Address<br />

NO REGION1 Limit + <br />

YES +0 REGION1 Base Address<br />

YES REGION1 Limit + <br />

Example 8-17 Example of relative offset in overlays<br />

If <strong>the</strong> length of <strong>the</strong> non-overlay area is unknown, a zero relative offset can be used to specify <strong>the</strong><br />

start address of an overlay so that it is placed immediately after <strong>the</strong> end of <strong>the</strong> static section.<br />

You can use <strong>the</strong> following command-line options to add extra debug information to <strong>the</strong> image:<br />

• --emit_debug_overlay_relocs<br />

• --emit_debug_overlay_section.<br />

These permit an overlay-aware debugger to track which overlay is currently active.<br />

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

ID080411 Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!