-qprocimported, -qproclocal, -qprocunknown
Category
Pragma equivalent
#pragma options proclocal, #pragma options procimported, #pragma options procunknown
Purpose
Marks functions as local, imported, or unknown.
Local functions are statically bound with the functions that call them; smaller, faster code is generated for calls to such functions. You can use the -qproclocal option or pragma to name functions that the compiler can assume to be local.
Imported functions are dynamically bound with a shared portion of a library. Code generated for calls to functions marked as imported may be larger, but is faster than the default code sequence generated for functions marked as unknown. You can use the -qprocimported option or pragma to name functions that the compiler can assume to be imported.
Unknown functions are resolved to either statically or dynamically bound objects during linking. You can use the -qprocunkown option or pragma to name functions that the compiler can assume to be unknown.
Syntax
.-procunknown--. >>- -q--+-proclocal----+--+----------------------+------------->< '-procimported-' | .-:-------------. | | V | | '-=----function_name-+-'
Defaults
-qprocunkown: The compiler assumes that all functions' definitions are unknown.
Parameters
- function_name
- The name of a function that the compiler should assume to be local,
imported, or unknown (depending on the option specified). If you do
not specify any function_name, the compiler assumes that all functions
are local, imported, or unknown.
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 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.)
Usage
If any functions that are marked as local resolve to shared library functions, the linker will detect the error and issue warnings. If any of the functions that are marked as imported resolve to statically bound objects, the generated code may be larger and run more slowly than the default code sequence generated for unknown functions.
- Has a local definition.
- Is marked as imported or unknown.
Has the protected, hidden, or internal visibility attribute.
If you specify more than one of these options with no function names, the last option specified is used. If you specify the same function name on more than one option specification, the last one is used.
Predefined macros
None.
Examples
- Functions fun and sun are specified as local
- Functions moon and stars are specified as imported
- Function venus is specified as unknown
xlc myprogram.c oldprogs.a -qprolocal=fun(int):sun()
-qprocimported=moon():stars(float) -qprocunknown=venus()
int main(void)
{
printf("Just in function foo1()\n");
printf("Just in function foo1()\n");
}
a linker error will result. To correct this problem,
you should explicitly mark the called routine as being imported from
a shared object. In this case, you would recompile the source file
and explicitly mark printf as imported by compiling
with -qproclocal -qprocimported=printf.


