| |||
| Home > BPABI and SysV shared libraries and executables > About embedded symbols | |||
You can add specially-named symbols to input objects that cause the linker to create symbol versions. These symbols are of the form:
name@version for
a non-default version of a symbol
name@@version for 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 and
a version definition name. The version is
added to the dynamic symbol table and becomes part of the interface
to the shared object. Version creates a version called name if
it does not already exist and associates ver with the
version called name.ver
The following example places the symbols foo@ver1, foo@@ver2,
and bar@@ver1 into the object symbol table:
Example 41. Creating versioned symbols, embedded symbols
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 ver1 and ver2.
The symbol foo is associated with a non-default
version of ver1, and with
a default version of ver2. The symbol bar is
associated with a default version of ver1.
There is no way to create associations between versions with this method.
Using the Compiler:
Using the Assembler: