The EXPORT command specifies that a symbol can be accessed by other shared objects or executables.
Note
A symbol can be exported 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
.
EXPORT
pattern
[ AS replacement_pattern
] [ ,pattern
[ AS replacement_pattern
]]
where:
pattern
is a string, optionally including wildcard characters (either
*
or?
), that matches zero or more defined global symbols. If
does not match any defined global symbol, the linker ignores the command. The operand can match only defined global symbols.pattern
If the symbol is not defined, the linker issues:
Warning: L6331W: No eligible global symbol matches pattern symbol
replacement_pattern
is a string, optionally including wildcard characters (either
*
or?
), to which the defined global symbol is to be renamed. Wild characters must have a corresponding wildcard in
. The characters matched by thepattern
wildcard are substituted for thereplacement_pattern
wildcard.pattern
For example:
EXPORT my_func AS func1
renames and exports the defined symbol
my_func
asfunc1
.
- Concepts
Using the Linker:
- Reference