Section
__attribute__((section("name"))) is supported by Arm Compiler 5 and Arm Compiler 6. However,
this attribute might require modification in your code.
When using Arm Compiler 5, section names do not need to be unique. Therefore, you could use the same
section name to create different section types.
Arm Compiler 6 supports multiple sections with the same section name only if you specify a unique ID.
You must ensure that different section types either:
• Have a unique section name.
• Have a unique ID, if they have the same section name.
If you use the same section name, for another section or symbol, without a unique ID, then armclang
integrated assembler merges the sections and gives the merged section the flags of the first section with
that name.
Migrating __attribute__((at(address))) and zero-initialized __attribute__((section("name")))
from Arm®
Compiler 5 to Arm®
Compiler 6
Arm Compiler 5 supports the following attributes, which Arm Compiler 6 does not support:
• __attribute__((at(address))) to specify the absolute address of a function or variable.
• __attribute__((at(address), zero_init)) to specify the absolute address of a zero-initialized
variable.
• __attribute__((section(name), zero_init)) to place a zero-initialized variable in a zeroinitialized
section with the given name.
• __attribute__((zero_init)) to generate an error if the variable has an initializer.
The following table shows migration paths for these features using Arm Compiler 6 supported features:
Table 4-4 Migrating __attribute__((at(address))) and zero-initialized __attribute__((section("name")))
Arm Compiler 5 attribute Arm Compiler 6 attribute Description
__attribute__((at(address))) __attribute__((section(".ARM.__at_address"))) armlink in Arm Compiler 6
still supports the placement of
sections in the form
of .ARM.__at_address
__attribute__((at(address),
zero_init))
__attribute__((section(".bss.ARM.__at_address"))) armlink in Arm Compiler 6
supports the placement of zeroinitialized
sections in the form
of .bss.ARM.__at_address.
The .bss prefix is case
sensitive and must be all
lowercase.
__attribute__((section(name),
zero_init))
__attribute__((section(".bss.name"))) name is a name of your choice.
The .bss prefix is case
sensitive and must be all
lowercase.
__attribute__((zero_init)) Arm Compiler 6 by default places zero-initialized variables in
a .bss section. However, there is no equivalent to generate an
error when you specify an initializer.
Arm Compiler 5 generates an
error if the variable has an
initializer. Otherwise, it places
the zero-initialized variable in
a .bss section.