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
commit8f72bed1aa42105cd2353333363f2138c7d531a9 (patch)
treeb3413f04a2c2a15ffb90df8909dad5b343b69f65 /nptl
parent9dc21009a47300f62b2a1fd9fec2270a21bd7c3d (diff)
downloadglibc-8f72bed1aa42105cd2353333363f2138c7d531a9.tar.gz
glibc-8f72bed1aa42105cd2353333363f2138c7d531a9.tar.xz
glibc-8f72bed1aa42105cd2353333363f2138c7d531a9.zip
nptl: Move pthread_getattr_default_np into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

A new placeholder symbol __libpthread_version_placeholder@GLIBC_2.18
is needed to keep the GLIBC_2.18 symbol version in libpthread.
The __pthread_getattr_default_np@@GLIBC_PRIVATE export is used
from pthread_create.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
Diffstat (limited to 'nptl')
-rw-r--r--nptl/Makefile2
-rw-r--r--nptl/Versions8
-rw-r--r--nptl/libpthread-compat.c6
-rw-r--r--nptl/pthreadP.h2
-rw-r--r--nptl/pthread_getattr_default_np.c14
5 files changed, 26 insertions, 6 deletions
diff --git a/nptl/Makefile b/nptl/Makefile
index b57b010779..a7c1932332 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -113,6 +113,7 @@ routines = \
   pthread_equal \
   pthread_exit \
   pthread_getaffinity \
+  pthread_getattr_default_np \
   pthread_getattr_np \
   pthread_getconcurrency \
   pthread_getschedparam \
@@ -205,7 +206,6 @@ libpthread-routines = \
   nptl-init \
   pt-interp \
   pthread_create \
-  pthread_getattr_default_np \
   pthread_getcpuclockid \
   pthread_getname \
   pthread_setaffinity \
diff --git a/nptl/Versions b/nptl/Versions
index 6e2def1b4c..c76efffe37 100644
--- a/nptl/Versions
+++ b/nptl/Versions
@@ -189,6 +189,7 @@ libc {
     pthread_mutexattr_setrobust;
   }
   GLIBC_2.18 {
+    pthread_getattr_default_np;
     pthread_setattr_default_np;
   }
   # C11 thread symbols.
@@ -282,6 +283,7 @@ libc {
     pthread_condattr_setclock;
     pthread_condattr_setpshared;
     pthread_detach;
+    pthread_getattr_default_np;
     pthread_getconcurrency;
     pthread_getspecific;
     pthread_join;
@@ -392,6 +394,7 @@ libc {
     __pthread_enable_asynccancel;
     __pthread_force_elision;
     __pthread_getattr_default_np;
+    __pthread_getattr_default_np;
     __pthread_keys;
     __pthread_mutex_unlock_usercnt;
     __pthread_setcancelstate;
@@ -473,7 +476,10 @@ libpthread {
   };
 
   GLIBC_2.18 {
-    pthread_getattr_default_np;
+    __libpthread_version_placeholder;
+  }
+
+  GLIBC_2.19 {
   }
 
   # C11 thread symbols.
diff --git a/nptl/libpthread-compat.c b/nptl/libpthread-compat.c
index bc9ee36df0..c828fd8f9e 100644
--- a/nptl/libpthread-compat.c
+++ b/nptl/libpthread-compat.c
@@ -65,6 +65,12 @@ compat_symbol (libpthread, __libpthread_version_placeholder_1,
 	       __libpthread_version_placeholder, GLIBC_2_4);
 #endif
 
+#if SHLIB_COMPAT (libpthread, GLIBC_2_18, GLIBC_2_19) \
+  && ABI_libpthread_GLIBC_2_18 != ABI_libpthread_GLIBC_2_0
+compat_symbol (libpthread, __libpthread_version_placeholder_1,
+	       __libpthread_version_placeholder, GLIBC_2_18);
+#endif
+
 #if (SHLIB_COMPAT (libpthread, GLIBC_2_30, GLIBC_2_31))
 compat_symbol (libpthread, __libpthread_version_placeholder_1,
 	       __libpthread_version_placeholder, GLIBC_2_30);
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index a4a87cb549..f93806e540 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -413,7 +413,7 @@ extern int __pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
 int __pthread_attr_setaffinity_np (pthread_attr_t *, size_t, const cpu_set_t *);
 libc_hidden_proto (__pthread_attr_setaffinity_np)
 extern __typeof (pthread_getattr_default_np) __pthread_getattr_default_np;
-libpthread_hidden_proto (__pthread_getattr_default_np)
+libc_hidden_proto (__pthread_getattr_default_np)
 extern int __pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
 				  const pthread_rwlockattr_t *__restrict
 				  __attr);
diff --git a/nptl/pthread_getattr_default_np.c b/nptl/pthread_getattr_default_np.c
index c403d1231c..f38f687431 100644
--- a/nptl/pthread_getattr_default_np.c
+++ b/nptl/pthread_getattr_default_np.c
@@ -17,14 +17,22 @@
    <https://www.gnu.org/licenses/>.  */
 
 #include <pthreadP.h>
+#include <shlib-compat.h>
 
 int
-__pthread_getattr_default_np (pthread_attr_t *out)
+___pthread_getattr_default_np (pthread_attr_t *out)
 {
   lll_lock (__default_pthread_attr_lock, LLL_PRIVATE);
   int ret = __pthread_attr_copy (out, &__default_pthread_attr.external);
   lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
   return ret;
 }
-libpthread_hidden_def (__pthread_getattr_default_np)
-weak_alias (__pthread_getattr_default_np, pthread_getattr_default_np)
+versioned_symbol (libc, ___pthread_getattr_default_np,
+                  pthread_getattr_default_np, GLIBC_2_34);
+versioned_symbol (libc, ___pthread_getattr_default_np,
+                  __pthread_getattr_default_np, GLIBC_PRIVATE);
+
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_18, GLIBC_2_34)
+compat_symbol (libpthread, ___pthread_getattr_default_np,
+               pthread_getattr_default_np, GLIBC_2_18);
+#endif