aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-04-21 19:49:50 +0200
committerFlorian Weimer <fweimer@redhat.com>2021-04-21 19:49:50 +0200
commit3fec7f18bfcb7044e813a12e19c3c98eb8387e26 (patch)
tree63320bd00d52f0437c4f8676fbff561311dfdb8f
parent4647ce82c733d1453611e35236b786ecd7faf598 (diff)
downloadglibc-3fec7f18bfcb7044e813a12e19c3c98eb8387e26.tar.xz
glibc-3fec7f18bfcb7044e813a12e19c3c98eb8387e26.zip
nptl: Move pthread_once and __pthread_once into libc
And also the fork generation counter, __fork_generation. This eliminates the need for __fork_generation_pointer. call_once remains in libpthread and calls the exported __pthread_once symbol. pthread_once and __pthread_once have been moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
-rw-r--r--nptl/Makefile2
-rw-r--r--nptl/Versions6
-rw-r--r--nptl/libc_pthread_init.c8
-rw-r--r--nptl/nptl-init.c4
-rw-r--r--nptl/pthreadP.h8
-rw-r--r--nptl/pthread_once.c15
-rw-r--r--sysdeps/nptl/fork.c3
-rw-r--r--sysdeps/nptl/libc-lockP.h13
-rw-r--r--sysdeps/nptl/pthread-functions.h1
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/alpha/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/arc/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/arc/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/arm/be/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/arm/be/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/arm/le/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/arm/le/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/csky/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/csky/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/hppa/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/hppa/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/i386/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/i386/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/ia64/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/be/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/le/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/nios2/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/nios2/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/sh/be/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/sh/be/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/sh/le/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/sh/le/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/64/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist2
70 files changed, 152 insertions, 94 deletions
diff --git a/nptl/Makefile b/nptl/Makefile
index b53d32eb9b..323bcc9432 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -77,6 +77,7 @@ routines = \
pthread_getschedparam \
pthread_kill \
pthread_mutex_consistent \
+ pthread_once \
pthread_self \
pthread_setschedparam \
pthread_sigmask \
@@ -162,7 +163,6 @@ libpthread-routines = \
pthread_mutexattr_setpshared \
pthread_mutexattr_setrobust \
pthread_mutexattr_settype \
- pthread_once \
pthread_rwlock_clockrdlock \
pthread_rwlock_clockwrlock \
pthread_rwlock_destroy \
diff --git a/nptl/Versions b/nptl/Versions
index e59a11753e..1a7946cf2f 100644
--- a/nptl/Versions
+++ b/nptl/Versions
@@ -1,5 +1,6 @@
libc {
GLIBC_2.0 {
+ __pthread_once;
_pthread_cleanup_pop;
_pthread_cleanup_pop_restore;
_pthread_cleanup_push;
@@ -32,6 +33,7 @@ libc {
pthread_mutex_init;
pthread_mutex_lock;
pthread_mutex_unlock;
+ pthread_once;
pthread_self;
pthread_setcancelstate;
pthread_setcanceltype;
@@ -84,8 +86,10 @@ libc {
}
GLIBC_2.34 {
__pthread_cleanup_routine;
+ __pthread_once;
pthread_kill;
pthread_mutex_consistent;
+ pthread_once;
}
GLIBC_PRIVATE {
__futex_abstimed_wait64;
@@ -135,7 +139,6 @@ libpthread {
__pthread_mutexattr_destroy;
__pthread_mutexattr_init;
__pthread_mutexattr_settype;
- __pthread_once;
__pthread_setspecific;
_exit;
flockfile;
@@ -164,7 +167,6 @@ libpthread {
pthread_mutexattr_getkind_np;
pthread_mutexattr_init;
pthread_mutexattr_setkind_np;
- pthread_once;
pthread_setcancelstate;
pthread_setcanceltype;
pthread_setspecific;
diff --git a/nptl/libc_pthread_init.c b/nptl/libc_pthread_init.c
index 4de182b4e4..b67a69f9a1 100644
--- a/nptl/libc_pthread_init.c
+++ b/nptl/libc_pthread_init.c
@@ -28,9 +28,6 @@
#include <ldsodefs.h>
-unsigned long int *__fork_generation_pointer;
-
-
#ifdef TLS_MULTIPLE_THREADS_IN_TCB
void
#else
@@ -38,12 +35,9 @@ extern int __libc_multiple_threads attribute_hidden;
int *
#endif
-__libc_pthread_init (unsigned long int *ptr, void (*reclaim) (void),
+__libc_pthread_init (void (*reclaim) (void),
const struct pthread_functions *functions)
{
- /* Remember the pointer to the generation counter in libpthread. */
- __fork_generation_pointer = ptr;
-
/* Called by a child after fork. */
__register_atfork (NULL, NULL, reclaim, NULL);
diff --git a/nptl/nptl-init.c b/nptl/nptl-init.c
index 9decc143cb..b683adb698 100644
--- a/nptl/nptl-init.c
+++ b/nptl/nptl-init.c
@@ -87,7 +87,6 @@ static const struct pthread_functions pthread_functions =
.ptr_pthread_mutex_unlock = __pthread_mutex_unlock,
.ptr___pthread_setcancelstate = __pthread_setcancelstate,
.ptr_pthread_setcanceltype = __pthread_setcanceltype,
- .ptr___pthread_once = __pthread_once,
.ptr___pthread_rwlock_rdlock = __pthread_rwlock_rdlock,
.ptr___pthread_rwlock_wrlock = __pthread_rwlock_wrlock,
.ptr___pthread_rwlock_unlock = __pthread_rwlock_unlock,
@@ -333,8 +332,7 @@ __pthread_initialize_minimal_internal (void)
#ifndef TLS_MULTIPLE_THREADS_IN_TCB
__libc_multiple_threads_ptr =
#endif
- __libc_pthread_init (&__fork_generation, __reclaim_stacks,
- ptr_pthread_functions);
+ __libc_pthread_init (__reclaim_stacks, ptr_pthread_functions);
#if HAVE_TUNABLES
__pthread_tunables_init ();
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index ab0e92f2ca..75fec43fed 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -361,12 +361,10 @@ extern unsigned long int *__fork_generation_pointer attribute_hidden;
/* Register the generation counter in the libpthread with the libc. */
#ifdef TLS_MULTIPLE_THREADS_IN_TCB
-extern void __libc_pthread_init (unsigned long int *ptr,
- void (*reclaim) (void),
+extern void __libc_pthread_init (void (*reclaim) (void),
const struct pthread_functions *functions);
#else
-extern int *__libc_pthread_init (unsigned long int *ptr,
- void (*reclaim) (void),
+extern int *__libc_pthread_init (void (*reclaim) (void),
const struct pthread_functions *functions);
/* Variable set to a nonzero value either if more