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.

8.16 Examples of using sorting algorithms for .ANY sections<br />

8.16.1 Descending size example<br />

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

These examples show <strong>the</strong> operation of <strong>the</strong> sorting algorithms for RO-CODE sections in<br />

sections_a.o and sections_b.o.<br />

The input section properties and ordering are shown in <strong>the</strong> following tables:<br />

Table 8-3 Input section properties for sections_a.o<br />

The following linker command-line options are used for this example:<br />

--any_sort_order=descending_size sections_a.o sections_b.o --scatter scatter.txt<br />

The order that <strong>the</strong> sections are processed by <strong>the</strong> .ANY assignment algorithm is:<br />

Sections of <strong>the</strong> same size use <strong>the</strong> tiebreak specified by --tiebreaker.<br />

Name Size<br />

seca_1 0x4<br />

seca_2 0x4<br />

seca_3 0x10<br />

seca_4 0x14<br />

Table 8-4 Input section properties for sections_b.o<br />

Name Size<br />

secb_1 0x4<br />

secb_2 0x4<br />

secb_3 0x10<br />

secb_4 0x14<br />

Table 8-5 Sort order for descending_size algorithm<br />

Name Size<br />

seca_4 0x14<br />

secb_4 0x14<br />

seca_3 0x10<br />

secb_3 0x10<br />

seca_1 0x4<br />

seca_2 0x4<br />

secb_1 0x4<br />

secb_2 0x4<br />

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

ID080411 Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!