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 />

replaced by a reference to the real variable. Where a variable is defined as static, the<br />

variable name is replaced by the alias name and the variable is declared external if the<br />

alias is declared external.<br />

Note<br />

Function names might also be aliased using the corresponding function attribute<br />

__attribute__((alias)).<br />

Syntax<br />

type newname __attribute__((alias("oldname")));<br />

Where:<br />

oldname<br />

newname<br />

is the name of the variable to be aliased<br />

is the new name of the aliased variable.<br />

Example<br />

#include <br />

int oldname = 1;<br />

extern int newname __attribute__((alias("oldname"))); // declaration<br />

void foo(void)<br />

{<br />

printf("newname = %d\n", newname); // prints 1<br />

}<br />

See also<br />

• __attribute__((alias)) on page 4-29.<br />

4.5.2 __attribute__((at(address)))<br />

This variable attribute enables you to specify the absolute address of a variable.<br />

The variable is placed in its own section, and the section containing the variable is given<br />

an appropriate type by the compiler:<br />

• Read-only variables are placed in a section with type RO.<br />

• Initialized read-write variables are placed in a section with type RW.<br />

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

Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!