-G

Description

Tells the linker to create a shared object enabled for runtime linking.

Syntax

Read syntax diagramSkip visual syntax diagram>>- -G---------------------------------------------------------><

Notes

The compiler will automatically export all global symbols from the shared object unless you specify which symbols to export by using -bE:, -bexport:, -bexpall or -bnoexpall.

If you use -G to create a shared library, the compiler will:

  1. Create an export list containing all global symbols using the CreateExportList script, if you do not specify -bE:, -bexport:, -bexpall or -bnoexpall, You can specify another script with the -tE/-B or -qpath=E: options.
  2. Save the export list, if CreateExportList was used to create the export list and -qexpfile was specified.
  3. Call the linkage editor with the appropriate options and object files to build a shared object.

This is a linkage editor (ld) option. Refer to your operating system documentation for a description of ld command usage and syntax.

Related information