-qproclocal, -qprocimported, -qprocunknown

Description

Marks functions as local, imported, or unknown.

Syntax

Read syntax diagramSkip visual syntax diagram   .---------------------------------------------------.
   V                                                   |
>>--- -q--+-proclocal------+--+----------------------+-+-------><
          +-noproclocal----+  |    .-:-------------. |
          +-procimported---+  |    V               | |
          +-noprocimported-+  '-=----function_name-+-'
          +-procunknown----+
          '-noprocunknown--'

See also #pragma options.

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.

Notes

Available suboptions are:

Local functions Local functions are statically bound with the functions that call them. Specifying -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 Imported functions are dynamically bound with a shared portion of a library. -qprocimported changes the default to assume that all functions are imported. Specifying -qprocimported=names marks the named functions as imported, where names is a list of function identifiers separated by colons (:). The default is not changed.

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. If marked functions resolve 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 Unknown functions are resolved to either statically or dynamically bound objects during link-editing. Specifying -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.

C++ only In C++ programs, function names must be specified using their mangled names.

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.

Examples

  1. To compile myprogram.c along with the archive library oldprogs.a so that: enter:
    xlc++ myprogram.c oldprogs.a -qprolocal=fun(int):sun()
      -qprocimported=moon():stars(float) -qprocunknown=venus()
  2. The following example shows typical error messages that result when a function marked as local instead resolves to a shared library function.
    int main(void) 
    { 
        printf("Just in function foo1()\n"); 
        printf("Just in function foo1()\n"); 
    }

    ld: 0711-768 WARNING: Object t.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 t.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 t.c

Related information