The DATA_SECTION Pragma

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 DATA_SECTION pragma is useful if you have data objects that you want to link into an area separate from the .bss section.

Using the DATA_SECTION pragma has the same effect as using the GCC-style section variable attribute. See Section 5.17.3.

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")

Example 8 through Example 10 demonstrate the use of the DATA_SECTION pragma.