From patchwork Thu Mar 26 08:55:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vineet Gupta X-Patchwork-Id: 454926 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 38F2514009B for ; Thu, 26 Mar 2015 20:00:32 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 3C53A338AA; Thu, 26 Mar 2015 09:00:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AK9jBBJzzdQX; Thu, 26 Mar 2015 09:00:27 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 3D576338AC; Thu, 26 Mar 2015 09:00:25 +0000 (UTC) X-Original-To: uclibc@lists.busybox.net Delivered-To: uclibc@osuosl.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 3E9341C208B for ; Thu, 26 Mar 2015 09:00:24 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 3AE8FA3617 for ; Thu, 26 Mar 2015 09:00:24 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eD8wd7LMbEXj for ; Thu, 26 Mar 2015 09:00:23 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from smtprelay.synopsys.com (smtprelay4.synopsys.com [198.182.47.9]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 89B72A3616 for ; Thu, 26 Mar 2015 09:00:23 +0000 (UTC) Received: from us02secmta2.synopsys.com (us02secmta2.synopsys.com [10.12.235.98]) by smtprelay.synopsys.com (Postfix) with ESMTP id 1380224E068E; Thu, 26 Mar 2015 02:00:22 -0700 (PDT) Received: from us02secmta2.internal.synopsys.com (us02secmta2.internal.synopsys.com [127.0.0.1]) by us02secmta2.internal.synopsys.com (Service) with ESMTP id 0701555F02; Thu, 26 Mar 2015 02:00:22 -0700 (PDT) Received: from mailhost.synopsys.com (unknown [10.13.184.66]) by us02secmta2.internal.synopsys.com (Service) with ESMTP id D6D6655F14; Thu, 26 Mar 2015 02:00:21 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id C78DA1E5; Thu, 26 Mar 2015 02:00:21 -0700 (PDT) Received: from us01wehtc1.internal.synopsys.com (us01wehtc1.internal.synopsys.com [10.12.239.235]) by mailhost.synopsys.com (Postfix) with ESMTP id B17641E1; Thu, 26 Mar 2015 02:00:21 -0700 (PDT) Received: from IN01WEHTCA.internal.synopsys.com (10.144.199.104) by us01wehtc1.internal.synopsys.com (10.12.239.235) with Microsoft SMTP Server (TLS) id 14.3.195.1; Thu, 26 Mar 2015 01:56:35 -0700 Received: from IN01WEHTCB.internal.synopsys.com (10.144.199.106) by IN01WEHTCA.internal.synopsys.com (10.144.199.103) with Microsoft SMTP Server (TLS) id 14.3.195.1; Thu, 26 Mar 2015 14:26:13 +0530 Received: from vineetg-E7440.internal.synopsys.com (10.12.197.3) by IN01WEHTCB.internal.synopsys.com (10.144.199.243) with Microsoft SMTP Server (TLS) id 14.3.195.1; Thu, 26 Mar 2015 14:26:11 +0530 From: Vineet Gupta To: Subject: [PATCH 3/4] ARC/signal: shield sa_restorer from compiler toggle side-effects Date: Thu, 26 Mar 2015 14:25:36 +0530 Message-ID: <1427360137-18194-4-git-send-email-vgupta@synopsys.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1427360137-18194-1-git-send-email-vgupta@synopsys.com> References: <1427360137-18194-1-git-send-email-vgupta@synopsys.com> MIME-Version: 1.0 X-Originating-IP: [10.12.197.3] Cc: Vineet Gupta , Alexey.Brodkin@synopsys.com, andrew.burgess@embecosm.com X-BeenThere: uclibc@uclibc.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Discussion and development of uClibc \(the embedded C library\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: uclibc-bounces@uclibc.org Sender: "uClibc" when building uClibc with -O0 (DODEBUG build) the default sigrestorer had some extra glue code generated for stack manipulation which was messing up resume from signal path. So annotate the function with -Os so that gcc would only generate the bare min 2 instruction TRAP sequence Reported-and-Debugged-by: Alexey Brodkin Signed-off-by: Vineet Gupta --- libc/sysdeps/linux/arc/sigaction.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libc/sysdeps/linux/arc/sigaction.c b/libc/sysdeps/linux/arc/sigaction.c index 4a4c9e2d0821..3e2f91cd73e8 100644 --- a/libc/sysdeps/linux/arc/sigaction.c +++ b/libc/sysdeps/linux/arc/sigaction.c @@ -13,7 +13,8 @@ /* * Default sigretrun stub if user doesn't specify SA_RESTORER */ -static void __default_rt_sa_restorer(void) +static void __attribute__((noinline, optimize ("-Os"))) +__default_rt_sa_restorer(void) { INTERNAL_SYSCALL_NCS(__NR_rt_sigreturn, , 0); }