06.02.2013 Views

ARM Compiler toolchain Using the Linker - ARM Information Center

ARM Compiler toolchain Using the Linker - ARM Information Center

ARM Compiler toolchain Using the Linker - ARM Information Center

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

10.26 About embedded symbols<br />

10.26.1 See also<br />

BPABI and SysV shared libraries and executables<br />

You can add specially-named symbols to input objects that cause <strong>the</strong> linker to create symbol<br />

versions. These symbols are of <strong>the</strong> form:<br />

• name@version for a non-default version of a symbol<br />

• name@@version for a default version of a symbol.<br />

You must define <strong>the</strong>se symbols, at <strong>the</strong> address of <strong>the</strong> function or data, as that you want to export.<br />

The symbol name is divided into two parts, a symbol name name and a version definition version.<br />

The name is added to <strong>the</strong> dynamic symbol table and becomes part of <strong>the</strong> interface to <strong>the</strong> shared<br />

object. Version creates a version called ver if it does not already exist and associates name with<br />

<strong>the</strong> version called ver.<br />

The following example places <strong>the</strong> symbols foo@ver1, foo@@ver2, and bar@@ver1 into <strong>the</strong> object<br />

symbol table:<br />

int old_function(void) __asm__("foo@ver1");<br />

int new_function(void) __asm__("foo@@ver2");<br />

int o<strong>the</strong>r_function(void) __asm__("bar@@ver1");<br />

Example 10-3 Creating versioned symbols, embedded symbols<br />

The linker reads <strong>the</strong>se symbols and creates version definitions ver1 and ver2. The symbol foo is<br />

associated with a non-default version of ver1, and with a default version of ver2. The symbol<br />

bar is associated with a default version of ver1.<br />

There is no way to create associations between versions with this method.<br />

Reference<br />

<strong>Using</strong> <strong>the</strong> <strong>Compiler</strong>:<br />

• <strong>Using</strong> compiler and linker support for symbol versions on page 5-34.<br />

<strong>Using</strong> <strong>the</strong> Assembler:<br />

• Chapter 5 Writing <strong>ARM</strong> Assembly Language.<br />

<strong>ARM</strong> DUI 0474C Copyright © 2010-2011 <strong>ARM</strong>. All rights reserved. 10-30<br />

ID080411 Non-Confidential

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!