so_import directive
Syntax
so_import symbol [-> alias][,symbol...];
Parameters
| The name that the symbol will be imported as. |
| The name of a symbol to import to the shared object. Two wildcards can be used:
|
Description
Use this directive or the ‑‑so_import linker option to import symbols to the shared object.
The ‑‑so_import linker option can only import a named symbol. This directive makes it possible to import symbols under another name, and wildcards can be used in the name of the symbol.
By default, the linker generates an error if the shared object uses symbols that are not defined in the shared object. Use this option to allow the specified symbols—those symbols will be declared as external in the shared object. This gives you exact control over which symbols that the shared object can access.
To make all imported symbols become external symbols in the shared object, without having to specify them one by one, do not use the so_import directive—just use the ‑‑diag_suppress option to suppress the linker error.
Example
so_import myExternal;
This allows the use of the undefined external myExternal.
so_import myImport -> somebodysExport;
This imports the symbol myImport into the shared object as an undefined external under the name somebodysExport. (somebodysExport is the name used inside the shared object, myImport is the name that everyone outside the shared object sees.)
so_import jpg*;
This allows all undefined externals that begin with jpg.