ELF: The unw_getcontext symbol is an alias for __unw_getcontext, a
function written in assembly. Ensure that it is hidden when
LIBUNWIND_HERMETIC_STATIC_LIBRARY is enabled, like the unw_* aliases
for functions written in C++.
Mach-O: For aliases to C++ functions, the weak_import declaration
doesn't seem to have an effect if the unw_* function isn't used in the
TU. If it is used, a .weak_reference is generated, but the assembler
seems to ignore that. assembly.h also outputs .weak_reference, but
frequently with the wrong symbol name (the __USER_LABEL_PREFIX__ is
missing). Make the aliases non-weak instead, like on Windows.
Rename the _LIBUNWIND_DISABLE_VISIBILITY_ANNOTATIONS C define to
_LIBUNWIND_HERMETIC_STATIC_LIBRARY, because a hermetic library needs to
add .hidden/.private_extern for the alias symbols, not just disable the
This change also adds a few SYMBOL_NAME calls that were missing from
the ELF code path in assembly.h.