aboutsummaryrefslogtreecommitdiff
path: root/nptl
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-04-21 19:49:51 +0200
committerFlorian Weimer <fweimer@redhat.com>2021-04-21 19:49:51 +0200
commiteb29dcde31e7b6f07e7acda161e85d2be69652e4 (patch)
tree763b41f1d40d74c8ae84d3c2622ef5709644b820 /nptl
parent9ce44f46754cc529d54418615862e7e27cc82f09 (diff)
downloadglibc-eb29dcde31e7b6f07e7acda161e85d2be69652e4.zip
glibc-eb29dcde31e7b6f07e7acda161e85d2be69652e4.tar.gz
glibc-eb29dcde31e7b6f07e7acda161e85d2be69652e4.tar.bz2
nptl: Move rwlock functions with forwarders into libc
The forwarders were only used internally, so new symbol versions are needed. All symbols are moved at once because the forwarders are no-ops if libpthread is not loaded, leading to inconsistencies in case of a partial migration. The symbols __pthread_rwlock_rdlock, __pthread_rwlock_unlock, __pthread_rwlock_wrlock, pthread_rwlock_rdlock, pthread_rwlock_unlock, pthread_rwlock_wrlock have been moved using scripts/move-symbol-to-libc.py. The __ symbol variants are turned into compat symbols, which is why they do not receive a GLIBC_2.34 version.
Diffstat (limited to 'nptl')
-rw-r--r--nptl/Makefile6
-rw-r--r--nptl/Versions17
-rw-r--r--nptl/nptl-init.c3
-rw-r--r--nptl/pthreadP.h4
-rw-r--r--nptl/pthread_rwlock_rdlock.c16
-rw-r--r--nptl/pthread_rwlock_unlock.c18
-rw-r--r--nptl/pthread_rwlock_wrlock.c16
7 files changed, 56 insertions, 24 deletions
diff --git a/nptl/Makefile b/nptl/Makefile
index df3423f..db1b2aa 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -85,6 +85,9 @@ routines = \
pthread_kill \
pthread_mutex_consistent \
pthread_once \
+ pthread_rwlock_rdlock \
+ pthread_rwlock_unlock \
+ pthread_rwlock_wrlock \
pthread_self \
pthread_setcancelstate \
pthread_setcanceltype \
@@ -174,13 +177,10 @@ libpthread-routines = \
pthread_rwlock_clockwrlock \
pthread_rwlock_destroy \
pthread_rwlock_init \
- pthread_rwlock_rdlock \
pthread_rwlock_timedrdlock \
pthread_rwlock_timedwrlock \
pthread_rwlock_tryrdlock \
pthread_rwlock_trywrlock \
- pthread_rwlock_unlock \
- pthread_rwlock_wrlock \
pthread_rwlockattr_destroy \
pthread_rwlockattr_getkind_np \
pthread_rwlockattr_getpshared \
diff --git a/nptl/Versions b/nptl/Versions
index d32b554..b14f76a 100644
--- a/nptl/Versions
+++ b/nptl/Versions
@@ -49,6 +49,14 @@ libc {
}
GLIBC_2.1 {
pthread_attr_init;
+ pthread_rwlock_rdlock;
+ pthread_rwlock_unlock;
+ pthread_rwlock_wrlock;
+ }
+ GLIBC_2.2 {
+ __pthread_rwlock_rdlock;
+ __pthread_rwlock_unlock;
+ __pthread_rwlock_wrlock;
}
GLIBC_2.2.3 {
pthread_getattr_np;
@@ -104,6 +112,9 @@ libc {
pthread_kill;
pthread_mutex_consistent;
pthread_once;
+ pthread_rwlock_rdlock;
+ pthread_rwlock_unlock;
+ pthread_rwlock_wrlock;
pthread_setspecific;
}
GLIBC_PRIVATE {
@@ -205,11 +216,8 @@ libpthread {
pthread_mutexattr_settype;
pthread_rwlock_destroy;
pthread_rwlock_init;
- pthread_rwlock_rdlock;
pthread_rwlock_tryrdlock;
pthread_rwlock_trywrlock;
- pthread_rwlock_unlock;
- pthread_rwlock_wrlock;
pthread_rwlockattr_destroy;
pthread_rwlockattr_getkind_np;
pthread_rwlockattr_getpshared;
@@ -238,11 +246,8 @@ libpthread {
GLIBC_2.2 {
__pthread_rwlock_destroy;
__pthread_rwlock_init;
- __pthread_rwlock_rdlock;
__pthread_rwlock_tryrdlock;
__pthread_rwlock_trywrlock;
- __pthread_rwlock_unlock;
- __pthread_rwlock_wrlock;
__res_state;
pthread_attr_getstack;
pthread_attr_setstack;
diff --git a/nptl/nptl-init.c b/nptl/nptl-init.c
index 1e57ff2..fae0db3 100644
--- a/nptl/nptl-init.c
+++ b/nptl/nptl-init.c
@@ -66,9 +66,6 @@ static const struct pthread_functions pthread_functions =
.ptr_pthread_mutex_init = __pthread_mutex_init,
.ptr_pthread_mutex_lock = __pthread_mutex_lock,
.ptr_pthread_mutex_unlock = __pthread_mutex_unlock,
- .ptr___pthread_rwlock_rdlock = __pthread_rwlock_rdlock,
- .ptr___pthread_rwlock_wrlock = __pthread_rwlock_wrlock,
- .ptr___pthread_rwlock_unlock = __pthread_rwlock_unlock,
.ptr__nptl_setxid = __nptl_setxid,
};
# define ptr_pthread_functions &pthread_functions
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index f09757b..2c59a1d 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -447,8 +447,10 @@ extern int __pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
__attr);
extern int __pthread_rwlock_destroy (pthread_rwlock_t *__rwlock);
extern int __pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock);
+libc_hidden_proto (__pthread_rwlock_rdlock)
extern int __pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock);
extern int __pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock);
+libc_hidden_proto (__pthread_rwlock_wrlock)
extern int __pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock);
extern int __pthread_rwlock_unlock (pthread_rwlock_t *__rwlock);
extern int __pthread_cond_broadcast (pthread_cond_t *cond);
@@ -559,8 +561,6 @@ hidden_proto (__pthread_mutex_destroy)
hidden_proto (__pthread_mutex_lock)
hidden_proto (__pthread_mutex_trylock)
hidden_proto (__pthread_mutex_unlock)
-hidden_proto (__pthread_rwlock_rdlock)
-hidden_proto (__pthread_rwlock_wrlock)
hidden_proto (__pthread_rwlock_unlock)
hidden_proto (__pthread_testcancel)
hidden_proto (__pthread_mutexattr_init)
diff --git a/nptl/pthread_rwlock_rdlock.c b/nptl/pthread_rwlock_rdlock.c
index 0eeee50..366883e 100644
--- a/nptl/pthread_rwlock_rdlock.c
+++ b/nptl/pthread_rwlock_rdlock.c
@@ -20,7 +20,7 @@
/* See pthread_rwlock_common.c. */
int
-__pthread_rwlock_rdlock (pthread_rwlock_t *rwlock)
+___pthread_rwlock_rdlock (pthread_rwlock_t *rwlock)
{
LIBC_PROBE (rdlock_entry, 1, rwlock);
@@ -28,6 +28,16 @@ __pthread_rwlock_rdlock (pthread_rwlock_t *rwlock)
LIBC_PROBE (rdlock_acquire_read, 1, rwlock);
return result;
}
+versioned_symbol (libc, ___pthread_rwlock_rdlock, pthread_rwlock_rdlock,
+ GLIBC_2_34);
+strong_alias (___pthread_rwlock_rdlock, __pthread_rwlock_rdlock)
+libc_hidden_ver (___pthread_rwlock_rdlock, __pthread_rwlock_rdlock)
-weak_alias (__pthread_rwlock_rdlock, pthread_rwlock_rdlock)
-hidden_def (__pthread_rwlock_rdlock)
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_1, GLIBC_2_34)
+compat_symbol (libpthread, ___pthread_rwlock_rdlock, pthread_rwlock_rdlock,
+ GLIBC_2_1);
+#endif
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_2, GLIBC_2_34)
+compat_symbol (libpthread, ___pthread_rwlock_rdlock, __pthread_rwlock_rdlock,
+ GLIBC_2_2);
+#endif
diff --git a/nptl/pthread_rwlock_unlock.c b/nptl/pthread_rwlock_unlock.c
index 356d63a..6c0da97 100644
--- a/nptl/pthread_rwlock_unlock.c
+++ b/nptl/pthread_rwlock_unlock.c
@@ -27,7 +27,7 @@
/* See pthread_rwlock_common.c for an overview. */
int
-__pthread_rwlock_unlock (pthread_rwlock_t *rwlock)
+___pthread_rwlock_unlock (pthread_rwlock_t *rwlock)
{
LIBC_PROBE (rwlock_unlock, 1, rwlock);
@@ -43,6 +43,16 @@ __pthread_rwlock_unlock (pthread_rwlock_t *rwlock)
__pthread_rwlock_rdunlock (rwlock);
return 0;
}
-
-weak_alias (__pthread_rwlock_unlock, pthread_rwlock_unlock)
-hidden_def (__pthread_rwlock_unlock)
+versioned_symbol (libc, ___pthread_rwlock_unlock, pthread_rwlock_unlock,
+ GLIBC_2_34);
+strong_alias (___pthread_rwlock_unlock, __pthread_rwlock_unlock)
+libc_hidden_ver (___pthread_rwlock_unlock, __pthread_rwlock_unlock)
+
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_1, GLIBC_2_34)
+compat_symbol (libpthread, ___pthread_rwlock_unlock, pthread_rwlock_unlock,
+ GLIBC_2_1);
+#endif
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_2, GLIBC_2_34)
+compat_symbol (libpthread, ___pthread_rwlock_unlock, __pthread_rwlock_unlock,
+ GLIBC_2_2);
+#endif
diff --git a/nptl/pthread_rwlock_wrlock.c b/nptl/pthread_rwlock_wrlock.c
index 98882a8..be20618 100644
--- a/nptl/pthread_rwlock_wrlock.c
+++ b/nptl/pthread_rwlock_wrlock.c
@@ -20,7 +20,7 @@
/* See pthread_rwlock_common.c. */
int
-__pthread_rwlock_wrlock (pthread_rwlock_t *rwlock)
+___pthread_rwlock_wrlock (pthread_rwlock_t *rwlock)
{
LIBC_PROBE (wrlock_entry, 1, rwlock);
@@ -28,6 +28,16 @@ __pthread_rwlock_wrlock (pthread_rwlock_t *rwlock)
LIBC_PROBE (wrlock_acquire_write, 1, rwlock);
return result;
}
+versioned_symbol (libc, ___pthread_rwlock_wrlock, pthread_rwlock_wrlock,
+ GLIBC_2_34);
+strong_alias (___pthread_rwlock_wrlock, __pthread_rwlock_wrlock)
+libc_hidden_ver (___pthread_rwlock_wrlock, __pthread_rwlock_wrlock)
-weak_alias (__pthread_rwlock_wrlock, pthread_rwlock_wrlock)
-hidden_def (__pthread_rwlock_wrlock)
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_1, GLIBC_2_34)
+compat_symbol (libpthread, ___pthread_rwlock_wrlock, pthread_rwlock_wrlock,
+ GLIBC_2_1);
+#endif
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_2, GLIBC_2_34)
+compat_symbol (libpthread, ___pthread_rwlock_wrlock, __pthread_rwlock_wrlock,
+ GLIBC_2_2);
+#endif