>From 000b86dffecf68c1f479e532dcf4e9a403062521 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 28 Sep 2020 19:30:19 -0400 Subject: [PATCH 4/5] move __abort_lock to its own file and drop pointless weak_alias trick the dummy definition of __abort_lock in sigaction.c was performing exactly the same role that putting the lock in its own source file could and should have been used to achieve. while we're moving it, give it a proper declaration. --- src/exit/abort.c | 2 -- src/exit/abort_lock.c | 3 +++ src/internal/pthread_impl.h | 2 ++ src/signal/sigaction.c | 6 ------ 4 files changed, 5 insertions(+), 8 deletions(-) create mode 100644 src/exit/abort_lock.c diff --git a/src/exit/abort.c b/src/exit/abort.c index e1980f10..f21f458e 100644 --- a/src/exit/abort.c +++ b/src/exit/abort.c @@ -6,8 +6,6 @@ #include "lock.h" #include "ksigaction.h" -hidden volatile int __abort_lock[1]; - _Noreturn void abort(void) { raise(SIGABRT); diff --git a/src/exit/abort_lock.c b/src/exit/abort_lock.c new file mode 100644 index 00000000..3af72c7b --- /dev/null +++ b/src/exit/abort_lock.c @@ -0,0 +1,3 @@ +#include "pthread_impl.h" + +volatile int __abort_lock[1]; diff --git a/src/internal/pthread_impl.h b/src/internal/pthread_impl.h index 23ee566c..21d51be6 100644 --- a/src/internal/pthread_impl.h +++ b/src/internal/pthread_impl.h @@ -197,6 +197,8 @@ hidden void __tl_sync(pthread_t); extern hidden volatile int __thread_list_lock; +extern hidden volatile int __abort_lock[1]; + extern hidden unsigned __default_stacksize; extern hidden unsigned __default_guardsize; diff --git a/src/signal/sigaction.c b/src/signal/sigaction.c index c109bea0..a4737404 100644 --- a/src/signal/sigaction.c +++ b/src/signal/sigaction.c @@ -7,12 +7,6 @@ #include "lock.h" #include "ksigaction.h" -static volatile int dummy_lock[1] = { 0 }; - -extern hidden volatile int __abort_lock[1]; - -weak_alias(dummy_lock, __abort_lock); - static int unmask_done; static unsigned long handler_set[_NSIG/(8*sizeof(long))]; -- 2.21.0