diff options
| author | Florian Weimer <fweimer@redhat.com> | 2021-04-21 19:49:51 +0200 |
|---|---|---|
| committer | Florian Weimer <fweimer@redhat.com> | 2021-04-21 19:49:51 +0200 |
| commit | eb29dcde31e7b6f07e7acda161e85d2be69652e4 (patch) | |
| tree | 763b41f1d40d74c8ae84d3c2622ef5709644b820 | |
| parent | 9ce44f46754cc529d54418615862e7e27cc82f09 (diff) | |
| download | glibc-eb29dcde31e7b6f07e7acda161e85d2be69652e4.tar.xz glibc-eb29dcde31e7b6f07e7acda161e85d2be69652e4.zip | |
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.
70 files changed, 350 insertions, 216 deletions
diff --git a/nptl/Makefile b/nptl/Makefile index df3423f5bf..db1b2aad08 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 d32b554c05..b14f76aa41 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 1e57ff20d0..fae0db383c 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 f09757bb26..2c59a1dc84 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 0eeee50834..366883ea3d 100644 --- a/nptl/pthread_rwlock_rdlock.c +++ b/nptl/pthread_rwlock_rdlock.c @@ -20,7 +20,7 @@ |
