-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
        .-pic-.                     
>>- -q--+-----+--+--------------+------------------------------><
                 |    .-small-. |   
                 '-=--+-large-+-'   

Defaults

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.

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