From patchwork Tue Nov 18 16:43:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Newton X-Patchwork-Id: 41047 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0466D241C9 for ; Tue, 18 Nov 2014 16:44:12 +0000 (UTC) Received: by mail-wg0-f72.google.com with SMTP id y19sf2616577wgg.11 for ; Tue, 18 Nov 2014 08:44:11 -0800 (PST) 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:subject:date :message-id:in-reply-to:references:x-original-sender :x-original-authentication-results; bh=WEPWOePDs3s4XRVsAx0a4CLLCy4pid8fO86E3HHp9Ak=; b=LnmLlVvda+OpRHn5ySca3OcbyhEY2UlrtsYizzuSapFmG6sXXXZZJk9Vq70ZDOZMnG JOd2SqbUiy43CZv1i59eLXLy54ZumRkTYq9xv1tkJAJQAwt66QKRjk5wA9T4c458ZuVL yIprfcmf9+fVAZbU2BoPFC9eIUvppIOi7WEWkIOrm+6015GUM8VaF1+HCZJahttvwGgB VEfsG+CyfhMaVEMxZEHY7gqzfxL9mqpx9Klxkvl7AMaTSbpqeB5qdCrykOPlaT4PGRi4 ufXq3j2vzSsC/Tf+fx5prGXsvYEKQx5+frOqOZ81iCoPM+YpfpWEqTyp4WYonDm4Z0HI E1tw== X-Gm-Message-State: ALoCoQnscnCIITVLRuBDNbos1btfbF1h/6wtBQLl5/+PIVK2q7EEQLFmtPnF8IxAueCKcIN0uP+4 X-Received: by 10.181.12.37 with SMTP id en5mr5778155wid.6.1416329051248; Tue, 18 Nov 2014 08:44:11 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.95.166 with SMTP id dl6ls1093997wib.29.canary; Tue, 18 Nov 2014 08:44:11 -0800 (PST) X-Received: by 10.180.109.194 with SMTP id hu2mr40915908wib.24.1416329051161; Tue, 18 Nov 2014 08:44:11 -0800 (PST) Received: from mail-wi0-x22f.google.com (mail-wi0-x22f.google.com. [2a00:1450:400c:c05::22f]) by mx.google.com with ESMTPS id bh10si12692050wjc.97.2014.11.18.08.44.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Nov 2014 08:44:10 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:400c:c05::22f as permitted sender) client-ip=2a00:1450:400c:c05::22f; Received: by mail-wi0-f175.google.com with SMTP id l15so2513496wiw.14 for ; Tue, 18 Nov 2014 08:44:10 -0800 (PST) X-Received: by 10.180.88.33 with SMTP id bd1mr5443147wib.10.1416329050196; Tue, 18 Nov 2014 08:44:10 -0800 (PST) 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.184.201 with SMTP id ew9csp1359941lbc; Tue, 18 Nov 2014 08:44:08 -0800 (PST) X-Received: by 10.66.241.239 with SMTP id wl15mr39350201pac.15.1416329047592; Tue, 18 Nov 2014 08:44:07 -0800 (PST) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id nj14si2974839pdb.184.2014.11.18.08.44.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Nov 2014 08:44:07 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-54481-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 23592 invoked by alias); 18 Nov 2014 16:43:43 -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 23528 invoked by uid 89); 18 Nov 2014 16:43:42 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wg0-f45.google.com X-Received: by 10.194.62.163 with SMTP id z3mr3665085wjr.74.1416329016718; Tue, 18 Nov 2014 08:43:36 -0800 (PST) From: Will Newton To: libc-alpha@sourceware.org Subject: [PATCH 1/3] AArch64: Update relocations for ILP32 Date: Tue, 18 Nov 2014 16:43:28 +0000 Message-Id: <1416329010-8683-2-git-send-email-will.newton@linaro.org> In-Reply-To: <1416329010-8683-1-git-send-email-will.newton@linaro.org> References: <1416329010-8683-1-git-send-email-will.newton@linaro.org> X-Original-Sender: will.newton@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:400c:c05::22f as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@sourceware.org X-Google-Group-Id: 836684582541 The latest version of the binutils ELF header defines a new set of dynamic relocations for ILP32 and renames some to make the naming more uniform. ChangeLog: 2014-11-18 Will Newton Andrew Pinski * elf/elf.h (R_AARCH64_P32_ABS32, R_AARCH64_P32_COPY, R_AARCH64_P32_GLOB_DAT, R_AARCH64_P32_JUMP_SLOT, R_AARCH64_P32_RELATIVE, R_AARCH64_P32_TLS_DTPMOD, R_AARCH64_P32_TLS_DTPREL, R_AARCH64_P32_TLS_TPREL, R_AARCH64_P32_TLSDESC, R_AARCH64_P32_IRELATIVE): Define. (R_AARCH64_TLS_DTPMOD64): Rename to .. (R_AARCH64_TLS_DTPMOD): This. (R_AARCH64_TLS_DTPREL64): Rename to ... (R_AARCH64_TLS_DTPREL): This. (R_AARCH64_TLS_TPREL64): Rename to ... (R_AARCH64_TLS_TPREL): This. * sysdeps/aarch64/dl-machine.h (elf_machine_type_class): Update R_AARCH64_TLS_DTPMOD64, R_AARCH64_TLS_DTPREL64, and R_AARCH64_TLS_TPREL64. (elf_machine_rela): Likewise. --- elf/elf.h | 20 +++++++++++++++++--- sysdeps/aarch64/dl-machine.h | 12 ++++++------ 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/elf/elf.h b/elf/elf.h index 78815e8..d752343 100644 --- a/elf/elf.h +++ b/elf/elf.h @@ -2362,6 +2362,20 @@ typedef Elf32_Addr Elf32_Conflict; /* AArch64 relocs. */ #define R_AARCH64_NONE 0 /* No relocation. */ + +/* ILP32 AARCH64 relocs. */ +#define R_AARCH64_P32_ABS32 1 /* Direct 32 bit. */ +#define R_AARCH64_P32_COPY 180 /* Copy symbol at runtime. */ +#define R_AARCH64_P32_GLOB_DAT 181 /* Create GOT entry. */ +#define R_AARCH64_P32_JUMP_SLOT 182 /* Create PLT entry. */ +#define R_AARCH64_P32_RELATIVE 183 /* Adjust by program base. */ +#define R_AARCH64_P32_TLS_DTPMOD 184 /* Module number, 32 bit. */ +#define R_AARCH64_P32_TLS_DTPREL 185 /* Module-relative offset, 32 bit. */ +#define R_AARCH64_P32_TLS_TPREL 186 /* TP-relative offset, 32 bit. */ +#define R_AARCH64_P32_TLSDESC 187 /* TLS Descriptor. */ +#define R_AARCH64_P32_IRELATIVE 188 /* STT_GNU_IFUNC relocation. */ + +/* LP64 AARCH64 relocs. */ #define R_AARCH64_ABS64 257 /* Direct 64 bit. */ #define R_AARCH64_ABS32 258 /* Direct 32 bit. */ #define R_AARCH64_ABS16 259 /* Direct 16-bit. */ @@ -2479,9 +2493,9 @@ typedef Elf32_Addr Elf32_Conflict; #define R_AARCH64_GLOB_DAT 1025 /* Create GOT entry. */ #define R_AARCH64_JUMP_SLOT 1026 /* Create PLT entry. */ #define R_AARCH64_RELATIVE 1027 /* Adjust by program base. */ -#define R_AARCH64_TLS_DTPMOD64 1028 /* Module number, 64 bit. */ -#define R_AARCH64_TLS_DTPREL64 1029 /* Module-relative offset, 64 bit. */ -#define R_AARCH64_TLS_TPREL64 1030 /* TP-relative offset, 64 bit. */ +#define R_AARCH64_TLS_DTPMOD 1028 /* Module number, 64 bit. */ +#define R_AARCH64_TLS_DTPREL 1029 /* Module-relative offset, 64 bit. */ +#define R_AARCH64_TLS_TPREL 1030 /* TP-relative offset, 64 bit. */ #define R_AARCH64_TLSDESC 1031 /* TLS Descriptor. */ #define R_AARCH64_IRELATIVE 1032 /* STT_GNU_IFUNC relocation. */ diff --git a/sysdeps/aarch64/dl-machine.h b/sysdeps/aarch64/dl-machine.h index 6746437..acb090d 100644 --- a/sysdeps/aarch64/dl-machine.h +++ b/sysdeps/aarch64/dl-machine.h @@ -188,9 +188,9 @@ _dl_start_user: \n\ #define elf_machine_type_class(type) \ ((((type) == R_AARCH64_JUMP_SLOT || \ - (type) == R_AARCH64_TLS_DTPMOD64 || \ - (type) == R_AARCH64_TLS_DTPREL64 || \ - (type) == R_AARCH64_TLS_TPREL64 || \ + (type) == R_AARCH64_TLS_DTPMOD || \ + (type) == R_AARCH64_TLS_DTPREL || \ + (type) == R_AARCH64_TLS_TPREL || \ (type) == R_AARCH64_TLSDESC) * ELF_RTYPE_CLASS_PLT) \ | (((type) == R_AARCH64_COPY) * ELF_RTYPE_CLASS_COPY)) @@ -314,7 +314,7 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc, break; } - case R_AARCH64_TLS_DTPMOD64: + case R_AARCH64_TLS_DTPMOD: #ifdef RTLD_BOOTSTRAP *reloc_addr = 1; #else @@ -325,12 +325,12 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc, #endif break; - case R_AARCH64_TLS_DTPREL64: + case R_AARCH64_TLS_DTPREL: if (sym) *reloc_addr = sym->st_value + reloc->r_addend; break; - case R_AARCH64_TLS_TPREL64: + case R_AARCH64_TLS_TPREL: if (sym) { CHECK_STATIC_TLS (map, sym_map);