|Non-Confidential||PDF version||ARM DUI0474M|
|Home > Linker Optimization Features > Elimination of unused virtual functions|
Unused virtual function elimination is a refinement of unused section elimination.
Unused section elimination efficiently removes unused functions from C code. In C++ applications, virtual functions and RunTime Type Information (RTTI) objects are referenced by pointer tables, known as vtables. Without extra information, the linker cannot determine which vtable entries are accessed at runtime. This means that the standard unused section elimination algorithm used by the linker cannot guarantee to remove unused virtual functions and RTTI objects. Virtual Function Elimination (VFE) is a refinement of unused section elimination to reduce ROM size in images generated from C++ code. You can use this optimization to eliminate unused virtual functions and RTTI objects from your code.
An input section that contains more that one function can only be eliminated if all the functions are unused. The linker cannot remove unused functions from within a section.
VFE is a collaboration between the ARM® compiler and the linker whereby the compiler supplies extra information about unused virtual functions that is then used by the linker. Based on this analysis, the linker is able to remove unused virtual functions and RTTI objects.
For VFE to work, the linker requires all objects using C++ to have VFE annotations. If the linker finds a C++ mangled symbol name in the symbol table of an object and VFE information is not present, it turns off the optimization.
The compiler places the extra information in sections with names beginning
.arm_vfe. These sections are ignored by the linker when it is not