]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
nptl: Move __pthread_cleanup_upto into libc
authorFlorian Weimer <fweimer@redhat.com>
Wed, 21 Apr 2021 17:49:50 +0000 (19:49 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Wed, 21 Apr 2021 17:49:50 +0000 (19:49 +0200)
This internal symbol is used as part of the longjmp implementation.
Rename the file from nptl/pt-cleanup.c to nptl/pthread_cleanup_upto.c
so that the pt-* files remain restricted to libpthread.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
nptl/Makefile
nptl/Versions
nptl/nptl-init.c
nptl/pthreadP.h
nptl/pthread_cleanup_upto.c [moved from nptl/pt-cleanup.c with 98% similarity]
sysdeps/nptl/jmp-unwind.c
sysdeps/nptl/pthread-functions.h
sysdeps/unix/sysv/linux/s390/jmp-unwind.c

index 81a8f0b1319e341c6f37cbe2e4d800ef5f404df5..b53d32eb9bdbae6100407fdd2bd18607ee8a6991 100644 (file)
@@ -66,6 +66,7 @@ routines = \
   pthread_attr_setscope \
   pthread_attr_setsigmask \
   pthread_attr_setsigmask_internal \
+  pthread_cleanup_upto \
   pthread_cond_destroy \
   pthread_cond_init \
   pthread_condattr_destroy \
@@ -100,7 +101,6 @@ libpthread-routines = \
   old_pthread_cond_signal \
   old_pthread_cond_timedwait \
   old_pthread_cond_wait \
-  pt-cleanup \
   pt-interp \
   pthread_attr_getaffinity \
   pthread_attr_getguardsize \
index 67a49bd3c48ffe3eef89aff9738cd2eeb787dbe7..e59a11753ef22a8270952775ce76b7cf32663b0c 100644 (file)
@@ -108,6 +108,7 @@ libc {
     __pthread_attr_setsigmask_internal;
     __pthread_cleanup_pop;
     __pthread_cleanup_push;
+    __pthread_cleanup_upto;
     __pthread_cond_destroy; # Used by the C11 threads.
     __pthread_cond_init; # Used by the C11 threads.
     __pthread_force_elision;
index 43e2564e59cbe3656306181154732d3e85e83bf3..9decc143cbacd182b607490a82b54167ad678e5e 100644 (file)
@@ -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_cleanup_upto = __pthread_cleanup_upto,
     .ptr___pthread_once = __pthread_once,
     .ptr___pthread_rwlock_rdlock = __pthread_rwlock_rdlock,
     .ptr___pthread_rwlock_wrlock = __pthread_rwlock_wrlock,
index 9cc968222ff7d6dd8ea35a16b6fc2fa72d6897f8..ab0e92f2cab0f93fffafe036cc534145adf153e7 100644 (file)
@@ -332,9 +332,7 @@ extern int __make_stacks_executable (void **stack_endp) attribute_hidden;
 
 /* longjmp handling.  */
 extern void __pthread_cleanup_upto (__jmp_buf target, char *targetframe);
-#if IS_IN (libpthread)
-hidden_proto (__pthread_cleanup_upto)
-#endif
+libc_hidden_proto (__pthread_cleanup_upto)
 
 
 /* Functions with versioned interfaces.  */
similarity index 98%
rename from nptl/pt-cleanup.c
rename to nptl/pthread_cleanup_upto.c
index 541533230d02568e1ddbfe1d88c8fbd7256a7144..89da3e5229351df8b38a056ff4db3a59fc9866f8 100644 (file)
@@ -59,4 +59,4 @@ __pthread_cleanup_upto (__jmp_buf target, char *targetframe)
 
   THREAD_SETMEM (self, cleanup, cbuf);
 }
-hidden_def (__pthread_cleanup_upto)
+libc_hidden_def (__pthread_cleanup_upto)
index a79c792e82cbe05d580cf2c06f0230daa9ba5c69..96c4862c741f5fd31189d89380c3b771f7659c3c 100644 (file)
 #include <setjmp.h>
 #include <stddef.h>
 #include <libc-lock.h>
-
-extern void __pthread_cleanup_upto (__jmp_buf env, char *targetframe);
-#pragma weak __pthread_cleanup_upto
-
+#include <nptl/pthreadP.h>
 
 void
 _longjmp_unwind (jmp_buf env, int val)
 {
-  __libc_ptf_call (__pthread_cleanup_upto, (env->__jmpbuf,
-                                           CURRENT_STACK_FRAME), 0);
+  __pthread_cleanup_upto (env->__jmpbuf, CURRENT_STACK_FRAME);
 }
index 4268084b66b3c061e927fdf038d1a838936b1d00..1bbe6095984228fe3f9158d0dec45ceb74add81d 100644 (file)
@@ -49,7 +49,6 @@ struct pthread_functions
   int (*ptr_pthread_mutex_unlock) (pthread_mutex_t *);
   int (*ptr___pthread_setcancelstate) (int, int *);
   int (*ptr_pthread_setcanceltype) (int, int *);
-  void (*ptr___pthread_cleanup_upto) (__jmp_buf, char *);
   int (*ptr___pthread_once) (pthread_once_t *, void (*) (void));
   int (*ptr___pthread_rwlock_rdlock) (pthread_rwlock_t *);
   int (*ptr___pthread_rwlock_wrlock) (pthread_rwlock_t *);
index 2bdde57ec7e848d8cb4db7f5bfc7d1c474f5e262..8e0399a3e994000321628da6f36da2a524f85267 100644 (file)
 #include <setjmp.h>
 #include <stddef.h>
 #include <libc-lock.h>
-
-extern void __pthread_cleanup_upto (__jmp_buf env, char *targetframe);
-#pragma weak __pthread_cleanup_upto
-
+#include <nptl/pthreadP.h>
 
 void
 _longjmp_unwind (jmp_buf env, int val)
 {
   char local_var;
 
-  __libc_ptf_call (__pthread_cleanup_upto, (env->__jmpbuf, &local_var), 0);
+  __pthread_cleanup_upto (env->__jmpbuf, &local_var);
 }