4.5.2. __attribute__((at(address)))

This variable attribute enables you to specify the absolute address of a variable.

The variable is placed in its own section, and the section containing the variable is given an appropriate type by the compiler:

Note

This variable attribute is not supported by GNU compilers.

Syntax

__attribute__((at(address)))

Where:

address

is the desired address of the variable.

The keyword __at comes immediately after the variable name.

Restrictions

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

Errors

The linker gives an error message if it is not possible to place a section at a specified address.

Example

const int x1 __attribute__((at(0x10000))) = 10; /* RO */ int x2 __attribute__((at(0x12000))) = 10;       /* RW */int x3 __attribute__((at(0x14000))) = 0;        /* RW, not ZI */int x4 __attribute__((at(0x16000)));            /* ZI */

See also

Copyright © 2007, 2010 ARM Limited. All rights reserved.ARM DUI 0348A
Non-Confidential