Veneers are small sections of code generated by the linker
and inserted into your program. The BL instruction is PC-relative
and has a limited branch range. Therefore, armlink must
generate veneers when a branch involves a destination beyond the
branching range of the
The range of a
BL instruction is 32MB for ARM
instructions, 16MB for 32-bit encoded Thumb instructions, and 4MB
for 16-bit encoded Thumb 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 4 GB address space.
If the veneer is inserted between ARM and Thumb code, the veneer
also handles instruction set state change.
The linker can generate the following veneer types depending on what is required:
short branch veneers
long branch veneers.
armlink creates one input section called
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.
If you are using ARMv4T, armlink generates
veneers when a branch involves change of state between ARM and Thumb.
You still get interworking veneers for ARMv5TE and later when using
conditional branches, because there is no conditional
for state changes are also required for
in ARMv5 and later.