The following variable attributes are supported:
The aligned attribute when used on a variable has the same effect as the DATA_ALIGN pragma. See Section 6.10.6
The blocked and noblocked attributes can be used to control blocking on specific variables, including arrays and structs. See Section 3.11 for reasons to block or unblock variables. These attributes must be used on both the definition and declaration of the variable. It is recommend that these attributes be used in the header file where a variable is declared. For example:
__attribute__((blocked))
extern int my_array[];
__attribute__((noblocked))
extern struct_type my_struct;
The noblocked attribute can also be used to reference data defined in assembly or in a CLA translation unit that is not blocked.
The linker provides a diagnostic message if data access that treats a variable as blocked is attempted on non-blocked data.
The location attribute has the same effect as the LOCATION pragma. See Section 6.10.17.
The noinit and persistent attributes (for EABI only) 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 TMS320C28x 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 6.10.19.
The retain attribute has the same effect as the RETAIN pragma (Section 6.10.24). 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 6.10.7
The used attribute is defined in GCC 4.2 (see https://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 6.10.27).