From patchwork Tue May 20 20:56:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 1036 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx21.g.dreamhost.com (peon2454.g.dreamhost.com [208.113.200.127]) by wilcox.dreamhost.com (Postfix) with ESMTP id D5F23360098 for ; Tue, 20 May 2014 13:57:16 -0700 (PDT) Received: by homiemail-mx21.g.dreamhost.com (Postfix, from userid 14307373) id 9AD801958A94; Tue, 20 May 2014 13:57:16 -0700 (PDT) X-Original-To: glibc@patchwork.siddhesh.in Delivered-To: x14307373@homiemail-mx21.g.dreamhost.com 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 homiemail-mx21.g.dreamhost.com (Postfix) with ESMTPS id E74E21950852 for ; Tue, 20 May 2014 13:57:15 -0700 (PDT) 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:in-reply-to :references; q=dns; s=default; b=psu5jokHC6/OFymckOhmWz3jP48/dDu DoeubH3ywebehKELAROD8b7oqew+MnanHPE3Awhy9oN3RjT/QwxdbiZdEhIkzZGF ++PI/JWtICOkWL1iWrTwsSI4S381Xzp1t6rMytDjxb1/IdWBaGlr3Ix2EkBENMvJ OfKp3iR3Dlfw= 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:in-reply-to :references; s=default; bh=Fxg91weOQ4xkxPyJ02Hf13Tz9VI=; b=pmWR1 64jj8+zxfPA6rqhppxE+I1te0IfVS1YLmYLsZ60ZimUIIP5yNwqvHsckZHD04zCR dvavk/cSFIfT4/xud90ZDf2ALJgM1E+RnAAZlc+U/C5ICUrHpvyUmsUTP8aLS9Mq q/XbZr12Upj0mXuYOxtd3ngOQTSMMh5/V0lJgk= Received: (qmail 18102 invoked by alias); 20 May 2014 20:56:59 -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 17981 invoked by uid 89); 20 May 2014 20:56:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qc0-f178.google.com X-Received: by 10.224.163.8 with SMTP id y8mr13558556qax.46.1400619415094; Tue, 20 May 2014 13:56:55 -0700 (PDT) From: Richard Henderson To: libc-alpha@sourceware.org Cc: marcus.shawcroft@gmail.com, Richard Henderson Subject: [PATCH 2/6] aarch64: Merge __local_multiple_threads offset with memory reference Date: Tue, 20 May 2014 13:56:14 -0700 Message-Id: <1400619378-7262-3-git-send-email-rth@twiddle.net> In-Reply-To: <1400619378-7262-1-git-send-email-rth@twiddle.net> References: <1400619378-7262-1-git-send-email-rth@twiddle.net> X-DH-Original-To: glibc@patchwork.siddhesh.in From: Richard Henderson This also highlights that we'd been loading 64-bits instead of the proper 32-bits. Caught by the linker as a relocation error, since the variable happened to be unaligned for 64-bits. * sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h (SINGLE_THREAD_P): Use the correct width load. Fold an add into the ldr offset. --- sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h b/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h index 0e9bef3..acaed5d 100644 --- a/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h +++ b/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h @@ -163,9 +163,8 @@ extern int __local_multiple_threads attribute_hidden; # else # define SINGLE_THREAD_P \ adrp x16, __local_multiple_threads; \ - add x16, x16, #:lo12:__local_multiple_threads; \ - ldr x16, [x16]; \ - cmp x16, 0; + ldr w16, [x16, #:lo12:__local_multiple_threads]; \ + cmp w16, 0; # endif # else /* There is no __local_multiple_threads for librt, so use the TCB. */ @@ -181,12 +180,12 @@ extern int __local_multiple_threads attribute_hidden; cfi_rel_offset (x30, 8); \ bl __read_tp; \ sub x0, x0, PTHREAD_SIZEOF; \ - ldr x16, [x0, PTHREAD_MULTIPLE_THREADS_OFFSET]; \ + ldr w16, [x0, PTHREAD_MULTIPLE_THREADS_OFFSET]; \ ldp x0, x30, [sp], 16; \ cfi_restore (x0); \ cfi_restore (x30); \ cfi_adjust_cfa_offset (-16); \ - cmp x16, 0 + cmp w16, 0 # define SINGLE_THREAD_P_PIC(x) SINGLE_THREAD_P # endif # endif