You copied the Doc URL to your clipboard.

What is a veneer?

A veneer extends the range of a branch by becoming the intermediate target of the branch instruction.

The range of a BL instruction depends on the architecture:

  • For AArch32 state, the range is 32MB for A32 instructions, 16MB for 32-bit T32 instructions, and 4MB for 16-bit T32 instructions. A veneer extends the range of the branch by becoming the intermediate target of the branch instruction. The veneer then sets the PC to the destination address.

    This enables the veneer to branch anywhere in the 4GB address space. If the veneer is inserted between A32 and T32 code, the veneer also handles instruction set state change.

  • For AArch64 state, the range is 128MB. A veneer extends the range of the branch by becoming the intermediate target of the branch instruction. The veneer then loads the destination address and branches to it.

    This enables the veneer to branch anywhere in the 16EB address space.

    Note

    There are no state-change veneers in AArch64 state.

The linker can generate the following veneer types depending on what is required:

  • Inline veneers.

  • Short branch veneers.

  • Long branch veneers.

armlink creates one input section called Veneer$$Code for each veneer. A veneer is generated only if no other existing veneer can satisfy the requirements. If two input sections contain a long branch to the same destination, only one veneer is generated that is shared by both branch instructions. A veneer is only shared in this way if it can be reached by both sections.

Note

If execute-only (XO) sections are present, only XO-compliant veneer code is created in XO regions.
Was this page helpful? Yes No