about summary refs log tree commit diff
path: root/nptl
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-05-05 17:15:57 +0200
committerFlorian Weimer <fweimer@redhat.com>2021-05-05 17:19:35 +0200
commit19cc20ef2e8b9e09429741a3108e55c50758a273 (patch)
treeb59c159eb256c08c4546a2c8d095f590ed31d1fd /nptl
parentce0b7961ae400e5aeff28d54dc14955199947b74 (diff)
downloadglibc-19cc20ef2e8b9e09429741a3108e55c50758a273.tar.gz
glibc-19cc20ef2e8b9e09429741a3108e55c50758a273.tar.xz
glibc-19cc20ef2e8b9e09429741a3108e55c50758a273.zip
nptl: Move sem_clockwait into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

A new placeholder version is added at version GLIBC_2.30, to
preserve that version in libpthread.so.0.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
Diffstat (limited to 'nptl')
-rw-r--r--nptl/Makefile2
-rw-r--r--nptl/Versions4
-rw-r--r--nptl/libpthread-compat.c5
-rw-r--r--nptl/sem_clockwait.c15
-rw-r--r--nptl/semaphoreP.h2
5 files changed, 20 insertions, 8 deletions
diff --git a/nptl/Makefile b/nptl/Makefile
index 1337b9e648..66fd90049e 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -150,6 +150,7 @@ routines = \
   pthread_spin_unlock \
   pthread_testcancel \
   pthread_yield \
+  sem_clockwait \
   tpp \
   unwind \
 
@@ -201,7 +202,6 @@ libpthread-routines = \
   pthread_sigqueue \
   pthread_timedjoin \
   pthread_tryjoin \
-  sem_clockwait \
   sem_close \
   sem_destroy \
   sem_getvalue \
diff --git a/nptl/Versions b/nptl/Versions
index e845cbf804..97567b6354 100644
--- a/nptl/Versions
+++ b/nptl/Versions
@@ -172,6 +172,7 @@ libc {
     pthread_mutex_clocklock;
     pthread_rwlock_clockrdlock;
     pthread_rwlock_clockwrlock;
+    sem_clockwait;
   }
   GLIBC_2.32 {
     pthread_attr_getsigmask_np;
@@ -247,6 +248,7 @@ libc {
     pthread_spin_trylock;
     pthread_spin_unlock;
     pthread_testcancel;
+    sem_clockwait;
     thrd_exit;
     tss_create;
     tss_delete;
@@ -421,7 +423,7 @@ libpthread {
   }
 
   GLIBC_2.30 {
-    sem_clockwait;
+    __libpthread_version_placeholder;
   }
 
   GLIBC_2.31 {
diff --git a/nptl/libpthread-compat.c b/nptl/libpthread-compat.c
index 761ca8d41c..7b0427aaed 100644
--- a/nptl/libpthread-compat.c
+++ b/nptl/libpthread-compat.c
@@ -60,3 +60,8 @@ compat_symbol (libpthread, __libpthread_version_placeholder_1,
 compat_symbol (libpthread, __libpthread_version_placeholder_1,
 	       __libpthread_version_placeholder, GLIBC_2_4);
 #endif
+
+#if (SHLIB_COMPAT (libpthread, GLIBC_2_30, GLIBC_2_31))
+compat_symbol (libpthread, __libpthread_version_placeholder_1,
+	       __libpthread_version_placeholder, GLIBC_2_30);
+#endif
diff --git a/nptl/sem_clockwait.c b/nptl/sem_clockwait.c
index 3202b60564..2739799e26 100644
--- a/nptl/sem_clockwait.c
+++ b/nptl/sem_clockwait.c
@@ -23,7 +23,7 @@
 #include "sem_waitcommon.c"
 
 int
-__sem_clockwait64 (sem_t *sem, clockid_t clockid,
+___sem_clockwait64 (sem_t *sem, clockid_t clockid,
                    const struct __timespec64 *abstime)
 {
   /* Check that supplied clockid is one we support, even if we don't end up
@@ -46,15 +46,20 @@ __sem_clockwait64 (sem_t *sem, clockid_t clockid,
     return __new_sem_wait_slow64 ((struct new_sem *) sem, clockid, abstime);
 }
 
-#if __TIMESIZE != 64
-libpthread_hidden_def (__sem_clockwait64)
+#if __TIMESIZE == 64
+strong_alias (___sem_clockwait64, ___sem_clockwait)
+#else /* __TIMESPEC64 != 64 */
+libc_hidden_ver (___sem_clockwait64, __sem_clockwait64)
 
 int
-__sem_clockwait (sem_t *sem, clockid_t clockid, const struct timespec *abstime)
+___sem_clockwait (sem_t *sem, clockid_t clockid, const struct timespec *abstime)
 {
   struct __timespec64 ts64 = valid_timespec_to_timespec64 (*abstime);
 
   return __sem_clockwait64 (sem, clockid, &ts64);
 }
+#endif /* __TIMESPEC64 != 64 */
+versioned_symbol (libc, ___sem_clockwait, sem_clockwait, GLIBC_2_34);
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_30, GLIBC_2_34)
+compat_symbol (libpthread, ___sem_clockwait, sem_clockwait, GLIBC_2_30);
 #endif
-weak_alias (__sem_clockwait, sem_clockwait)
diff --git a/nptl/semaphoreP.h b/nptl/semaphoreP.h
index 1b786149f4..f030f0e4de 100644
--- a/nptl/semaphoreP.h
+++ b/nptl/semaphoreP.h
@@ -54,7 +54,7 @@ extern int __new_sem_getvalue (sem_t *sem, int *sval);
 extern int
 __sem_clockwait64 (sem_t *sem, clockid_t clockid,
                    const struct __timespec64 *abstime);
-libpthread_hidden_proto (__sem_clockwait64)
+libc_hidden_proto (__sem_clockwait64)
 extern int
 __sem_timedwait64 (sem_t *sem, const struct __timespec64 *abstime);
 libpthread_hidden_proto (__sem_timedwait64)