From c62cef023cdcd8349369ef4e0d08290e495659be Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Wed, 21 Apr 2021 19:49:50 +0200 Subject: 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 --- nptl/pthread_exit.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'nptl/pthread_exit.c') 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) -- cgit v1.2.3