aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-04-01 14:17:07 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2024-02-09 10:29:18 -0300
commitcc520e75eca93e6ae33ef75c046f3c0992439f5a (patch)
tree20d1da8c696d651b47391fc744b84003e6c536d8
parentd064cc70a21fa93d22c5470cb447e02d1b1baf4f (diff)
downloadglibc-cc520e75eca93e6ae33ef75c046f3c0992439f5a.tar
glibc-cc520e75eca93e6ae33ef75c046f3c0992439f5a.tar.gz
glibc-cc520e75eca93e6ae33ef75c046f3c0992439f5a.tar.bz2
glibc-cc520e75eca93e6ae33ef75c046f3c0992439f5a.zip
Handle abort call for -fexceptions call
clang might generate an abort call when cleanup functions (set by __attribute__ ((cleanup)) calls functions not marked as nothrow. We can mitigate by marking some internal functions as __THROW, but it is not possible for functions that issue used-provided callbacks (for instance pthread_once).
-rw-r--r--sysdeps/generic/symbol-hacks.h7
-rw-r--r--sysdeps/nptl/lowlevellock.h4
2 files changed, 9 insertions, 2 deletions
diff --git a/sysdeps/generic/symbol-hacks.h b/sysdeps/generic/symbol-hacks.h
index 1115e4c0a7..560116d575 100644
--- a/sysdeps/generic/symbol-hacks.h
+++ b/sysdeps/generic/symbol-hacks.h
@@ -6,6 +6,13 @@ asm ("memmove = __GI_memmove");
asm ("memset = __GI_memset");
asm ("memcpy = __GI_memcpy");
+/* clang might generate an abort call when cleanup functions (set by
+ __attribute__ ((cleanup)) calls functions not marked as nothrow.
+ We can mitigate by marking some internal functions as __THROW,
+ but it is not possible for functions that issue used-provided
+ callbacks (for instance pthread_once). */
+asm ("abort = __GI_abort");
+
/* Some targets do not use __stack_chk_fail_local. In libc.so,
redirect __stack_chk_fail to a hidden reference
__stack_chk_fail_local, to avoid the PLT reference.
diff --git a/sysdeps/nptl/lowlevellock.h b/sysdeps/nptl/lowlevellock.h
index 1fc4936a6c..4a769b799a 100644
--- a/sysdeps/nptl/lowlevellock.h
+++ b/sysdeps/nptl/lowlevellock.h
@@ -125,9 +125,9 @@ libc_hidden_proto (__lll_lock_wait)
#define lll_cond_lock(futex, private) __lll_cond_lock (&(futex), private)
-extern void __lll_lock_wake_private (int *futex);
+extern void __lll_lock_wake_private (int *futex) __THROW;
libc_hidden_proto (__lll_lock_wake_private)
-extern void __lll_lock_wake (int *futex, int private);
+extern void __lll_lock_wake (int *futex, int private) __THROW;
libc_hidden_proto (__lll_lock_wake)
/* This is an expression rather than a statement even though its value is