@@ -64,6 +64,32 @@
# define compat_symbol(lib, local, symbol, version) \
compat_symbol_reference (lib, local, symbol, version)
+/* This is similar to compat_symbol, but allows versioning the same symbol
+ to multiple version without incur in multiple symbol definitions. For
+ instance:
+
+ #if (SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_2))
+ compat_symbol_unique (libc, old_foo, GLIBC_2_1_2)
+ #endif
+
+ #if (SHLIB_COMPAT (libpthread, GLIBC_2_2_6, GLIBC_2_3))
+ compat_symbol_unique (libc, old foo, GLIBC_2_2_6)
+ #endif
+
+ Internally it creates an unique strong alias to the input symbol and
+ issue compat_symbol on the alias. */
+# define __compat_symbol_unique_concat(x, y) x ## y
+# define _compat_symbol_unique_concat(x, y) \
+ __compat_symbol_unique_concat (x, y)
+# define _compat_symbol_unique_alias(name) \
+ _compat_symbol_unique_concat (name, __COUNTER__)
+# define _compat_symbol_unique(lib, orig_name, name, version) \
+ strong_alias (orig_name, name) \
+ compat_symbol (libm, name, orig_name, version)
+# define compat_symbol_unique(lib, name, version) \
+ _compat_symbol_unique (lib, name, _compat_symbol_unique_alias (name), \
+ version)
+
#else
/* Not compiling ELF shared libraries at all, so never any old versions. */
@@ -75,6 +101,7 @@
/* This should not appear outside `#if SHLIB_COMPAT (...)'. */
# define compat_symbol(lib, local, symbol, version) ...
+# define compat_symbol_unique(lib, name, version) ...
#endif
@@ -16,8 +16,18 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
+#include <sys/cdefs.h>
#include <shlib-compat.h>
+#ifdef SHARED
+static void
+attribute_compat_text_section
+__attribute_used__
+__libpthread_version_placeholder (void)
+{
+}
+#endif
+
/* This is an unused compatibility symbol definition, to prevent ld
from creating a weak version definition for GLIBC_2.1.2. (__vfork
used to be defined at that version, but it is now provided by libc,
@@ -26,12 +36,12 @@
version or later, the placeholder symbol is not needed because
there are plenty of other symbols which populate those later
versions. */
-#if (SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_2_6))
-void
-attribute_compat_text_section
-__libpthread_version_placeholder (void)
-{
-}
-compat_symbol (libpthread, __libpthread_version_placeholder,
- __libpthread_version_placeholder, GLIBC_2_1_2);
+#if (SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_2))
+compat_symbol_unique (libpthread,
+ __libpthread_version_placeholder, GLIBC_2_1_2);
+#endif
+
+#if (SHLIB_COMPAT (libpthread, GLIBC_2_2_6, GLIBC_2_3))
+compat_symbol_unique (libpthread,
+ __libpthread_version_placeholder, GLIBC_2_2_6);
#endif
@@ -192,6 +192,7 @@
GLIBC_2.2 pwrite64 F
GLIBC_2.2 sem_timedwait F
GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.6 __libpthread_version_placeholder F
GLIBC_2.28 call_once F
GLIBC_2.28 cnd_broadcast F
GLIBC_2.28 cnd_destroy F
@@ -18,7 +18,6 @@
GLIBC_2.2 __libc_allocate_rtsig F
GLIBC_2.2 __libc_current_sigrtmax F
GLIBC_2.2 __libc_current_sigrtmin F
-GLIBC_2.2 __libpthread_version_placeholder F
GLIBC_2.2 __lseek F
GLIBC_2.2 __open F
GLIBC_2.2 __open64 F
@@ -185,6 +184,7 @@
GLIBC_2.2 waitpid F
GLIBC_2.2 write F
GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.6 __libpthread_version_placeholder F
GLIBC_2.28 call_once F
GLIBC_2.28 cnd_broadcast F
GLIBC_2.28 cnd_destroy F
@@ -192,6 +192,7 @@
GLIBC_2.2 pwrite64 F
GLIBC_2.2 sem_timedwait F
GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.6 __libpthread_version_placeholder F
GLIBC_2.28 call_once F
GLIBC_2.28 cnd_broadcast F
GLIBC_2.28 cnd_destroy F
@@ -18,7 +18,6 @@
GLIBC_2.2 __libc_allocate_rtsig F
GLIBC_2.2 __libc_current_sigrtmax F
GLIBC_2.2 __libc_current_sigrtmin F
-GLIBC_2.2 __libpthread_version_placeholder F
GLIBC_2.2 __lseek F
GLIBC_2.2 __open F
GLIBC_2.2 __open64 F
@@ -185,6 +184,7 @@
GLIBC_2.2 waitpid F
GLIBC_2.2 write F
GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.6 __libpthread_version_placeholder F
GLIBC_2.28 call_once F
GLIBC_2.28 cnd_broadcast F
GLIBC_2.28 cnd_destroy F
@@ -192,6 +192,7 @@
GLIBC_2.2 pwrite64 F
GLIBC_2.2 sem_timedwait F
GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.6 __libpthread_version_placeholder F
GLIBC_2.28 call_once F
GLIBC_2.28 cnd_broadcast F
GLIBC_2.28 cnd_destroy F
@@ -117,7 +117,6 @@
GLIBC_2.2 __libc_allocate_rtsig F
GLIBC_2.2 __libc_current_sigrtmax F
GLIBC_2.2 __libc_current_sigrtmin F
-GLIBC_2.2 __libpthread_version_placeholder F
GLIBC_2.2 __open64 F
GLIBC_2.2 __pread64 F
GLIBC_2.2 __pthread_rwlock_destroy F
@@ -192,6 +191,7 @@
GLIBC_2.2 sem_unlink F
GLIBC_2.2 sem_wait F
GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.6 __libpthread_version_placeholder F
GLIBC_2.28 call_once F
GLIBC_2.28 cnd_broadcast F
GLIBC_2.28 cnd_destroy F
@@ -117,7 +117,6 @@
GLIBC_2.2 __libc_allocate_rtsig F
GLIBC_2.2 __libc_current_sigrtmax F
GLIBC_2.2 __libc_current_sigrtmin F
-GLIBC_2.2 __libpthread_version_placeholder F
GLIBC_2.2 __open64 F
GLIBC_2.2 __pread64 F
GLIBC_2.2 __pthread_rwlock_destroy F
@@ -192,6 +191,7 @@
GLIBC_2.2 sem_unlink F
GLIBC_2.2 sem_wait F
GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.6 __libpthread_version_placeholder F
GLIBC_2.28 call_once F
GLIBC_2.28 cnd_broadcast F
GLIBC_2.28 cnd_destroy F
@@ -192,6 +192,7 @@
GLIBC_2.2 pwrite64 F
GLIBC_2.2 sem_timedwait F
GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.6 __libpthread_version_placeholder F
GLIBC_2.28 call_once F
GLIBC_2.28 cnd_broadcast F
GLIBC_2.28 cnd_destroy F
@@ -194,6 +194,7 @@
GLIBC_2.2 pwrite64 F
GLIBC_2.2 sem_timedwait F
GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.6 __libpthread_version_placeholder F
GLIBC_2.28 call_once F
GLIBC_2.28 cnd_broadcast F
GLIBC_2.28 cnd_destroy F
@@ -20,7 +20,6 @@
GLIBC_2.2 __libc_allocate_rtsig F
GLIBC_2.2 __libc_current_sigrtmax F
GLIBC_2.2 __libc_current_sigrtmin F
-GLIBC_2.2 __libpthread_version_placeholder F
GLIBC_2.2 __lseek F
GLIBC_2.2 __open F
GLIBC_2.2 __open64 F
@@ -187,6 +186,7 @@
GLIBC_2.2 waitpid F
GLIBC_2.2 write F
GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.6 __libpthread_version_placeholder F
GLIBC_2.28 call_once F
GLIBC_2.28 cnd_broadcast F
GLIBC_2.28 cnd_destroy F
@@ -18,7 +18,6 @@
GLIBC_2.2 __libc_allocate_rtsig F
GLIBC_2.2 __libc_current_sigrtmax F
GLIBC_2.2 __libc_current_sigrtmin F
-GLIBC_2.2 __libpthread_version_placeholder F
GLIBC_2.2 __lseek F
GLIBC_2.2 __open F
GLIBC_2.2 __open64 F
@@ -185,6 +184,7 @@
GLIBC_2.2 waitpid F
GLIBC_2.2 write F
GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.6 __libpthread_version_placeholder F
GLIBC_2.28 call_once F
GLIBC_2.28 cnd_broadcast F
GLIBC_2.28 cnd_destroy F
@@ -18,7 +18,6 @@
GLIBC_2.2 __libc_allocate_rtsig F
GLIBC_2.2 __libc_current_sigrtmax F
GLIBC_2.2 __libc_current_sigrtmin F
-GLIBC_2.2 __libpthread_version_placeholder F
GLIBC_2.2 __lseek F
GLIBC_2.2 __open F
GLIBC_2.2 __open64 F
@@ -185,6 +184,7 @@
GLIBC_2.2 waitpid F
GLIBC_2.2 write F
GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.6 __libpthread_version_placeholder F
GLIBC_2.28 call_once F
GLIBC_2.28 cnd_broadcast F
GLIBC_2.28 cnd_destroy F
@@ -192,6 +192,7 @@
GLIBC_2.2 pwrite64 F
GLIBC_2.2 sem_timedwait F
GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.6 __libpthread_version_placeholder F
GLIBC_2.28 call_once F
GLIBC_2.28 cnd_broadcast F
GLIBC_2.28 cnd_destroy F
@@ -18,7 +18,6 @@
GLIBC_2.2 __libc_allocate_rtsig F
GLIBC_2.2 __libc_current_sigrtmax F
GLIBC_2.2 __libc_current_sigrtmin F
-GLIBC_2.2 __libpthread_version_placeholder F
GLIBC_2.2 __lseek F
GLIBC_2.2 __open F
GLIBC_2.2 __open64 F
@@ -185,6 +184,7 @@
GLIBC_2.2 waitpid F
GLIBC_2.2 write F
GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.6 __libpthread_version_placeholder F
GLIBC_2.28 call_once F
GLIBC_2.28 cnd_broadcast F
GLIBC_2.28 cnd_destroy F
@@ -18,7 +18,6 @@
GLIBC_2.2.5 __libc_allocate_rtsig F
GLIBC_2.2.5 __libc_current_sigrtmax F
GLIBC_2.2.5 __libc_current_sigrtmin F
-GLIBC_2.2.5 __libpthread_version_placeholder F
GLIBC_2.2.5 __lseek F
GLIBC_2.2.5 __open F
GLIBC_2.2.5 __open64 F
@@ -185,6 +184,7 @@
GLIBC_2.2.5 wait F
GLIBC_2.2.5 waitpid F
GLIBC_2.2.5 write F
+GLIBC_2.2.6 __libpthread_version_placeholder F
GLIBC_2.28 call_once F
GLIBC_2.28 cnd_broadcast F
GLIBC_2.28 cnd_destroy F