From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16912 invoked by alias); 18 Nov 2014 12:33:46 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 16901 invoked by uid 89); 18 Nov 2014 12:33:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ig0-f179.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=a+RkSxNQZmbHwWf+CeEeCoHDB8R5v+Y94qtdPBR8gN8=; b=B5IzDp3lDRV+/rmyA7EPPtnCSEb8PxxMx66xU0E2Z1QaV5HY8KGE1oiEOGJ09JaSH0 AzQ8KuFXa/tr0KAnKLOAY77w06HvptjJUvAl50cCTIrNZUZo3Mcr2g8jk3XEXoClBQ6h nY/MXKC09qHkldkJjnj+JSeidO2eRSOghgY8wLW2ZfgV0f+1zZQ0WA0zru4Wcr5gKgWU O+tTnA17CVRqmpia8N1hA18pmrdbejBSZE01m6bKg69T85wADPJmwxGf51YybRkIwkMz ja2kTPooHlGD9JcA+GLx6WuVY1PK2iZA24dpcOZ3GuNZAjt001ZpepkG1vnec3I2yD5n PSJA== X-Gm-Message-State: ALoCoQmM2zXmnXADK/U36jqJxIoj5JldFNMppC/3Dr+04rvZQT3GVTQ4qfPM7kN5cNSOjkqZRMww MIME-Version: 1.0 X-Received: by 10.50.79.193 with SMTP id l1mr2866446igx.30.1416314022731; Tue, 18 Nov 2014 04:33:42 -0800 (PST) In-Reply-To: <1414396793-9005-14-git-send-email-apinski@cavium.com> References: <1414396793-9005-1-git-send-email-apinski@cavium.com> <1414396793-9005-14-git-send-email-apinski@cavium.com> Date: Tue, 18 Nov 2014 12:33:00 -0000 Message-ID: Subject: Re: [PATCH 13/29] [AARCH64] Use PTR_* macros in dl-trampoline.S From: Will Newton To: Andrew Pinski Cc: libc-alpha Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2014-11/txt/msg00423.txt.bz2 On 27 October 2014 07:59, Andrew Pinski wrote: > 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(-) This looks ok to me. Not a massive fan of the name ip0l but I don't have a better suggestion right now. > 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] > -- > 1.7.2.5 > -- Will Newton Toolchain Working Group, Linaro