diff options
Diffstat (limited to 'include/libc-symbols.h')
-rw-r--r-- | include/libc-symbols.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/include/libc-symbols.h b/include/libc-symbols.h index 4548e097dc..c2b499ae36 100644 --- a/include/libc-symbols.h +++ b/include/libc-symbols.h @@ -282,19 +282,28 @@ 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(real, name, version) + symbol_version_reference(real, name, version) # define default_symbol_version(real, name, version) \ _default_symbol_version(real, name, version) # ifdef __ASSEMBLER__ -# define _symbol_version(real, name, version) \ - .symver real, name##@##version # define _default_symbol_version(real, name, version) \ .symver real, name##@##@##version # else -# define _symbol_version(real, name, version) \ - __asm__ (".symver " #real "," #name "@" #version) # define _default_symbol_version(real, name, version) \ __asm__ (".symver " #real "," #name "@@" #version) # endif |