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.

0x00000200 0x00000010 Code RO 3 sec3 sections.o<br />

0x00000210 0x00000004 Code RO 4 sec4 sections.o<br />

0x00000214 0x00000004 Code RO 5 sec5 sections.o<br />

0x00000218 0x00000004 Code RO 6 sec6 sections.o<br />

Execution Region ER_3 (Base: 0x00000300, Size: 0x00000014, Max: 0x00000020, ABSOLUTE)<br />

Base Addr Size Type Attr Idx E Section Name Object<br />

0x00000300 0x00000014 Code RO 2 sec2 sections.o<br />

8.15.1 See also<br />

In this example:<br />

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

• The linker places sec1 in ER_1 because ER_1 has <strong>the</strong> most specific selector. ER_1 now has<br />

0x6 bytes remaining.<br />

• The linker <strong>the</strong>n tries to place sec2 in ER_1, because it has <strong>the</strong> most specific selector, but<br />

<strong>the</strong>re is not enough space. Therefore, ER_1 is marked as full and is not considered in<br />

subsequent placement steps. The linker chooses ER_3 for sec2 because it has higher<br />

priority than ER_2.<br />

• The linker <strong>the</strong>n tries to place sec3 in ER_3. It does not fit, so ER_3 is marked as full and <strong>the</strong><br />

linker places sec3 in ER_2.<br />

• The linker now processes sec4. This is 0x4 bytes so it can fit in ei<strong>the</strong>r ER_1 or ER_3. Because<br />

both of <strong>the</strong>se sections have previously been marked as full, <strong>the</strong>y are not considered. The<br />

linker places all remaining sections in ER_2.<br />

• If ano<strong>the</strong>r section sec7 of size 0x8 exists, and is processed after sec6 <strong>the</strong> example fails to<br />

link. The algorithm does not attempt to place <strong>the</strong> section in ER_1 or ER_3 because <strong>the</strong>y have<br />

previously been marked as full.<br />

Concepts<br />

• Placing unassigned sections with <strong>the</strong> .ANY module selector on page 8-25<br />

• Examples of using placement algorithms for .ANY sections on page 8-28.<br />

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

• How <strong>the</strong> linker resolves multiple matches when processing scatter files on page 4-26<br />

• Behavior when .ANY sections overflow because of linker-generated content on page 4-28.<br />

Reference<br />

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

• --any_placement=algorithm on page 2-9<br />

• --scatter=file on page 2-142.<br />

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

ID080411 Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!