2009年5月11日星期一

[转] What is Veneer?

Veneers are small sections of code generated by the linker and inserted into your program. armlink must generate veneers when a branch involves a destination beyond the branching range of the current state.
The range of a BL instruction is 32MB for ARM, 16MB for Thumb-2, and 4MB for Thumb. A veneer can, therefore, extend the range of the branch by becoming the intermediate target of the instruction and then setting the PC to the destination address. If ARM and Thumb are mixed, the veneer also changes processor state.
armlink supports the following veneer types:
(1).ARM to ARM
(2).ARM to Thumb (interworking veneers)
(3).Thumb to ARM (interworking veneers)
(4).Thumb to Thumb.
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. 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. In ARMv5 and above, the BLX instruction is used.
Veneer sharingYou can use the command-line option ??no_veneershare to specify that veneers are not shared. This assigns ownership of the created veneer section to the object that created the veneer and so enables you to select veneers from a particular object in a scatter-loading description file, for example:
LR 0x8000
{
ER_ROOT +0
{
object1.o(Veneer$$Code)
}
}
Veneer sharing makes it impossible to assign an owning object. Using ??no_veneershare, therefore, provides a more consistent image layout. This comes at the cost of a significant increase in code size.
Ref: http://www.keil.com/support/man/docs/armlink/armlink_cchhgfaj.htm

anon$$obj.o(Veneer$$Code) 原来就是和这个东西有关系

没有评论:

发表评论