From 63627246f3e0aae274e04a8ef1edcd05a11afa65 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Mon, 3 May 2021 09:10:57 +0200 Subject: nptl: Move pthread_rwlock_init into libc And __pthread_rwlock_init as a compatibility symbol. __libc_rwlock_init is changed to call __pthread_rwlock_init directly. The symbols were moved using scripts/move-symbol-to-libc.py. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- nptl/Makefile | 2 +- nptl/Versions | 4 ++-- nptl/pthread_rwlock_init.c | 20 +++++++++++++++++--- 3 files changed, 20 insertions(+), 6 deletions(-) (limited to 'nptl') diff --git a/nptl/Makefile b/nptl/Makefile index ee0a0be24d..281c771ebb 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -123,6 +123,7 @@ routines = \ pthread_rwlock_clockrdlock \ pthread_rwlock_clockwrlock \ pthread_rwlock_destroy \ + pthread_rwlock_init \ pthread_rwlock_rdlock \ pthread_rwlock_unlock \ pthread_rwlock_wrlock \ @@ -181,7 +182,6 @@ libpthread-routines = \ pthread_getname \ pthread_join \ pthread_join_common \ - pthread_rwlock_init \ pthread_rwlock_timedrdlock \ pthread_rwlock_timedwrlock \ pthread_rwlock_tryrdlock \ diff --git a/nptl/Versions b/nptl/Versions index 65e94def6f..0e9e3326eb 100644 --- a/nptl/Versions +++ b/nptl/Versions @@ -67,12 +67,14 @@ libc { pthread_mutexattr_gettype; pthread_mutexattr_settype; pthread_rwlock_destroy; + pthread_rwlock_init; pthread_rwlock_rdlock; pthread_rwlock_unlock; pthread_rwlock_wrlock; } GLIBC_2.2 { __pthread_rwlock_destroy; + __pthread_rwlock_init; __pthread_rwlock_rdlock; __pthread_rwlock_unlock; __pthread_rwlock_wrlock; @@ -300,7 +302,6 @@ libpthread { pthread_attr_setstacksize; pthread_create; pthread_getconcurrency; - pthread_rwlock_init; pthread_rwlock_tryrdlock; pthread_rwlock_trywrlock; pthread_rwlockattr_destroy; @@ -329,7 +330,6 @@ libpthread { } GLIBC_2.2 { - __pthread_rwlock_init; __pthread_rwlock_tryrdlock; __pthread_rwlock_trywrlock; pthread_attr_getstack; diff --git a/nptl/pthread_rwlock_init.c b/nptl/pthread_rwlock_init.c index c7d8fef687..db8ebee504 100644 --- a/nptl/pthread_rwlock_init.c +++ b/nptl/pthread_rwlock_init.c @@ -19,7 +19,7 @@ #include "pthreadP.h" #include #include - +#include static const struct pthread_rwlockattr default_rwlockattr = { @@ -30,7 +30,7 @@ static const struct pthread_rwlockattr default_rwlockattr = /* See pthread_rwlock_common.c. */ int -__pthread_rwlock_init (pthread_rwlock_t *rwlock, +___pthread_rwlock_init (pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr) { ASSERT_TYPE_SIZE (pthread_rwlock_t, __SIZEOF_PTHREAD_RWLOCK_T); @@ -55,4 +55,18 @@ __pthread_rwlock_init (pthread_rwlock_t *rwlock, return 0; } -strong_alias (__pthread_rwlock_init, pthread_rwlock_init) +versioned_symbol (libc, ___pthread_rwlock_init, pthread_rwlock_init, + GLIBC_2_34); +libc_hidden_ver (___pthread_rwlock_init, __pthread_rwlock_init) +#ifndef SHARED +strong_alias (___pthread_rwlock_init, __pthread_rwlock_init) +#endif + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_1, GLIBC_2_34) +compat_symbol (libpthread, ___pthread_rwlock_init, pthread_rwlock_init, + GLIBC_2_1); +#endif +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_2, GLIBC_2_34) +compat_symbol (libpthread, ___pthread_rwlock_init, __pthread_rwlock_init, + GLIBC_2_2); +#endif -- cgit v1.2.3