The DATA_SECTION pragma allocates space for the symbol in C, or the next symbol declared in C++, in a section named section name.
The syntax of the pragma in C is:
#pragma DATA_SECTION (symbol, "section name") |
The syntax of the pragma in C++ is:
#pragma DATA_SECTION ("section name") |
The DATA_SECTION pragma is useful if you have data objects that you want to link into an area separate from the .bss section. If you allocate a global variable using a DATA_SECTION pragma and you want to reference the variable in C code, you must declare the variable as extern far.
Example 8 through Example 10 demonstrate the use of the DATA_SECTION pragma.