3.21 Using compiler and linker support for symbol versions

The compiler and the linker both support the GNU-extended symbol versioning model.

To create a function with a symbol version in C or C++ code, you must use the assembly label GNU extension. Use this extension to rename the function symbol into a symbol that has either of the following names:
  • function@@ver for a default ver of function.
  • function@ver for a nondefault ver of function.
For example, to define a default version:
int new_function(void) __asm__("versioned_fun@@ver2");
int new_function(void)
    return 2;
To define a nondefault version:
int old_function(void) __asm__("versioned_fun@ver1");
int old_function(void)
    return 1;
Related reference
8.36 Assembler labels
Non-ConfidentialPDF file icon PDF versionARM DUI0375E
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.