| |||
| Home > Linker steering file command reference > IMPORT | |||
The IMPORT command specifies that a symbol is defined in a shared object at runtime.
A symbol can be imported only if the reference has STV_DEFAULT visibility.
You must use the --override_visibility command-line
option to enable the linker to override symbol visibility to STV_DEFAULT.
IMPORT pattern [ AS replacement_pattern] [ ,pattern [ AS replacement_pattern]]
where:
patternIs a string, optionally including wildcard characters
(either * or ?), that matches zero
or more undefined global symbols. If does
not match any undefined global symbol, the linker ignores the command.
The operand can match only undefined global symbols.pattern
replacement_patternIs a string, optionally including wildcard characters
(either * or ?), to which
the symbol is to be renamed. Wild characters must have a corresponding
wildcard in .
The characters matched by the pattern wildcard
are substituted for the pattern wildcard. replacement_pattern
For example:
IMPORT my_func AS func
imports and renames the undefined symbol my_func as func.
You cannot import a symbol that has been defined in the current
shared object or executable. Only one wildcard character (either * or ?)
is permitted in IMPORT.
The undefined symbol is included in the dynamic symbol table
(as if
given, otherwise as replacement_pattern),
if a dynamic symbol table is present.pattern
The IMPORT command only affects undefined global symbols. Symbols that have been resolved by a shared library are implicitly imported into the dynamic symbol table. The linker ignores any IMPORT directive that targets an implicitly imported symbol.
Using the Linker: