04.01.2015 Views

RealView Compilation Tools - ARM Information Center

RealView Compilation Tools - ARM Information Center

RealView Compilation Tools - 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.

Compiler-specific Features<br />

4.3.16 __attribute__((visibility("visibility_type")))<br />

This function attribute affects the visibility of ELF symbols.<br />

Note<br />

This attribute is a GNU compiler extension supported by the <strong>ARM</strong> compiler.<br />

Syntax<br />

__attribute__((visibility("visibility_type")))<br />

Where visibility_type is one of the following:<br />

default<br />

hidden<br />

internal<br />

protected<br />

The assumed visibility of symbols can be changed by other options.<br />

Default visibility overrides such changes. Default visibility corresponds<br />

to external linkage.<br />

The symbol is not placed into the dynamic symbol table, so no other<br />

executable or shared library can directly reference it. Indirect references<br />

are possible using function pointers.<br />

Unless otherwise specified by the processor-specific Application Binary<br />

Interface (psABI), internal visibility means that the function is never<br />

called from another module.<br />

The symbol is placed into the dynamic symbol table, but references<br />

within the defining module bind to the local symbol. That is, the symbol<br />

cannot be overridden by another module.<br />

Usage<br />

Except when specifying default visibility, this attribute is intended for use with<br />

declarations that would otherwise have external linkage.<br />

You can use this attribute in C and C++. In C++, it can also be applied to types, member<br />

functions, and namespace declarations.<br />

Example<br />

void __attribute__((visibility(“internal”))) foo()<br />

{<br />

...<br />

}<br />

4-40 Copyright © 2007-2010 <strong>ARM</strong>. All rights reserved. <strong>ARM</strong> DUI 0348C<br />

Non-Confidential,<br />

ID101213

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

Saved successfully!

Ooh no, something went wrong!