| |||
| Home > Getting started with the ARM Compiler > Adding symbol versions | |||
The compiler and linker support the GNU-extended symbol versioning model.
To create a function with a symbol version in C or C++ code,
you must use the assembler label GNU extension to rename the function
symbol into a symbol that has the name for
a default function@@ver of ver,
or function for
a non default function@ver of ver.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 non default version:
int old_function(void) __asm__("versioned_fun@ver1");
int old_function(void)
{
return 1;
}
See:
Assembler labels in the Compiler Reference Guide
Symbol versioning in the Linker User Guide.