From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id AFC9B3888C66; Thu, 28 Sep 2023 17:57:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AFC9B3888C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1695923823; bh=m+RWUsFd8nLFFhvgxbxhdw2ePek6rBZC/OybAg8IOoM=; h=From:To:Subject:Date:From; b=my2SZW8oL63v7mLO0fou2v8UFgNRgC3cDKlnyQoncY/xdzpW1L8PF3RtH5QYLWmkl 22zxxYP+0ACbSuQndSxFt4VQEdqedY04rL7NxXfMltYA/azsOy5pRthTFVPwSSOtFj KSAN0u7DFMKF4IaB4/tBaFX+smeAPyxAIrWqOLro= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] Handle abort call for -fexceptions call X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/clang X-Git-Oldrev: aa1eb10cd092f4348bbd677957fbe367d970cde9 X-Git-Newrev: 30d032f72348ad06261a22429c8435a6b3b21d97 Message-Id: <20230928175703.AFC9B3888C66@sourceware.org> Date: Thu, 28 Sep 2023 17:57:03 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=30d032f72348ad06261a22429c8435a6b3b21d97 commit 30d032f72348ad06261a22429c8435a6b3b21d97 Author: Adhemerval Zanella Date: Fri Apr 1 14:17:07 2022 -0300 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). Diff: --- sysdeps/generic/symbol-hacks.h | 7 +++++++ sysdeps/nptl/lowlevellock.h | 4 ++-- 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 9ca504a619..b76c3aebd2 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