SPNU151W January 1998 – March 2023 66AK2E05 , 66AK2H06 , 66AK2H12 , 66AK2H14 , AM1705 , AM1707 , AM1802 , AM1806 , AM1808 , AM1810 , AM5K2E04 , OMAP-L132 , OMAP-L137 , OMAP-L138 , SM470R1B1M-HT , TMS470R1A288 , TMS470R1A384 , TMS470R1A64 , TMS470R1B1M , TMS470R1B512 , TMS470R1B768
The following variable attributes are supported:
The aligned attribute used on a variable has the same effect as the DATA_ALIGN pragma. See Section 5.11.6
The location attribute has the same effect as the LOCATION pragma. See Section 5.11.17. For example:
__attribute__((location(0x100))) extern struct PERIPH peripheral;
The noinit and persistent attributes apply to the ROM initialization model and allow an application to avoid initializing certain global variables during a reset. The alternative RAM initialization model initializes variables only when the image is loaded; no variables are initialized during a reset. See the "RAM Model vs. ROM Model" section and its subsections in the ARM Assembly Language Tools User's Guide.
The noinit attribute can be
used on uninitialized variables; it prevents those variables from being set to 0
during a reset. The persistent attribute can be used on initialized
variables; it prevents those variables from being initialized during a reset. By
default, variables marked noinit or persistent will be placed in sections named
.TI.noinit
and .TI.persistent
,
respectively. The location of these sections is controlled by the linker command
file. Typically .TI.persistent sections are placed in FRAM for devices that support
FRAM and .TI.noinit sections are placed in RAM. Also see Section 5.11.19.
The packed attribute may be applied to individual fields within a struct or union. The packed attribute is supported on all ARM targets. See the description of the --unaligned_access option for more information on how the compiler accesses unaligned data.
The retain attribute has the same effect as the RETAIN pragma (Section 5.11.27). That is, the section that contains the variable will not be omitted from conditionally linked output even if it is not referenced elsewhere in the application.
The section attribute when used on a variable has the same effect as the DATA_SECTION pragma. See Section 5.11.7
The used attribute is defined in GCC 4.2 (see http://gcc.gnu.org/onlinedocs/gcc-4.2.4/gcc/Variable-Attributes.html#Variable-Attributes).
The weak attribute has the same effect as the WEAK pragma (Section 5.11.32).