4.23 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
9.36 Assembler labels
Related information
Symbol versioning for BPABI models
Non-ConfidentialPDF file icon PDF versionARM DUI0472J
Copyright © 2010-2013 ARM. All rights reserved.