-qdataimported, -qdatalocal, -qtocdata

Category

Optimization and tuning

Pragma equivalent

None.

Purpose

Marks data as local or imported in 64-bit compilations.

Local variables are statically bound with the functions that use them. You can use the -qdatalocal option to name variables that the compiler can assume are local. Alternatively, you can use the -qtocdata option to instruct the compiler to assume all variables are local.

Imported variables are dynamically bound with a shared portion of a library. You can use the -qdataimported option to name variables that the compiler can assume are imported. Alternatively, you can use the -qnotocdata option to instruct the compiler to assume all variables are imported.

Syntax

Read syntax diagramSkip visual syntax diagram
          .-notocdata----------------------------------.     
          | .-dataimported-.                           |     
>>- -q--+-+-+--------------+--+----------------------+-+-+-----><
        |                     |    .-:-------------. |   |   
        |                     |    V               | |   |   
        |                     '-=----variable_name-+-'   |   
        '-+-tocdata-----------------------------+--------'   
          '-datalocal--+----------------------+-'            
                       |    .-:-------------. |              
                       |    V               | |              
                       '-=----variable_name-+-'              

Defaults

-qdataimported or -qnotocdata: The compiler assumes all variables are imported.

Parameters

variable_name
The name of a variable that the compiler should assume is local or imported (depending on the option specified).

C++ only Names must be specified using their mangled names. To obtain C++ mangled names, compile your source to object files only, using the -c compiler option, and use the nm operating system command on the resulting object file. You can also use can the c++filt utility provided by the compiler for a side-by-side listing of source names and mangled names; see Demangling compiled C++ names for details. (See also Name mangling for details on using the extern "C" linkage specifier on declarations to prevent name mangling.)

Specifying -qdataimported without any variable_name is equivalent to -qnotocdata: all variables are assumed to be imported. Specifying -qdatalocal without any variable_name is equivalent to -qtocdata: all variables are assumed to be local.

Usage

These options apply to 64-bit compilations only.

If any variables that are marked as local are actually imported, performance may decrease.

If you specify any of these options with no variables, the last option specified is used. If you specify the same variable name on more than one option specification, the last one is used.

Predefined macros

None.

Related information