about summary refs log tree commit diff
path: root/nptl
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-05-03 09:10:57 +0200
committerFlorian Weimer <fweimer@redhat.com>2021-05-03 09:17:36 +0200
commit504ac633b0213b917a17a4aa98766154a1141925 (patch)
treec4934ce48a1b7786f603718c76885fdc036ec1cd /nptl
parent2cf5b43bcb392af5f056250560d5711b8ba802c4 (diff)
downloadglibc-504ac633b0213b917a17a4aa98766154a1141925.tar.gz
glibc-504ac633b0213b917a17a4aa98766154a1141925.tar.xz
glibc-504ac633b0213b917a17a4aa98766154a1141925.zip
nptl: Move pthread_rwlock_destroy into libc
And __pthread_rwlock_destroy as a compatibility symbol.

rwlocks do not need finalization, so change __libc_rwlock_fini to do
nothing.

The symbols were moved using scripts/move-symbol-to-libc.py.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'nptl')
-rw-r--r--nptl/Makefile2
-rw-r--r--nptl/Versions5
-rw-r--r--nptl/pthread_rwlock_destroy.c16
3 files changed, 17 insertions, 6 deletions
diff --git a/nptl/Makefile b/nptl/Makefile
index c0592dc22c..ee0a0be24d 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -122,6 +122,7 @@ routines = \
   pthread_once \
   pthread_rwlock_clockrdlock \
   pthread_rwlock_clockwrlock \
+  pthread_rwlock_destroy \
   pthread_rwlock_rdlock \
   pthread_rwlock_unlock \
   pthread_rwlock_wrlock \
@@ -180,7 +181,6 @@ libpthread-routines = \
   pthread_getname \
   pthread_join \
   pthread_join_common \
-  pthread_rwlock_destroy \
   pthread_rwlock_init \
   pthread_rwlock_timedrdlock \
   pthread_rwlock_timedwrlock \
diff --git a/nptl/Versions b/nptl/Versions
index d743866e57..65e94def6f 100644
--- a/nptl/Versions
+++ b/nptl/Versions
@@ -66,11 +66,13 @@ libc {
     pthread_attr_init;
     pthread_mutexattr_gettype;
     pthread_mutexattr_settype;
+    pthread_rwlock_destroy;
     pthread_rwlock_rdlock;
     pthread_rwlock_unlock;
     pthread_rwlock_wrlock;
   }
   GLIBC_2.2 {
+    __pthread_rwlock_destroy;
     __pthread_rwlock_rdlock;
     __pthread_rwlock_unlock;
     __pthread_rwlock_wrlock;
@@ -208,6 +210,7 @@ libc {
     pthread_once;
     pthread_rwlock_clockrdlock;
     pthread_rwlock_clockwrlock;
+    pthread_rwlock_destroy;
     pthread_rwlock_rdlock;
     pthread_rwlock_unlock;
     pthread_rwlock_wrlock;
@@ -297,7 +300,6 @@ libpthread {
     pthread_attr_setstacksize;
     pthread_create;
     pthread_getconcurrency;
-    pthread_rwlock_destroy;
     pthread_rwlock_init;
     pthread_rwlock_tryrdlock;
     pthread_rwlock_trywrlock;
@@ -327,7 +329,6 @@ libpthread {
   }
 
   GLIBC_2.2 {
-    __pthread_rwlock_destroy;
     __pthread_rwlock_init;
     __pthread_rwlock_tryrdlock;
     __pthread_rwlock_trywrlock;
diff --git a/nptl/pthread_rwlock_destroy.c b/nptl/pthread_rwlock_destroy.c
index 27725697f7..ebedf298b9 100644
--- a/nptl/pthread_rwlock_destroy.c
+++ b/nptl/pthread_rwlock_destroy.c
@@ -18,14 +18,24 @@
 
 #include "pthreadP.h"
 #include <stap-probe.h>
-
+#include <shlib-compat.h>
 
 int
-__pthread_rwlock_destroy (pthread_rwlock_t *rwlock)
+___pthread_rwlock_destroy (pthread_rwlock_t *rwlock)
 {
   LIBC_PROBE (rwlock_destroy, 1, rwlock);
 
   /* Nothing to be done.  For now.  */
   return 0;
 }
-strong_alias (__pthread_rwlock_destroy, pthread_rwlock_destroy)
+versioned_symbol (libc, ___pthread_rwlock_destroy, pthread_rwlock_destroy,
+                  GLIBC_2_34);
+
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_1, GLIBC_2_34)
+compat_symbol (libpthread, ___pthread_rwlock_destroy, pthread_rwlock_destroy,
+               GLIBC_2_1);
+#endif
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_2, GLIBC_2_34)
+compat_symbol (libpthread, ___pthread_rwlock_destroy, __pthread_rwlock_destroy,
+               GLIBC_2_2);
+#endif