about summary refs log tree commit diff
path: root/nptl
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-05-17 09:59:14 +0200
committerFlorian Weimer <fweimer@redhat.com>2021-05-17 10:25:11 +0200
commit310e59e64cbc95bff299825b2b7f38b88f82ba4e (patch)
treeab18cc279a1e63dcdc1b79a15e43ce8a2b775c3a /nptl
parente948be4db3ed254b6ba55d5250021f649a9a1c41 (diff)
downloadglibc-310e59e64cbc95bff299825b2b7f38b88f82ba4e.tar.gz
glibc-310e59e64cbc95bff299825b2b7f38b88f82ba4e.tar.xz
glibc-310e59e64cbc95bff299825b2b7f38b88f82ba4e.zip
nptl: Move pthread_getcpuclockid into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

__libpthread_version_placeholder@@GLIBC_2.2 is needed by this change;
the Versions entry for GLIBC_2.2 in libpthread had leftover symbols
due to an error in a previous conflict resolution.  The condition
for the placeholder symbol is complicated because some architectures
have earlier symbols at the GLIBC_2.2 symbol versions, so the
placeholder is not required there (yet).

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
Diffstat (limited to 'nptl')
-rw-r--r--nptl/Makefile2
-rw-r--r--nptl/Versions7
-rw-r--r--nptl/libpthread-compat.c10
-rw-r--r--nptl/pthread_getcpuclockid.c11
4 files changed, 23 insertions, 7 deletions
diff --git a/nptl/Makefile b/nptl/Makefile
index a7c1932332..9c810b2b6c 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -116,6 +116,7 @@ routines = \
   pthread_getattr_default_np \
   pthread_getattr_np \
   pthread_getconcurrency \
+  pthread_getcpuclockid \
   pthread_getschedparam \
   pthread_getspecific \
   pthread_join \
@@ -206,7 +207,6 @@ libpthread-routines = \
   nptl-init \
   pt-interp \
   pthread_create \
-  pthread_getcpuclockid \
   pthread_getname \
   pthread_setaffinity \
   pthread_setname \
diff --git a/nptl/Versions b/nptl/Versions
index c76efffe37..9afbb028f2 100644
--- a/nptl/Versions
+++ b/nptl/Versions
@@ -127,6 +127,7 @@ libc {
     pthread_barrierattr_setpshared;
     pthread_condattr_getpshared;
     pthread_condattr_setpshared;
+    pthread_getcpuclockid;
     pthread_mutex_timedlock;
     pthread_mutexattr_getpshared;
     pthread_mutexattr_setpshared;
@@ -285,6 +286,7 @@ libc {
     pthread_detach;
     pthread_getattr_default_np;
     pthread_getconcurrency;
+    pthread_getcpuclockid;
     pthread_getspecific;
     pthread_join;
     pthread_key_create;
@@ -434,10 +436,7 @@ libpthread {
   }
 
   GLIBC_2.2 {
-    pthread_getcpuclockid;
-    pthread_yield;
-    pthread_rwlock_timedrdlock;
-    pthread_rwlock_timedwrlock;
+    __libpthread_version_placeholder;
   }
 
   GLIBC_2.2.3 {
diff --git a/nptl/libpthread-compat.c b/nptl/libpthread-compat.c
index c828fd8f9e..18069870d1 100644
--- a/nptl/libpthread-compat.c
+++ b/nptl/libpthread-compat.c
@@ -45,6 +45,16 @@ compat_symbol (libpthread, __libpthread_version_placeholder_1,
 	       __libpthread_version_placeholder, GLIBC_2_1_2);
 #endif
 
+/* Do not create the placeholder symbol version if there are other
+   symbols left that keep the version around (because GLIBC_2.0 got
+   promoted to GLIBC_2.2).  */
+#if SHLIB_COMPAT (libpthread, GLIBC_2_2, GLIBC_2_2_3) \
+  && ABI_libpthread_GLIBC_2_2 != ABI_libpthread_GLIBC_2_0 \
+  && ABI_libpthread_GLIBC_2_2 != ABI_libpthread_GLIBC_2_1_3
+compat_symbol (libpthread, __libpthread_version_placeholder_1,
+	       __libpthread_version_placeholder, GLIBC_2_2);
+#endif
+
 #if (SHLIB_COMPAT (libpthread, GLIBC_2_2_3, GLIBC_2_2_4))
 compat_symbol (libpthread, __libpthread_version_placeholder_1,
 	       __libpthread_version_placeholder, GLIBC_2_2_3);
diff --git a/nptl/pthread_getcpuclockid.c b/nptl/pthread_getcpuclockid.c
index ae7122cb5f..0a6656ea4c 100644
--- a/nptl/pthread_getcpuclockid.c
+++ b/nptl/pthread_getcpuclockid.c
@@ -21,10 +21,10 @@
 #include <sys/time.h>
 #include <tls.h>
 #include <kernel-posix-cpu-timers.h>
-
+#include <shlib-compat.h>
 
 int
-pthread_getcpuclockid (pthread_t threadid, clockid_t *clockid)
+__pthread_getcpuclockid (pthread_t threadid, clockid_t *clockid)
 {
   struct pthread *pd = (struct pthread *) threadid;
 
@@ -40,3 +40,10 @@ pthread_getcpuclockid (pthread_t threadid, clockid_t *clockid)
   *clockid = tidclock;
   return 0;
 }
+versioned_symbol (libc, __pthread_getcpuclockid, pthread_getcpuclockid,
+                  GLIBC_2_34);
+
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_2, GLIBC_2_34)
+compat_symbol (libpthread, __pthread_getcpuclockid, pthread_getcpuclockid,
+               GLIBC_2_2);
+#endif