From patchwork Tue Apr 3 00:38:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 894420 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-91352-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="Ra4ELCk0"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40FVZ93QZcz9s1s for ; Tue, 3 Apr 2018 10:38:25 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; q=dns; s= default; b=xyK/SuQ8YBLe6EZD4p7F+S6DgfTCJYBTtDDGd9xEfJF3ga83AzR6V cL8HI2KiyqAqFl35PJVIfJeie9bpY0MdzTXd7mm2+d1fwrCrSURQIe+Y2/e1vEx9 OiMfV6Mtu0smHndHw/Sa0Evxt6EFjg40lN26+nRpiZvq6sZycmDqOA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; s=default; bh=CbAjp5W5Hy0uB7aNOlex5xvxtmQ=; b=Ra4ELCk0Q3xdHs++csjrwF6WESBt NWCdt0mH/fxuQnykKxFn+sHDEknxFHWBBCC2J0o5i6qp5nwbuF4RZvXPTYK99C4B E+WsgTy3aUSBfLzX/vdDwBknpX2fbc3KcBsDu3xQJobgXQAJRO+/IdlRFtQ2KtEK 1Rgl2htCqHB2N/k= Received: (qmail 54286 invoked by alias); 3 Apr 2018 00:38:19 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 54276 invoked by uid 89); 3 Apr 2018 00:38:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_NEUTRAL autolearn=ham version=3.3.2 spammy= X-HELO: v-zimmta03.u-bordeaux.fr From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault Subject: [hurd,commited] hurd: Avoid more libc.so local PLTs Date: Tue, 3 Apr 2018 00:38:17 +0000 Message-Id: <20180403003817.21337-1-samuel.thibault@ens-lyon.org> X-AV-Checked: ClamAV using ClamSMTP * hurd/catch-signal.c (__hurd_catch_signal): Call __libc_siglongjmp instead if siglongjmp. (hurd_safe_memmove): Call __libc_longjmp instead of longjmp. * hurd/hurdfault.c (faulted): Call __libc_longjmp instead of longjmp. * include/setjmp.h (__libc_siglongjmp, __libc_longjmp): New hidden prototypes. * libio/iolibio.h (_IO_puts): New hidden prototype. * libio/ioputs.c (_IO_puts): New hidden def. * setjmp/longjmp.c (__libc_longjmp, __libc_siglongjmp): New hidden defs. * sysdeps/mach/hurd/sigwait.c (__sigwait): Call __libc_longjmp instead of longjmp. --- ChangeLog | 12 ++++++++++++ hurd/catch-signal.c | 4 ++-- hurd/hurdfault.c | 2 +- include/setjmp.h | 3 +++ libio/iolibio.h | 1 + libio/ioputs.c | 1 + setjmp/longjmp.c | 2 ++ sysdeps/mach/hurd/sigwait.c | 2 +- 8 files changed, 23 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9e2dfa934d..0b54ed73b5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -396,6 +396,18 @@ _hurd_fd_error_signal): Add hidden prototype. [_HURD_FD_H_HIDDEN_DEF] (_hurd_fd_error, _hurd_fd_error_signal): Add hidden def. + * hurd/catch-signal.c (__hurd_catch_signal): Call __libc_siglongjmp + instead if siglongjmp. + (hurd_safe_memmove): Call __libc_longjmp instead of longjmp. + * hurd/hurdfault.c (faulted): Call __libc_longjmp instead of longjmp. + * include/setjmp.h (__libc_siglongjmp, __libc_longjmp): New hidden + prototypes. + * libio/iolibio.h (_IO_puts): New hidden prototype. + * libio/ioputs.c (_IO_puts): New hidden def. + * setjmp/longjmp.c (__libc_longjmp, __libc_siglongjmp): New hidden + defs. + * sysdeps/mach/hurd/sigwait.c (__sigwait): Call __libc_longjmp instead + of longjmp. * sysdeps/mach/hurd/localplt.data: New file. diff --git a/hurd/catch-signal.c b/hurd/catch-signal.c index 56ce86532d..a00ccef4fb 100644 --- a/hurd/catch-signal.c +++ b/hurd/catch-signal.c @@ -32,7 +32,7 @@ __hurd_catch_signal (sigset_t sigset, instance calling hurd_catch_signal again would then dump core. */ sigjmp_buf buf; void throw (int signo, long int sigcode, struct sigcontext *scp) - { siglongjmp (buf, scp->sc_error ?: EGRATUITOUS); } + { __libc_siglongjmp (buf, scp->sc_error ?: EGRATUITOUS); } struct hurd_signal_preemptor preemptor = { @@ -121,7 +121,7 @@ hurd_safe_memmove (void *dest, const void *src, size_t nbytes) { jmp_buf buf; void throw (int signo, long int sigcode, struct sigcontext *scp) - { longjmp (buf, scp->sc_error ?: EGRATUITOUS); } + { __libc_longjmp (buf, scp->sc_error ?: EGRATUITOUS); } struct hurd_signal_preemptor src_preemptor = { diff --git a/hurd/hurdfault.c b/hurd/hurdfault.c index 39a4522811..c42d5e739a 100644 --- a/hurd/hurdfault.c +++ b/hurd/hurdfault.c @@ -152,7 +152,7 @@ faulted (void) __libc_fatal ("BUG: unexpected fault in signal thread\n"); _hurdsig_fault_preemptor.signals = 0; - longjmp (_hurdsig_fault_env, 1); + __libc_longjmp (_hurdsig_fault_env, 1); } static char faultstack[1024]; diff --git a/include/setjmp.h b/include/setjmp.h index 263bc64b3d..682ff4b5a5 100644 --- a/include/setjmp.h +++ b/include/setjmp.h @@ -24,6 +24,9 @@ extern void __libc_siglongjmp (sigjmp_buf env, int val) extern void __libc_longjmp (sigjmp_buf env, int val) __attribute__ ((noreturn)); +libc_hidden_proto (__libc_siglongjmp) +libc_hidden_proto (__libc_longjmp) + libc_hidden_proto (_setjmp) libc_hidden_proto (__sigsetjmp) diff --git a/libio/iolibio.h b/libio/iolibio.h index 69e1c0e699..6c94fe6d62 100644 --- a/libio/iolibio.h +++ b/libio/iolibio.h @@ -41,6 +41,7 @@ extern char* _IO_gets (char*); extern void _IO_perror (const char*) __THROW; extern int _IO_printf (const char*, ...); extern int _IO_puts (const char*); +libc_hidden_proto (_IO_puts) extern int _IO_scanf (const char*, ...); extern void _IO_setbuffer (FILE *, char*, size_t) __THROW; libc_hidden_proto (_IO_setbuffer) diff --git a/libio/ioputs.c b/libio/ioputs.c index 0a80fb7148..c9967c3883 100644 --- a/libio/ioputs.c +++ b/libio/ioputs.c @@ -46,3 +46,4 @@ _IO_puts (const char *str) } weak_alias (_IO_puts, puts) +libc_hidden_def (_IO_puts) diff --git a/setjmp/longjmp.c b/setjmp/longjmp.c index a2a7065a85..0555d6d6b7 100644 --- a/setjmp/longjmp.c +++ b/setjmp/longjmp.c @@ -46,4 +46,6 @@ strong_alias (__libc_siglongjmp, __libc_longjmp) weak_alias (__libc_siglongjmp, _longjmp) weak_alias (__libc_siglongjmp, longjmp) weak_alias (__libc_siglongjmp, siglongjmp) +libc_hidden_def (__libc_longjmp) +libc_hidden_def (__libc_siglongjmp) #endif diff --git a/sysdeps/mach/hurd/sigwait.c b/sysdeps/mach/hurd/sigwait.c index ce17cce895..321ab46d14 100644 --- a/sysdeps/mach/hurd/sigwait.c +++ b/sysdeps/mach/hurd/sigwait.c @@ -59,7 +59,7 @@ __sigwait (const sigset_t *set, int *sig) handler (int sig) { assert (sig == signo); - longjmp (buf, 1); + __libc_longjmp (buf, 1); } wait = __mach_reply_port ();