1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-10-21 14:53:53 +03:00

Add support for referencing specific symbol versions

This is needed for writing tests of compat symbols.
This commit is contained in:
Florian Weimer
2016-08-02 17:18:08 +02:00
parent f690b56979
commit 968dc26df6
3 changed files with 37 additions and 12 deletions

View File

@@ -19,10 +19,10 @@
#ifndef _SHLIB_COMPAT_H
#define _SHLIB_COMPAT_H 1
#ifdef SHARED
# include <abi-versions.h>
#ifdef SHARED
/* The file abi-versions.h (generated by scripts/abi-versions.awk) defines
symbols like `ABI_libm_GLIBC_2_0' for each version set in the source
code for each library. For a version set that is subsumed by a later
@@ -62,11 +62,7 @@
default_symbol_version (local, symbol, name)
# define compat_symbol(lib, local, symbol, version) \
compat_symbol_1 (lib, local, symbol, version)
# define compat_symbol_1(lib, local, symbol, version) \
compat_symbol_2 (local, symbol, VERSION_##lib##_##version)
# define compat_symbol_2(local, symbol, name) \
symbol_version (local, symbol, name)
compat_symbol_reference (lib, local, symbol, version)
#else
@@ -82,6 +78,14 @@
#endif
/* Use compat_symbol_reference for a reference to a specific version
of a symbol. Use compat_symbol to define such a symbol. */
#define compat_symbol_reference(lib, local, symbol, version) \
compat_symbol_reference_1 (lib, local, symbol, version)
#define compat_symbol_reference_1(lib, local, symbol, version) \
compat_symbol_reference_2 (local, symbol, VERSION_##lib##_##version)
#define compat_symbol_reference_2(local, symbol, name) \
symbol_version_reference (local, symbol, name)
# ifdef LINK_OBSOLETE_RPC
/* Export the symbol for both static and dynamic linking. */