29.12.2014 Views

RealView Compilation Tools Compiler Reference Guide - ARM ...

RealView Compilation Tools Compiler Reference Guide - ARM ...

RealView Compilation Tools Compiler Reference Guide - ARM ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

<strong>Compiler</strong>-specific Features<br />

Function marked as used are emitted to a single section, in the order they are declared.<br />

You can specify the section functions are placed in using __attribute__((section)).<br />

Note<br />

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

compiler.<br />

Note<br />

Variables might also be marked as used, using the corresponding variable attribute<br />

__attribute__((used)).<br />

Example<br />

int lose_this(int);<br />

int keep_this(int) __attribute__((used)); // retained in object file<br />

int keep_this_too(int) __attribute__((used)); // retained in object file<br />

See also<br />

• __attribute__((section)) on page 4-34.<br />

• __attribute__((used)) on page 4-47.<br />

4.3.12 __attribute__((weak))<br />

Functions defined with __attribute__((weak)) export their symbols weakly.<br />

Functions declared with __attribute__((weak)) and then defined without<br />

__attribute__((weak)) behave as weak functions. This is not the same behavior as the<br />

__weak keyword.<br />

Note<br />

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

compiler.<br />

Example<br />

extern int Function_Attributes_weak_0 (int b) __attribute__ ((weak));<br />

See also<br />

• __weak on page 4-20.<br />

4-36 Copyright © 2007, 2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0348A<br />

Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!