From patchwork Thu Aug 29 20:16:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Newton X-Patchwork-Id: 19619 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f71.google.com (mail-qe0-f71.google.com [209.85.128.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D7250246C2 for ; Thu, 29 Aug 2013 20:16:21 +0000 (UTC) Received: by mail-qe0-f71.google.com with SMTP id 1sf1010233qee.6 for ; Thu, 29 Aug 2013 13:16:21 -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=twFyC1EdjOdlhtuuTSQ/+DW6SLjbda4zYDH0jQ6uGrE=; b=lyPn1WyXzmvnnDnryUrLyD33mspCgaFwVhVFrHIzl1y3UcpxFYe05QWekz9f9UxoEI F8XeuFiapAtRNSdXUMfAqqmG4Pxa9htTXCidMsWadDaXUzqD7JglmyvUollwE8TPAnh1 FO8zhQ6XHp4BCqwT83kBipK9IB4302732bZVf6k+93ckAk51f9Hg5ABBU5g9GG95WTIZ 1sj5THIfvZmrWSvMblopFqOk1pQgEGnqw5UddZG2Afs1+9hAGfsuEK7+mFFUiLhXOo0m zl8j+JztaVNMnQ7Gf9xeE8hkq6q5MaeXybff66FntmxZtWKU/CPqnr/axHaXWRgacQTW /qNQ== X-Received: by 10.236.31.228 with SMTP id m64mr1965169yha.5.1377807381187; Thu, 29 Aug 2013 13:16:21 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.24.194 with SMTP id w2ls971898qef.96.gmail; Thu, 29 Aug 2013 13:16:21 -0700 (PDT) X-Received: by 10.220.237.208 with SMTP id kp16mr4671560vcb.4.1377807381064; Thu, 29 Aug 2013 13:16:21 -0700 (PDT) Received: from mail-vb0-f43.google.com (mail-vb0-f43.google.com [209.85.212.43]) by mx.google.com with ESMTPS id he13si8642218veb.7.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 29 Aug 2013 13:16:21 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.43 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.43; Received: by mail-vb0-f43.google.com with SMTP id h11so685586vbh.16 for ; Thu, 29 Aug 2013 13:16:21 -0700 (PDT) X-Gm-Message-State: ALoCoQlpZoeyYVD9Oq+WZoz6u+tm6mCmjX9q3dhZBMLU5dhTYUOyny4WYfjbXz+nhBqUvOdR9x5u X-Received: by 10.220.145.132 with SMTP id d4mr4657302vcv.9.1377807380943; Thu, 29 Aug 2013 13:16:20 -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 u4csp44484vcz; Thu, 29 Aug 2013 13:16:20 -0700 (PDT) X-Received: by 10.15.27.133 with SMTP id p5mr94817eeu.65.1377807379540; Thu, 29 Aug 2013 13:16:19 -0700 (PDT) Received: from mail-ea0-f173.google.com (mail-ea0-f173.google.com [209.85.215.173]) by mx.google.com with ESMTPS id r9si5082782eew.102.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 29 Aug 2013 13:16:19 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.215.173 is neither permitted nor denied by best guess record for domain of will.newton@linaro.org) client-ip=209.85.215.173; Received: by mail-ea0-f173.google.com with SMTP id g10so486491eak.4 for ; Thu, 29 Aug 2013 13:16:19 -0700 (PDT) X-Received: by 10.14.2.199 with SMTP id 47mr6645196eef.57.1377807378941; Thu, 29 Aug 2013 13:16:18 -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 z12sm48971877eev.6.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 29 Aug 2013 13:16:17 -0700 (PDT) Message-ID: <521FAC10.7040104@linaro.org> Date: Thu, 29 Aug 2013 21:16:16 +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 v2] ARM: Fix clone code when built for 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.43 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: , The mov lr, pc instruction will lose the Thumb bit from the return address so use blx lr instead. ports/ChangeLog.arm: 2013-08-29 Will Newton [BZ #15909] * sysdeps/unix/sysv/linux/arm/clone.S (__clone): Use blx instead of mov lr, pc. --- NEWS | 2 +- ports/sysdeps/unix/sysv/linux/arm/clone.S | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) Changes in v2: - Add BZ number - Add NEWS entry diff --git a/NEWS b/NEWS index d3524ff..4fe4b63 100644 --- a/NEWS +++ b/NEWS @@ -10,7 +10,7 @@ Version 2.19 * The following bugs are resolved with this release: 14699, 15522, 15531, 15532, 15736, 15749, 15797, 15867, 15890, 15897, - 15905. + 15905, 15909. * CVE-2013-4237 The readdir_r function could write more than NAME_MAX bytes to the d_name member of struct dirent, or omit the terminating NUL diff --git a/ports/sysdeps/unix/sysv/linux/arm/clone.S b/ports/sysdeps/unix/sysv/linux/arm/clone.S index ce9c2a5..6e74fa7 100644 --- a/ports/sysdeps/unix/sysv/linux/arm/clone.S +++ b/ports/sysdeps/unix/sysv/linux/arm/clone.S @@ -93,8 +93,8 @@ PSEUDO_END (__clone) mov lr, pc bx ip #else - mov lr, pc - ldr pc, [sp], #8 + ldr lr, [sp], #8 + blx lr #endif @ and we are done, passing the return value through r0