You can add specially-named symbols to input objects that cause the linker to create symbol versions.
These symbols are of the form:
name@versionfor a non-default version of a symbol.
name@@versionfor a default version of a symbol.
You must define these symbols, at the address of the function or data, as that you want to
export. The symbol name is divided into two parts, a symbol name
name and a version definition
name is added to the dynamic symbol table and becomes
part of the interface to the shared object. Version creates a version called
ver if it does not already exist and associates
name with the version called
The following example places the symbols
bar@@ver1 into the object symbol
int old_function(void) __asm__("foo@ver1"); int new_function(void) __asm__("foo@@ver2"); int other_function(void) __asm__("bar@@ver1");
The linker reads these symbols and creates version definitions
ver2. The symbol
foo is associated with a non-default
ver1, and with a default version of
bar is associated with a default version of
There is no way to create associations between versions with this method.