#pragma options proclocal, #pragma options procimported, #pragma options procunknown
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.
.-procunknown--. >>- -q--+-proclocal----+--+----------------------+------------->< '-procimported-' | .-:-------------. | | V | | '-=----function_name-+-'
-qprocunkown: The compiler assumes that all functions' definitions are unknown.
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.
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.
None.
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.