<shlib-compat.h>: Support compat_symbol_reference for _ISOMAC

This is helpful for testing compat symbols in cases where _ISOMAC
is activated implicitly due to -DMODULE_NAME=testsuite and cannot
be disabled easily.

(cherry picked from commit 36f6e40884)
This commit is contained in:
Florian Weimer 2021-03-09 21:07:24 +01:00 committed by Aurelien Jarno
parent dae9a8e7f6
commit 4f4452721d

View File

@ -59,6 +59,19 @@
# define IN_MODULE (-1)
#endif
/* Use symbol_version_reference to specify the version a symbol
reference should link to. Use symbol_version or
default_symbol_version for the definition of a versioned symbol.
The difference is that the latter is a no-op in non-shared
builds. */
#ifdef __ASSEMBLER__
# define symbol_version_reference(real, name, version) \
.symver real, name##@##version
#else /* !__ASSEMBLER__ */
# define symbol_version_reference(real, name, version) \
__asm__ (".symver " #real "," #name "@" #version)
#endif
#ifndef _ISOMAC
/* This is defined for the compilation of all C library code. features.h
@ -396,19 +409,6 @@ for linking")
past the last element in SET. */
#define symbol_set_end_p(set, ptr) ((ptr) >= (void *const *) &__stop_##set)
/* Use symbol_version_reference to specify the version a symbol
reference should link to. Use symbol_version or
default_symbol_version for the definition of a versioned symbol.
The difference is that the latter is a no-op in non-shared
builds. */
#ifdef __ASSEMBLER__
# define symbol_version_reference(real, name, version) \
.symver real, name##@##version
#else /* !__ASSEMBLER__ */
# define symbol_version_reference(real, name, version) \
__asm__ (".symver " #real "," #name "@" #version)
#endif
#ifdef SHARED
# define symbol_version(real, name, version) \
symbol_version_reference(real, name, version)