Purpose
Generates Position-Independent Code suitable for use in shared libraries.
Syntax
.-pic-.
>>- -q--+-----+--+--------------+------------------------------><
| .-small-. |
'-=--+-large-+-'
Defaults
- -qpic=small
- -qpic=small when the -G or -qmkshrobj compiler option
is specified.
Parameters
- small
- Instructs the compiler to assume that the size of the Table
of Contents is no larger than 64
Kb.
- large
- Allows the Table of Contents to be larger than 64 Kb in
size, allowing more addresses to be stored in the table. Code generated
with this option is usually larger than that generated with -qpic=small.
Specifying -qpic without any suboptions
is equivalent to -qpic=small.
Usage
Specifying -qpic=large has
the same effect as passing -bbigtoc to ld.
Examples
To
compile a shared library
libmylib.so, use the following
commands:
xlc mylib.c -qpic=small -c -o mylib.o
xlc -qmkshrobj mylib -o libmylib.so.1