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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

BPABI and SysV shared libraries and executables<br />

10.12 Automatic dynamic symbol table rules in <strong>the</strong> SysV memory model<br />

The following rules apply to <strong>the</strong> System V (SysV) memory model:<br />

Executable An undefined symbol reference is an undefined symbol error.<br />

Global symbols with STV_HIDDEN or STV_INTERNAL visibility are never exported to<br />

<strong>the</strong> dynamic symbol table.<br />

Global symbols with STV_PROTECTED or STV_DEFAULT visibility are not exported to<br />

<strong>the</strong> dynamic symbol table unless you specify <strong>the</strong> --export_all or<br />

--export_dynamic option.<br />

Shared library<br />

An undefined symbol reference with STV_DEFAULT visibility is treated as imported<br />

and is placed in <strong>the</strong> dynamic symbol table.<br />

An undefined symbol reference without STV_DEFAULT visibility is an undefined<br />

symbol error.<br />

Global symbols with STV_HIDDEN or STV_INTERNAL visibility are never exported to<br />

<strong>the</strong> dynamic symbol table.<br />

10.12.1 Symbol definitions defined for compatibility with glibc<br />

Note<br />

STV_HIDDEN or STV_INTERNAL global symbols that are required for relocation can be<br />

placed in <strong>the</strong> dynamic symbol table, however <strong>the</strong> linker changes <strong>the</strong>m into local<br />

symbols to prevent <strong>the</strong>m from being accessed from outside <strong>the</strong> shared library.<br />

Global symbols with STV_PROTECTED or STV_DEFAULT visibility are always exported<br />

to <strong>the</strong> dynamic symbol table.<br />

To improve SysV compatibility with glibc, <strong>the</strong> linker defines <strong>the</strong> following symbols if <strong>the</strong><br />

corresponding sections exist in an object:<br />

• for .init_array sections:<br />

— __init_array_start<br />

— __init_array_end<br />

• for .fini_array sections:<br />

— __fini_array_start<br />

— __fini_array_end<br />

• for <strong>ARM</strong>.exidx sections:<br />

— __exidx_start<br />

— __exidx_end<br />

• for .preinit_array sections:<br />

— __preinit_array_start<br />

— __preinit_array_end<br />

• __executable_start<br />

• etext<br />

• _etext<br />

• __etext<br />

• __data_start<br />

• edata<br />

• _edata<br />

• __bss_start<br />

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

ID080411 Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!