The CODE_SECTION Pragma

The CODE_SECTION pragma allocates space for the symbol in C, or the next symbol declared in C++, in a section named section name.

The CODE_SECTION pragma is useful if you have code objects that you want to link into an area separate from the .text section.

The CODE_SECTION pragma has the same effect as using the GCC-style section function attribute. See Section 5.17.2.

The syntax of the pragma in C is:

#pragma CODE_SECTION (symbol, "section name")

The syntax of the pragma in C++ is:

#pragma CODE_SECTION ("section name")

The following example demonstrates the use of the CODE_SECTION pragma.