| |||
| Home > Linker command-line options > --use_definition_visibility | |||
When the linker combines global symbols the visibility of
the symbol is set with the strictest visibility of the symbols being
combined. Therefore, a symbol reference with STV_HIDDEN visibility
combined with a definition with STV_DEFAULT visibility
results in a definition with STV_HIDDEN visibility.
This option enables the linker to use the visibility of the
definition in preference to the visibility a reference when combining
symbols. For example, a symbol reference with STV_HIDDEN visibility
combined with a definition with STV_DEFAULT visibility
results in a definition with STV_DEFAULT visibility.
This can be useful when you want a reference to not match a Shared Library, but you want to export the definition.
This option is not ELF-compliant and is disabled by default. To create ELF-compliant images, you must use symbol references with the appropriate visibility.