summaryrefslogtreecommitdiff
path: root/nptl/pthread_exit.c
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
commitc62cef023cdcd8349369ef4e0d08290e495659be (patch)
tree5039f207754a42ced241ef75d77c6c3da689f7da /nptl/pthread_exit.c
parent2cfef0b042561ec2a61cab0a1f3a85a28780985d (diff)
downloadglibc-c62cef023cdcd8349369ef4e0d08290e495659be.tar.gz
nptl: Move pthread_exit into libc
The pthread_exit symbol was moved using scripts/move-symbol-to-libc.py. No new symbol version is needed because there was a forwarder. The new tests nptl/tst-pthread_exit-nothreads and nptl/tst-pthread_exit-nothreads-static exercise the scenario that pthread_exit is called without libpthread having been linked in. This is not possible for the generic code, so these tests do not live in sysdeps/pthread for now. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'nptl/pthread_exit.c')
-rw-r--r--nptl/pthread_exit.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/nptl/pthread_exit.c b/nptl/pthread_exit.c
index aed8c12e17..6abf66463e 100644
--- a/nptl/pthread_exit.c
+++ b/nptl/pthread_exit.c
@@ -36,8 +36,11 @@ __pthread_exit (void *value)
__do_cancel ();
}
+libc_hidden_def (__pthread_exit)
weak_alias (__pthread_exit, pthread_exit)
-/* After a thread terminates, __libc_start_main decrements
- __nptl_nthreads defined in pthread_create.c. */
-PTHREAD_STATIC_FN_REQUIRE (__pthread_create)
+/* Ensure that the unwinder is always linked in (the __pthread_unwind
+ reference from __do_cancel is weak). Use ___pthread_unwind_next
+ (three underscores) to produce a strong reference to the same
+ file. */
+PTHREAD_STATIC_FN_REQUIRE (___pthread_unwind_next)