Developer Guide and Reference

Contents

alloc_section

Allocates one or more variables in the specified section. Controls section attribute specification for variables.

Syntax

#pragma alloc_section
(
var1
,
var2
,
...
,
"r;attribute-list"
)
Arguments
var
A variable that can be used to define a symbol in the section.
"r;attribute-list"
A comma-separated list of attributes; defined values are: '
short
' and '
long
'.
Description
The
alloc_section
pragma places the listed variables,
var1
,
var2
, etc., in the specified section. This pragma controls section attribute specification for variables. The compiler decides whether the variable, as defined by
var1
,
var2
, etc., should go to a "data", "bss", or "rdata" section.
The section name must be enclosed in double quotation marks. It should be previously introduced into the program using
#pragma section
. The list of comma-separated variable names follows the section name after a separating comma.
All listed variables must be defined before this pragma, in the same translation unit and in the same scope. The variables have static storage; their linkage does not matter in C modules, but in C++ modules they are defined with the extern "C" linkage specification.
Example: Using #pragma alloc_section
#pragma alloc_section(var1, "r;short") int var1 = 20; #pragma alloc_section(var2, "r;short") extern int var2;

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804