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.

4.18 Veneer types<br />

4.18.1 See also<br />

Image structure and generation<br />

Veneers have different capabilities and use different code pieces. The linker selects <strong>the</strong> most<br />

appropriate, smallest, and fastest depending on <strong>the</strong> branching requirements:<br />

• Inline veneer:<br />

— used to perform only a state change<br />

— <strong>the</strong> veneer must be inserted just before <strong>the</strong> target section to be in range<br />

— an <strong>ARM</strong>-Thumb interworking veneer has a range of 256 bytes so <strong>the</strong> function entry<br />

point must appear within 256 bytes of <strong>the</strong> veneer<br />

— a Thumb-<strong>ARM</strong> interworking veneer has a range of zero bytes so <strong>the</strong> function entry<br />

point must appear immediately after <strong>the</strong> veneer<br />

— an inline veneer is always position-independent.<br />

• Short branch veneer:<br />

— an interworking Thumb to <strong>ARM</strong> short branch veneer has a range of 32MB, <strong>the</strong><br />

range for an <strong>ARM</strong> instruction<br />

— a short branch veneer is always position-independent.<br />

• Long branch veneer:<br />

— can branch anywhere in <strong>the</strong> 4GB address space<br />

— all long branch veneers are also interworking veneers<br />

— <strong>the</strong>re are different long branch veneers for absolute or position-independent code.<br />

When you are using veneers be aware of <strong>the</strong> following:<br />

• The inline veneer limitations mean that you cannot move inline veneers out of an<br />

execution region using a scatter file. Use <strong>the</strong> command-line option --no_inlineveneer to<br />

prevent <strong>the</strong> generation of inline veneers.<br />

• All veneers cannot be collected into one input section because <strong>the</strong> resulting veneer input<br />

section might not be within range of o<strong>the</strong>r input sections. If <strong>the</strong> sections are not within<br />

addressing range, long branching is not possible.<br />

• The linker generates position-independent variants of <strong>the</strong> veneers automatically.<br />

However, because such veneers are larger than non position-independent variants, <strong>the</strong><br />

linker only does this where necessary, that is, where <strong>the</strong> source and destination execution<br />

regions are both position-independent and are rigidly related.<br />

Veneers are generated to optimize code size. armlink, <strong>the</strong>refore, chooses <strong>the</strong> variant in order of<br />

preference:<br />

1. Inline veneer.<br />

2. Short branch veneer.<br />

3. Long veneer.<br />

Concepts<br />

• Overview of veneers on page 4-26.<br />

Reference<br />

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

• --inlineveneer, --no_inlineveneer on page 2-86<br />

• --max_veneer_passess=value on page 2-110.<br />

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

ID080411 Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!