-qpic

Category

Object code control

Pragma equivalent

None.

Purpose

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

Syntax

Read syntax diagramSkip visual syntax diagram
        .-nopic-----------------.   
>>- -q--+-pic--+--------------+-+------------------------------><
               |    .-small-. |     
               '-=--+-large-+-'     

Defaults

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.

Predefined macros

None.

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

Related information