From patchwork Mon Oct 27 07:59:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 39578 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 44D322118A for ; Mon, 27 Oct 2014 08:02:51 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id h11sf947656wiw.11 for ; Mon, 27 Oct 2014 01:02:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:mailing-list :precedence:list-id:list-unsubscribe:list-subscribe:list-archive :list-post:list-help:sender:delivered-to:from:to:cc:subject:date :message-id:in-reply-to:references:x-original-sender :x-original-authentication-results; bh=5H6Xqr75pNpBn4u9pOhTRBr5tdYIejcZDGhjX3IuhBo=; b=X+st61YCESPqRiHBsq2Ys1fSLdWwm2GokwZVVQrEUJIp9QmsmYitjol9OJZJSQWWNo SKVKXvmUwl+pCHEGO/MP7Pbw/E7M2ac47I0dfxEh9JeFXDY9TrUDVdVnlG0xHaEI+Y2n BVrVSO41Wc0ztbaEmivkArC1v0gVwhSJiHAu+zg5t9T2xyuq6vqAGHw2fumT2X5oMPiW 1CCttwpzC/R0Aqz8mBkV0Mr66LwzEHWmaAl13Y35/INrBQ6qe3OFsEXx2GizATdOz/vD LqMY7a2rVaZ12JbfY9R6OEl5RnVCWK8dWkMvqrTlm/+SOnAyUhnBfkNo8TTVA7WJe5Zr EXOQ== X-Gm-Message-State: ALoCoQkR/8mbjjwkZB+kxPdgwyOwPWYmZVjwHF9HgJHTrvk/U/Ma06N7cmIIegBbOovqBBnMoSmn X-Received: by 10.180.105.74 with SMTP id gk10mr4942915wib.0.1414396970475; Mon, 27 Oct 2014 01:02:50 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.9 with SMTP id p9ls96538lag.80.gmail; Mon, 27 Oct 2014 01:02:50 -0700 (PDT) X-Received: by 10.152.1.42 with SMTP id 10mr22117772laj.4.1414396970279; Mon, 27 Oct 2014 01:02:50 -0700 (PDT) Received: from mail-lb0-x236.google.com (mail-lb0-x236.google.com. [2a00:1450:4010:c04::236]) by mx.google.com with ESMTPS id lj3si18614974lab.112.2014.10.27.01.02.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 Oct 2014 01:02:50 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::236 as permitted sender) client-ip=2a00:1450:4010:c04::236; Received: by mail-lb0-f182.google.com with SMTP id f15so4283707lbj.13 for ; Mon, 27 Oct 2014 01:02:50 -0700 (PDT) X-Received: by 10.112.130.41 with SMTP id ob9mr21273493lbb.74.1414396970193; Mon, 27 Oct 2014 01:02:50 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp247507lbz; Mon, 27 Oct 2014 01:02:49 -0700 (PDT) X-Received: by 10.70.38.232 with SMTP id j8mr22884259pdk.44.1414396968655; Mon, 27 Oct 2014 01:02:48 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id qp3si9874752pac.147.2014.10.27.01.02.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Oct 2014 01:02:48 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-53810-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 15989 invoked by alias); 27 Oct 2014 08:00:18 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list 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 15322 invoked by uid 89); 27 Oct 2014 08:00:01 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-HELO: mail-ie0-f169.google.com X-Received: by 10.42.152.129 with SMTP id i1mr130762icw.96.1414396798057; Mon, 27 Oct 2014 00:59:58 -0700 (PDT) From: Andrew Pinski To: libc-alpha@sourceware.org Cc: Andrew Pinski Subject: [PATCH 13/29] [AARCH64] Use PTR_* macros in dl-trampoline.S Date: Mon, 27 Oct 2014 00:59:37 -0700 Message-Id: <1414396793-9005-14-git-send-email-apinski@cavium.com> In-Reply-To: <1414396793-9005-1-git-send-email-apinski@cavium.com> References: <1414396793-9005-1-git-send-email-apinski@cavium.com> X-Original-Sender: apinski@cavium.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::236 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@sourceware.org X-Google-Group-Id: 836684582541 Use the PTR_* macros in dl-trampoline.S so it can be used for both ILP32 and LP64. Also add a comment about what was an magic number (the size of the rela relocation entries). * sysdeps/aarch64/dl-trampoline.S (ip0l): New define. (RELA_SIZE): New define. (_dl_runtime_resolve): Use PTR_REG, PTR_SIZE. (_dl_runtime_profile): Likewise. Use RELA_SIZE and ip0l. --- sysdeps/aarch64/dl-trampoline.S | 18 +++++++++++------- 1 files changed, 11 insertions(+), 7 deletions(-) diff --git a/sysdeps/aarch64/dl-trampoline.S b/sysdeps/aarch64/dl-trampoline.S index 2037f18..22b28ce 100644 --- a/sysdeps/aarch64/dl-trampoline.S +++ b/sysdeps/aarch64/dl-trampoline.S @@ -22,9 +22,13 @@ #include "dl-link.h" #define ip0 x16 +#define ip0l PTR_REG (16) #define ip1 x17 #define lr x30 +/* RELA relocatons are 3 pointers */ +#define RELA_SIZE (PTR_SIZE * 3) + .text .globl _dl_runtime_resolve .type _dl_runtime_resolve, #function @@ -79,7 +83,7 @@ _dl_runtime_resolve: cfi_rel_offset (q1, 80+7*16) /* Get pointer to linker struct. */ - ldr x0, [ip0, #-8] + ldr PTR_REG (0), [ip0, #-PTR_SIZE] /* Prepare to call _dl_fixup(). */ ldr x1, [sp, 80+8*16] /* Recover &PLTGOT[n] */ @@ -87,7 +91,7 @@ _dl_runtime_resolve: sub x1, x1, ip0 add x1, x1, x1, lsl #1 lsl x1, x1, #3 - sub x1, x1, #192 + sub x1, x1, #(RELA_SIZE<<3) lsr x1, x1, #3 /* Call fixup routine. */ @@ -191,7 +195,7 @@ _dl_runtime_profile: stp x0, x1, [x29, #OFFSET_RG + DL_OFFSET_RG_SP] /* Get pointer to linker struct. */ - ldr x0, [ip0, #-8] + ldr PTR_REG (0), [ip0, #-PTR_SIZE] /* Prepare to call _dl_profile_fixup(). */ ldr x1, [x29, OFFSET_PLTGOTN] /* Recover &PLTGOT[n] */ @@ -199,7 +203,7 @@ _dl_runtime_profile: sub x1, x1, ip0 add x1, x1, x1, lsl #1 lsl x1, x1, #3 - sub x1, x1, #192 + sub x1, x1, #(RELA_SIZE<<3) lsr x1, x1, #3 stp x0, x1, [x29, #OFFSET_SAVED_CALL_X0] @@ -210,8 +214,8 @@ _dl_runtime_profile: add x4, x29, #OFFSET_FS /* address of framesize */ bl _dl_profile_fixup - ldr ip0, [x29, #OFFSET_FS] /* framesize == 0 */ - cmp ip0, #0 + ldr ip0l, [x29, #OFFSET_FS] /* framesize == 0 */ + cmp ip0l, #0 bge 1f cfi_remember_state @@ -243,7 +247,7 @@ _dl_runtime_profile: 1: /* The new frame size is in ip0. */ - sub x1, x29, ip0 + sub PTR_REG (1), PTR_REG (29), ip0l and sp, x1, #0xfffffffffffffff0 str x0, [x29, #OFFSET_T1]