proclocal, procimported, procunknown

Option Type Default Value #pragma options C C++
-qoption proclocal* PROCLOCal, PROCIMPorted, PROCUNKnown x x

Syntax

    -qproclocal | -qproclocal=names 
    -qprocimported | -qprocimported=names 
    -qprocunknown | -qprocunknown=names 
    PROCLOCAL | PROCLOCAL=names 
    PROCIMPORTED | PROCIMPORTED=names 
    PROCUNKNOWN | PROCUNKNOWN=names 

Purpose
Marks functions as local, imported, or unknown.

Default
The default is to assume that all functions whose definition is in the current compilation unit are local (proclocal), and that all other functions are unknown (procunknown). If any functions that are marked as local resolve to shared library functions, the linkage editor will detect the error and issue warnings such as:

ld: 0711-768 WARNING: Object foo.o, section 1, function .printf:
          The branch at address 0x18 is not followed by a recognized no-op
          or TOC-reload instruction.  The unrecognized instruction is 0x83E1004C.

An executable file is produced, but it will not run. The error message indicates that a call to printf in object file foo.o caused the problem. When you have confirmed that the called routine should be imported from a shared object, recompile the source file that caused the warning and explicitly mark printf as imported. For example:

xlC -c -qprocimported=printf foo.c

 

Notes

Local functions Are statically bound with the functions that call them. -qproclocal changes the default to assume that all functions are local. -qproclocal=names marks the named functions as local, where names is a list of function identifiers separated by colons (:). The default is not changed.

Smaller, faster code is generated for calls to functions marked as local.

Imported functions Are dynamically bound with a shared portion of a library. -qprocimported changes the default to assume that all functions are imported. -qprocimported=names marks the named functions as imported, where names is a list of function identifiers separated by colons (:). The default is not changed.

The code generated for calls to functions marked as imported might be larger, but it is faster than the default code sequence generated for functions marked as unknown. If any marked functions are resolved to statically bound objects, the generated code may be larger and run more slowly than the default code sequence generated for unknown functions.

Unknown functions Are resolved to either statically or dynamically bound objects during link-editing. -qprocunknown changes the default to assume that all functions are unknown. -qprocunknown=names marks the named functions as unknown, where names is a list of function identifiers separated by colons (:). The default is not changed.

Conflicts among the procedure-marking options are resolved in the following manner:

Options that list function names The last explicit specification for a particular function name is used.
Options that change the default This form does not specify a name list. The last option specified is the default for functions not explicitly listed in the name-list form.

Example
To compile myprogram.c along with the archive library oldprogs.a so that the functions fun and sun are specified as local, moon and stars are specified as imported, and venus is specified as unknown, enter:

xlC myprogram.c oldprogs.a -qprolocal=fun(int):sun()
  -qprocimported=moon():stars(float) -qprocunknown=venus()


List of Batch Compiler Options and Their Defaults
Options that Define the Compiler Object Code Produced
Equivalent Batch Compile-Link and Incremental Build Options