Purpose
Generates Position-Independent Code suitable for use in shared libraries.
Syntax

.-nopic-----------------.
>>- -q--+-pic--+--------------+-+------------------------------><
| .-small-. |
'-=--+-large-+-'
Defaults
- -qnopic in 32-bit compilation mode.
- -qpic=small in 64-bit compilation mode.
- -qpic=small when the -qmkshrobj compiler option
is specified.
Parameters
- small
- Instructs the compiler to assume that the size of the Global Offset Table is no larger than 64
Kb.
- large
- Allows the Global Offset Table 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
When -q64 is in effect, -qpic is
enabled and cannot be disabled.
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