| |||
| Home > Using scatter files > Using __at sections to place 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 name as follows:
.ARM.__at_address
Where:
addressis the required address of the section. You can
specify this in hexadecimal or decimal. Sections in the form of .ARM.__at_ are
referred to by the abbreviation address__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.
Example 19. Assigning variables to __at sections
; placevariable1in a section called.ARM.__at_0x00008000int variable1 __attribute__((at(0x8000))) = 10; ; placevariable2in a section called.ARM.__at_0x8000int variable2 __attribute__((section(".ARM.__at_0x8000"))) = 10;
When using __attribute__((at(,
the part of the address)))__at section name representing is
normalized to an 8 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. The linker automatically assigns address__at sections
when you use the --autoat command-line option.
This option is the default.
Linker Reference:
Compiler Reference: