diff options
author | Florian Weimer <fweimer@redhat.com> | 2021-05-03 08:12:11 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2021-05-03 08:15:22 +0200 |
commit | f44c9a24edf0dff4fd76562975533d58c1cd6dd4 (patch) | |
tree | 196eb57d4feb0faca29e34dbb413c76cb4c761b6 /nptl | |
parent | 17b67416c5ea65507c9b32aec1928afc88569eb2 (diff) | |
download | glibc-f44c9a24edf0dff4fd76562975533d58c1cd6dd4.tar.gz glibc-f44c9a24edf0dff4fd76562975533d58c1cd6dd4.tar.xz glibc-f44c9a24edf0dff4fd76562975533d58c1cd6dd4.zip |
nptl: Move mtx_init into libc
The symbol was moved using scripts/move-symbol-to-libc.py. The calls to __pthread_mutex_init, __pthread_mutexattr_init, __pthread_mutexattr_settype are now private and no longer need to be exported. This allows the removal of the newly added GLIBC_2.34 symbol versions for those functions. Also clean up some weak declarations in <libc-lockP.h> for these functions. They are not needed and potentially incorrect for static linking of mtx_init. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'nptl')
-rw-r--r-- | nptl/Versions | 6 | ||||
-rw-r--r-- | nptl/pthreadP.h | 2 | ||||
-rw-r--r-- | nptl/pthread_mutex_init.c | 8 | ||||
-rw-r--r-- | nptl/pthread_mutexattr_init.c | 6 | ||||
-rw-r--r-- | nptl/pthread_mutexattr_settype.c | 6 |
5 files changed, 17 insertions, 11 deletions
diff --git a/nptl/Versions b/nptl/Versions index 939bed94e9..ccba2ba980 100644 --- a/nptl/Versions +++ b/nptl/Versions @@ -134,6 +134,7 @@ libc { cnd_timedwait; cnd_wait; mtx_destroy; + mtx_init; thrd_current; thrd_equal; thrd_sleep; @@ -155,11 +156,8 @@ libc { __pthread_cleanup_routine; __pthread_getspecific; __pthread_key_create; - __pthread_mutex_init; __pthread_mutex_lock; __pthread_mutex_unlock; - __pthread_mutexattr_init; - __pthread_mutexattr_settype; __pthread_setspecific; call_once; cnd_broadcast; @@ -169,6 +167,7 @@ libc { cnd_timedwait; cnd_wait; mtx_destroy; + mtx_init; pthread_cond_clockwait; pthread_condattr_getclock; pthread_condattr_getpshared; @@ -381,7 +380,6 @@ libpthread { # C11 thread symbols. GLIBC_2.28 { - mtx_init; mtx_lock; mtx_timedlock; mtx_trylock; diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h index db8983c711..3b070ee10d 100644 --- a/nptl/pthreadP.h +++ b/nptl/pthreadP.h @@ -411,8 +411,10 @@ extern int __pthread_mutex_unlock_usercnt (pthread_mutex_t *__mutex, int __decr); libc_hidden_proto (__pthread_mutex_unlock_usercnt) extern int __pthread_mutexattr_init (pthread_mutexattr_t *attr); +libc_hidden_proto (__pthread_mutexattr_init) extern int __pthread_mutexattr_destroy (pthread_mutexattr_t *attr); extern int __pthread_mutexattr_settype (pthread_mutexattr_t *attr, int kind); +libc_hidden_proto (__pthread_mutexattr_settype) extern int __pthread_attr_destroy (pthread_attr_t *attr); libc_hidden_proto (__pthread_attr_destroy) extern int __pthread_attr_getdetachstate (const pthread_attr_t *attr, diff --git a/nptl/pthread_mutex_init.c b/nptl/pthread_mutex_init.c index 328f7b08a7..d9d7523ea4 100644 --- a/nptl/pthread_mutex_init.c +++ b/nptl/pthread_mutex_init.c @@ -151,11 +151,13 @@ ___pthread_mutex_init (pthread_mutex_t *mutex, return 0; } -versioned_symbol (libpthread, ___pthread_mutex_init, __pthread_mutex_init, - GLIBC_2_34); -libc_hidden_ver (___pthread_mutex_init, __pthread_mutex_init) versioned_symbol (libpthread, ___pthread_mutex_init, pthread_mutex_init, GLIBC_2_0); +libc_hidden_ver (___pthread_mutex_init, __pthread_mutex_init) +#ifndef SHARED +strong_alias (___pthread_mutex_init, __pthread_mutex_init) +#endif + #if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_34) compat_symbol (libpthread, ___pthread_mutex_init, __pthread_mutex_init, GLIBC_2_0); diff --git a/nptl/pthread_mutexattr_init.c b/nptl/pthread_mutexattr_init.c index ca0c5e94dd..bb41fa169c 100644 --- a/nptl/pthread_mutexattr_init.c +++ b/nptl/pthread_mutexattr_init.c @@ -39,8 +39,10 @@ ___pthread_mutexattr_init (pthread_mutexattr_t *attr) } versioned_symbol (libc, ___pthread_mutexattr_init, pthread_mutexattr_init, GLIBC_2_34); -versioned_symbol (libc, ___pthread_mutexattr_init, - __pthread_mutexattr_init, GLIBC_2_34); +libc_hidden_ver (___pthread_mutexattr_init, __pthread_mutexattr_init) +#ifndef SHARED +strong_alias (___pthread_mutexattr_init, __pthread_mutexattr_init) +#endif #if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_34) compat_symbol (libpthread, ___pthread_mutexattr_init, diff --git a/nptl/pthread_mutexattr_settype.c b/nptl/pthread_mutexattr_settype.c index df03def8bd..fb8d66c5ea 100644 --- a/nptl/pthread_mutexattr_settype.c +++ b/nptl/pthread_mutexattr_settype.c @@ -41,8 +41,10 @@ ___pthread_mutexattr_settype (pthread_mutexattr_t *attr, int kind) } versioned_symbol (libc, ___pthread_mutexattr_settype, pthread_mutexattr_settype, GLIBC_2_34); -versioned_symbol (libc, ___pthread_mutexattr_settype, - __pthread_mutexattr_settype, GLIBC_2_34); +libc_hidden_ver (___pthread_mutexattr_settype, __pthread_mutexattr_settype) +#ifndef SHARED +strong_alias (___pthread_mutexattr_settype, __pthread_mutexattr_settype) +#endif #if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_34) compat_symbol (libpthread, ___pthread_mutexattr_settype, |