-G

Applicable invocations

Table 1. Invocations that accept the given options
Option xlc (Compiling C) xlC (Compiling C++) xlclang (Compiling C) xlclang++ (Compiling C++)
-G
Note: Only typical invocations are listed in this table. You can refer to the full list of compiler invocations for all basic invocations and their equivalent special invocations.

Category

Output control

Pragma equivalent

None.

Purpose

Generates a shared object enabled for runtime linking.

Syntax

Read syntax diagramSkip visual syntax diagram -G

Usage

The compiler automatically exports all global symbols from the shared object unless you specify which symbols to export by using with the -bE:, -bexport:, or -bnoexpall option. You can also prevent weak symbols from being exported by using the -qnoweakexp option. IBM extensionSymbols that have the hidden or internal visibility attribute are not exported.IBM extension

To save the export list to a file, use the -qexpfile option.

Predefined macros

None.

Related information