From patchwork Thu Oct 3 10:38:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Newton X-Patchwork-Id: 20770 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f200.google.com (mail-ve0-f200.google.com [209.85.128.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3EF39266EC for ; Thu, 3 Oct 2013 10:38:44 +0000 (UTC) Received: by mail-ve0-f200.google.com with SMTP id oy12sf4938400veb.11 for ; Thu, 03 Oct 2013 03:38:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:date:from:user-agent :mime-version:to:cc:subject:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe:content-type :content-transfer-encoding; bh=p0OK/0pKlQtmztCpc74snoo7aUlHLPD0cmqC0i+5Lno=; b=SO0G+JSV4Qf8q1+D114SS5rWO8rfG8xI/Gt3rtY2RufotznWRz9v0q0qm+ArTdWZ4U pMxNCIRBvjfEFuYsBgRiBdS1a2abij9bBXkKHMJDwiBmIzXI5IbpH/U5q0J/igxENR5D Rr9IfQrqvWuEyAsq37MXd+VvkuipYRn9rVj1RFSUvaTq5orEylTVggJGGxAptsGX5BnD 90L9Mmurn5U5Y1N4VtdMoG213eiidQjaIRlPsnt2I8yhT6q2Yun+KQslCaQVHdkR10Y1 vaQ+QZNK1CPu/1xSxGHTb6lcAWK0S2xjqD68fjEwXOm15R3lyvemeCDYAMecKcYtIrbR fzLw== X-Received: by 10.236.26.202 with SMTP id c50mr6426814yha.14.1380796724043; Thu, 03 Oct 2013 03:38:44 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.0.236 with SMTP id 12ls886338qeh.67.gmail; Thu, 03 Oct 2013 03:38:43 -0700 (PDT) X-Received: by 10.220.16.73 with SMTP id n9mr722032vca.24.1380796723942; Thu, 03 Oct 2013 03:38:43 -0700 (PDT) Received: from mail-vb0-f52.google.com (mail-vb0-f52.google.com [209.85.212.52]) by mx.google.com with ESMTPS id j3si1557229vcf.114.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 03 Oct 2013 03:38:43 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.52 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.52; Received: by mail-vb0-f52.google.com with SMTP id f12so1387561vbg.25 for ; Thu, 03 Oct 2013 03:38:43 -0700 (PDT) X-Gm-Message-State: ALoCoQnmpQYqSq2yJchiQaqSQLKhbVSiMjztFtKZa7jIxpOwtBOJ4Dvzp/Vvzv3O5TQLqaSrJ/ID X-Received: by 10.220.91.16 with SMTP id k16mr1149669vcm.21.1380796723791; Thu, 03 Oct 2013 03:38:43 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp167224vcz; Thu, 3 Oct 2013 03:38:43 -0700 (PDT) X-Received: by 10.180.182.15 with SMTP id ea15mr1878033wic.16.1380796722901; Thu, 03 Oct 2013 03:38:42 -0700 (PDT) Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by mx.google.com with ESMTPS id eb10si5471360wib.55.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 03 Oct 2013 03:38:42 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.178 is neither permitted nor denied by best guess record for domain of will.newton@linaro.org) client-ip=209.85.212.178; Received: by mail-wi0-f178.google.com with SMTP id hn9so2329276wib.11 for ; Thu, 03 Oct 2013 03:38:42 -0700 (PDT) X-Received: by 10.180.73.40 with SMTP id i8mr1785040wiv.37.1380796722462; Thu, 03 Oct 2013 03:38:42 -0700 (PDT) Received: from localhost.localdomain (cpc6-seac21-2-0-cust453.7-2.cable.virginmedia.com. [82.1.113.198]) by mx.google.com with ESMTPSA id c4sm12446563wiz.0.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 03 Oct 2013 03:38:41 -0700 (PDT) Message-ID: <524D4930.6020400@linaro.org> Date: Thu, 03 Oct 2013 11:38:40 +0100 From: Will Newton User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8 MIME-Version: 1.0 To: libc-ports@sourceware.org CC: patches@linaro.org Subject: [PATCH] ARM: Allow building __longjmp as Thumb. X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: will.newton@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.52 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Convert __longjmp code to allow building as Thumb. ports/ChangeLog.arm: 2013-09-25 Will Newton * sysdeps/arm/__longjmp.S (NO_THUMB): Remove define. (__longjmp): Use Thumb supported instructions. * sysdeps/unix/sysv/linux/arm/____longjmp_chk.S (NO_THUMB): Remove define. --- ports/sysdeps/arm/__longjmp.S | 6 +++--- ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ports/sysdeps/arm/__longjmp.S b/ports/sysdeps/arm/__longjmp.S index 2b1f7f4..894c121 100644 --- a/ports/sysdeps/arm/__longjmp.S +++ b/ports/sysdeps/arm/__longjmp.S @@ -16,8 +16,6 @@ License along with the GNU C Library. If not, see . */ -/* ??? Needs more rearrangement for the LDM to handle thumb mode. */ -#define NO_THUMB #include #include #include @@ -28,6 +26,7 @@ ENTRY (__longjmp) mov ip, r0 movs r0, r1 /* get the return value in place */ + it eq moveq r0, #1 /* can't let setjmp() return zero! */ #ifdef CHECK_SP @@ -44,7 +43,8 @@ ENTRY (__longjmp) #ifdef PTR_DEMANGLE PTR_DEMANGLE (fp, a4, a3, a2) ldr a4, [ip], #4 - PTR_DEMANGLE2 (sp, a4, a3) + PTR_DEMANGLE2 (a4, a4, a3) + mov sp, a4 ldr a4, [ip], #4 PTR_DEMANGLE2 (lr, a4, a3) #else diff --git a/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S b/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S index 6ee7a1a..6777ef6 100644 --- a/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S +++ b/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S @@ -15,8 +15,6 @@ License along with the GNU C Library. If not, see . */ -/* ??? Needs more rearrangement for the LDM to handle thumb mode. */ -#define NO_THUMB #include .section .rodata.str1.1,"aMS",%progbits,1