-G
Applicable invocations
| 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
Pragma equivalent
None.
Purpose
Generates a shared object enabled for runtime linking.
Syntax
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.
Symbols that have the hidden or internal visibility attribute are not
exported.
To save the export list to a file, use the -qexpfile option.
Predefined macros
None.
Related information
- -b
- -brtl
- -qexpfile
- -qmkshrobj (-shared)
- -qweakexp
- -qvisibility (-fvisibility)
- #pragma GCC visibility push, #pragma GCC visibility pop
- Summary of compiler options by functional category: Linking
- "Shared Objects and Runtime Linking" in AIX® General Programming Concepts: Writing and Debugging Programs
- ld in AIX Commands Reference, Volume 3: i through m
