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

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

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

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

In particular, variables explicitly initialized to zero are placed in RW not ZI. Such<br />

variables are not candidates for the ZI-to-RW optimization of the compiler.<br />

• Uninitialized variables are placed in a section with type ZI.<br />

Note<br />

This variable attribute is not supported by GNU compilers.<br />

Syntax<br />

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

Where:<br />

address<br />

is the desired address of the variable.<br />

The keyword __at comes immediately after the variable name.<br />

Restrictions<br />

The linker is not always able to place sections produced by the at variable attribute.<br />

Errors<br />

The linker gives an error message if it is not possible to place a section at a specified<br />

address.<br />

Example<br />

const int x1 __attribute__((at(0x10000))) = 10; /* RO */<br />

int x2 __attribute__((at(0x12000))) = 10; /* RW */<br />

int x3 __attribute__((at(0x14000))) = 0; /* RW, not ZI */<br />

int x4 __attribute__((at(0x16000))); /* ZI */<br />

See also<br />

• Using __at sections to place sections at a specific address on page 5-37 in the<br />

Linker <strong>Guide</strong>.<br />

4.5.3 __attribute__((aligned))<br />

The aligned variable attribute specifies a minimum alignment for the variable or<br />

structure field, measured in bytes.<br />

4-42 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!