7.2.6 Placement of __at sections at a specific address

You can give a section a special name that encodes the address where it must be placed.

You specify the special name as follows:
.ARM.__at_address
Where address is the required address of the section, normalized to eight hexadecimal digits. You can specify this in hexadecimal or decimal. Sections in the form of .ARM.__at_address are referred to by the abbreviation __at.
In the compiler, you can assign variables to __at sections by:
  • Explicitly naming the section using the __attribute__((section("name"))).
  • Using the attribute __at that sets up the name of the section for you.
Assigning variables to __at sections in C or C++ code
// place variable1 in a section called .ARM.__AT_0x00008000
int variable1 __attribute__((at(0x8000))) = 10;
// place variable2 in a section called .ARM.__at_0x8000
int variable2 __attribute__((section(".ARM.__at_0x8000"))) = 10;

Note

When using __attribute__((at(address))), the part of the __at section name representing address is normalized to an eight digit hexadecimal number. The name of the section is only significant if you are trying to match the section by name in a scatter file. Without overlays, the linker automatically assigns __at sections when you use the --autoat command-line option. This option is the default. If you are using overlays, then you cannot use --autoat to place __at sections.

Note

The name of the section is only significant if you are trying to match the section by name in a scatter file. Without overlays, the linker automatically assigns __at sections when you use the --autoat command-line option. This option is the default. If you are using overlays, then you cannot use --autoat to place __at sections.
Related concepts
7.2.5 Placement of code and data with __attribute__((section("name")))
7.2.7 Restrictions on placing __at sections
7.2.8 Automatic placement of __at sections
7.2.9 Manual placement of __at sections
7.2.10 Placement of a key in flash memory with an __at section
Related tasks
Placing functions and data at specific addresses
7.2.11 Mapping a structure over a peripheral register with an __at section
Related reference
9.6 --autoat, --no_autoat
Related information
__attribute__((section("name"))) function attribute
__attribute__((at(address))) variable attribute
__attribute__((section("name"))) variable attribute
Non-ConfidentialPDF file icon PDF versionARM DUI0377G
Copyright © 2007, 2008, 2011, 2012, 2014, 2015 ARM. All rights reserved.