From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2178) id 664BB3959E66; Mon, 10 May 2021 08:38:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 664BB3959E66 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Florian Weimer To: glibc-cvs@sourceware.org Subject: [glibc] Linux: Explicitly disable cancellation checking in the dynamic loader X-Act-Checkin: glibc X-Git-Author: Florian Weimer X-Git-Refname: refs/heads/master X-Git-Oldrev: 321789f61aa93c14390535aa3cf01846633cd022 X-Git-Newrev: 1c75f89613a0b2428c21c19598559a2d64221cde Message-Id: <20210510083852.664BB3959E66@sourceware.org> Date: Mon, 10 May 2021 08:38:52 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 May 2021 08:38:52 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1c75f89613a0b2428c21c19598559a2d64221cde commit 1c75f89613a0b2428c21c19598559a2d64221cde Author: Florian Weimer Date: Mon May 10 10:31:41 2021 +0200 Linux: Explicitly disable cancellation checking in the dynamic loader Historically, SINGLE_THREAD_P is defined to 1 in the dynamic loader. This has the side effect of disabling cancellation points. In order to enable future use of SINGLE_THREAD_P for single-thread optimizations in the dynamic loader (which becomes important once more code is moved from libpthread), introduce a new NO_SYSCALL_CANCEL_CHECKING macro which is always 1 for IS_IN (rtld), indepdently of the actual SINGLE_THREAD_P value. Tested-by: Carlos O'Donell Reviewed-by: Carlos O'Donell Diff: --- sysdeps/unix/sysdep.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sysdeps/unix/sysdep.h b/sysdeps/unix/sysdep.h index 2fa6bfa135..664d093c05 100644 --- a/sysdeps/unix/sysdep.h +++ b/sysdeps/unix/sysdep.h @@ -88,10 +88,17 @@ #define INLINE_SYSCALL_CALL(...) \ __INLINE_SYSCALL_DISP (__INLINE_SYSCALL, __VA_ARGS__) +#if IS_IN (rtld) +/* All cancellation points are compiled out in the dynamic loader. */ +# define NO_SYSCALL_CANCEL_CHECKING 1 +#else +# define NO_SYSCALL_CANCEL_CHECKING SINGLE_THREAD_P +#endif + #define SYSCALL_CANCEL(...) \ ({ \ long int sc_ret; \ - if (SINGLE_THREAD_P) \ + if (NO_SYSCALL_CANCEL_CHECKING) \ sc_ret = INLINE_SYSCALL_CALL (__VA_ARGS__); \ else \ { \ @@ -107,7 +114,7 @@ #define INTERNAL_SYSCALL_CANCEL(...) \ ({ \ long int sc_ret; \ - if (SINGLE_THREAD_P) \ + if (NO_SYSCALL_CANCEL_CHECKING) \ sc_ret = INTERNAL_SYSCALL_CALL (__VA_ARGS__); \ else \ { \