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.

}<br />

}<br />

.ANY1(+RO) ; evenly distributed with er1<br />

8.13.4 Controlling <strong>the</strong> placement of input sections for multiple .ANY selectors<br />

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

You can modify how <strong>the</strong> linker places unassigned input sections when using multiple .ANY<br />

selectors by using a different placement algorithm or a different sort order. The following<br />

command-line options are available:<br />

• --any_placement=algorithm, where algorithm is one of first_fit, worst_fit, best_fit, or<br />

next_fit<br />

• --any_sort_order=order, where order is one of cmdline or descending_size.<br />

Use first_fit when you want to fill regions in order.<br />

Use best_fit when you want to fill regions to <strong>the</strong>ir maximum.<br />

Use worst_fit when you want to fill regions evenly. With equal sized regions and sections<br />

worst_fit fills regions cyclically.<br />

Use next_fit when you need a more deterministic fill pattern.<br />

If <strong>the</strong> linker attempts to fill a region to its limit, as it does with first_fit and best_fit, it might<br />

overfill <strong>the</strong> region. This is because linker-generated content such as padding and veneers are not<br />

known until sections have been assigned to .ANY selectors. If this occurs you might see <strong>the</strong><br />

following error:<br />

Error: L6220E: Execution region regionname size (size bytes) exceeds limit (limit bytes).<br />

The --any_contingency option prevents <strong>the</strong> linker from filling <strong>the</strong> region up to its maximum. It<br />

reserves a portion of <strong>the</strong> region's size for linker-generated content and fills this contingency area<br />

only if no o<strong>the</strong>r regions have space. It is enabled by default for <strong>the</strong> first_fit and best_fit<br />

algorithms, because <strong>the</strong>y are most likely to exhibit this behavior.<br />

8.13.5 Specifying <strong>the</strong> maximum size permitted for placing unassigned sections<br />

The execution region attribute ANY_SIZE max_size enables you to specify <strong>the</strong> maximum size in a<br />

region that armlink can fill with unassigned sections.<br />

Be aware of <strong>the</strong> following restrictions when using this keyword:<br />

• max_size must be less than or equal to <strong>the</strong> region size<br />

• you can use ANY_SIZE on a region without a .ANY selector but it is ignored by armlink.<br />

When ANY_SIZE is present, armlink:<br />

• Does not override a given .ANY size. That is, it does not reduce <strong>the</strong> priority <strong>the</strong>n try to fit<br />

more sections in later.<br />

• Never recalculates contingency.<br />

• Never assigns sections in <strong>the</strong> contingency space.<br />

ANY_SIZE does not require --any_contingency to be specified. However, when --any_contingency<br />

is specified and ANY_SIZE is not, armlink attempts to adjust contingencies. The aims are to:<br />

• never overflow a .ANY region<br />

• never refuse to place a section in a contingency reserved space.<br />

If you specify --any_contingency on <strong>the</strong> command line, it is ignored for regions that have<br />

ANY_SIZE specified. It is used as normal for regions that do not have ANY_SIZE specified.<br />

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

ID080411 Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!