-qpic

Category

Object code control

@PROCESS

None.

Purpose

Generates position-independent code suitable for use in shared libraries.

Syntax

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

Defaults

Parameters

small
Instructs the compiler to assume that the size of the Table of Contents (TOC) is no larger than 64 Kb. When -qpic=small is in effect, the compiler generates one instruction for each TOC access.
large
Instructs the compiler to assume that the size of the TOC is larger than 64 Kb. When -qpic=large is in effect, the compiler generates two instructions for each TOC access to enlarge the accessing range. This helps avoid TOC overflow conditions when the Table of Contents is larger than 64 Kb.
Note: To enable -qpic=large, your operating system must be at AIX® 5.3 TL 9 or later:
  • If your operating system is at AIX 5.3 TL 9 to AIX 5.3 TL 12 or AIX 6.1 TL 1 to AIX 6.1 TL 6, ensure that you have installed the latest fix pack from https://www.ibm.com/support/docview.wss?uid=isg1fixinfo118013. Otherwise, an error message might be generated.
  • If your system is at AIX 6.1 TL 7 or later, no action is required.

Specifying -qpic without any suboptions is equivalent to -qpic=small.

Usage

Specifying -qpic=large has the same effect as passing -bbigtoc to ld.

You can use different TOC access options for different compilation units in an application.

Note: For applications whose TOC size is larger than 64K, using -qpic=large can improve performance. However, for applications whose TOC is smaller than 64K, using -qpic=large slows down the program. To decide whether to use -qpic=large, compile the program with -qpic=small first. If an overflow error message is generated, use -qpic=large instead.

Related information