Keil Logo

Technical Support

On-Line Manuals

Linker User Guide

Preface Overview of the Linker Linking Models Supported by armlink Image Structure and Generation The structure of an ARM ELF image Views of the image at each link stage Input sections, output sections, regions, and prog Load view and execution view of an image Methods of specifying an image memory map with the Image entry points Simple images Types of simple image Type 1 image structure, one load region and contig Type 2 image structure, one load region and non-co Type 3 image structure, multiple load regions and Section placement with the linker Default section placement Section placement with the FIRST and LAST attribut Section alignment with the linker Linker support for creating demand-paged files Linker reordering of execution regions containing Linker-generated veneers What is a veneer? Veneer sharing Veneer types Generation of position independent to absolute ven Reuse of veneers when scatter-loading Command-line options used to control the generatio Weak references and definitions How the linker performs library searching, selecti How the linker searches for the ARM standard libra Specifying user libraries when linking How the linker resolves references The strict family of linker options Linker Optimization Features Getting Image Details Accessing and Managing Symbols with armlink Scatter-loading Features Scatter File Syntax Linker Command-line Options Linker Steering File Command Reference Via File Syntax

Veneer types

3.6.3 Veneer types

Veneers have different capabilities and use different code pieces.

The linker selects the most appropriate, smallest, and fastest depending on the branching requirements:
  • Inline veneer:
    • Performs only a state change.
    • The veneer must be inserted just before the target section to be in range.
    • An ARM-Thumb interworking veneer has a range of 256 bytes so the function entry point must appear within 256 bytes of the veneer.
    • A Thumb-ARM interworking veneer has a range of zero bytes so the function entry point must appear immediately after the veneer.
    • An inline veneer is always position-independent.
  • Short branch veneer:
    • An interworking Thumb to ARM short branch veneer has a range of 32MB, the range for an ARM instruction.
    • A short branch veneer is always position-independent.
    • A Range Extension Thumb to Thumb short branch veneer for processors that support Thumb-2 technology.
  • Long branch veneer:
    • Can branch anywhere in the address space.
    • All long branch veneers are also interworking veneers.
    • There are different long branch veneers for absolute or position-independent code.
When you are using veneers be aware of the following:
  • The inline veneer limitations mean that you cannot move inline veneers out of an execution region using a scatter file. Use the command-line option --no_inlineveneer to prevent the generation of inline veneers.
  • All veneers cannot be collected into one input section because the resulting veneer input section might not be within range of other input sections. If the sections are not within addressing range, long branching is not possible.
  • The linker generates position-independent variants of the veneers automatically. However, because such veneers are larger than non position-independent variants, the linker only does this where necessary, that is, where the source and destination execution regions are both position-independent and are rigidly related.
Veneers are generated to optimize code size. armlink, therefore, chooses the variant in the order of preference:
  1. Inline veneer.
  2. Short branch veneer.
  3. Long veneer.
Related concepts
Non-ConfidentialPDF file icon PDF versionARM DUI0377H
Copyright © 2007, 2008, 2011, 2012, 2014-2016 ARM. All rights reserved. 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.