From patchwork Tue Jun 21 05:06:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 70503 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp1830683qgy; Mon, 20 Jun 2016 22:08:44 -0700 (PDT) X-Received: by 10.66.135.40 with SMTP id pp8mr25905778pab.113.1466485724836; Mon, 20 Jun 2016 22:08:44 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id pj9si4926287pac.4.2016.06.20.22.08.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Jun 2016 22:08:44 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-70813-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of libc-alpha-return-70813-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-70813-patch=linaro.org@sourceware.org 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:mime-version:content-type; q=dns; s=default; b=X039L PjJnCQ8Gvt0YIeBHCb0IeQW1NdbVqtH8XCcls+V0tHHiM0I+XquMCtuSKvRtCtvI iegNUJr+XElUlLuLS5aTCRS0fPV9pkHl7KNLjkjfIGtJukjibr9jI84q7qyOnDCJ 5QgwpHqXHBRdqFmVLIEt8H0eZFmOd5Gy5uazn8= 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:mime-version:content-type; s=default; bh=2976jzSUy6S iQZg3BnR3LICD5eE=; b=NmxlQDAdpTekCIC8yNaPTS+mF6FJu8mu0mkV5FsdyQL 7cjn6IM6rYWfigO5C6gRTImAk3sMKQ9ENsH9Nrl4NkxjAXC3TOO73S0vgvms7Bi6 Edipr67tWGcZd2Fq6eiVwaQV3Y3M9ysjIuPE86h7ulYLhF4RTezQmu7uyM8P0trM = Received: (qmail 105415 invoked by alias); 21 Jun 2016 05:08:34 -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 105389 invoked by uid 89); 21 Jun 2016 05:08:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=2112, 23, 7, 23, 6, 2389 X-HELO: na01-bl2-obe.outbound.protection.outlook.com Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; From: Yury Norov To: , CC: , , , , , , , , , Andrew Pinski , Yury Norov Subject: [PATCH 03/27] Add dynamic ILP32 AARCH64 relocations to elf.h Date: Tue, 21 Jun 2016 08:06:47 +0300 Message-ID: <1466485631-3532-5-git-send-email-ynorov@caviumnetworks.com> In-Reply-To: <1466485631-3532-1-git-send-email-ynorov@caviumnetworks.com> References: <1466485631-3532-1-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-ClientProxiedBy: HE1PR03CA0039.eurprd03.prod.outlook.com (10.163.170.177) To DM3PR07MB2250.namprd07.prod.outlook.com (10.164.33.148) X-MS-Office365-Filtering-Correlation-Id: 1cdc2a1d-01e7-4aa6-5eb5-08d399920ec9 X-Microsoft-Exchange-Diagnostics: 1; DM3PR07MB2250; 2:HWxr6wu6Kc4Y9GZfBzl9JWA1wNVaszvXXD21xDxyFfidG6trtwu6gRDCscrsrqgDqq78h84vN/kp0MRzFvd13AYdXDlzEa6ApXQo7ckJ6YfN1Q00U8TEJDg9D83OtRk5CbgHNAirbFc5wZoYvhwdsXVK6Z7/ySE3Ia2F1gKsTItzzv5hxfTkppLxJON4GCyw; 3:wqFhAKp6dSVkoM0WZJNJ4OLuO90xG5WKWAoCw2NPmG2rWuxJz9yQoG2jGpIvlNSJ6I5TvjE2geXxG2U1MfzH4635RJB9gUXlWxCY8tn8l8CHQxIKuKJBQxOCnV/bPTtW; 25:WYKwpEusx9m2UA7mt+Im0oJjk0N053leTSV5aycaD+iaR/iWEIDdeAr7lzibkFjqJG+dkspQfCxFb441r2HTJrBuxKE2Rkwa8H3ACjZdb2F8BJ5J/iDnBn+w5sXZiEbjEb/mIv0aqXkVHOQzeGpcyt5D15DBJ3lV2fUBcZ8YLVjasF7YXSkIpELstKFHT/NdqZ4rzZsIR7e65vLoH9A0nc0tAuUx/4Bh6aiboZvIwsR/JeXXbat0NgLEGR73U1qesHqfxmL2mYSJlq4eeVnRRuatmCkv1Pf8KyMbxvYOnNfUhcWYdqBv5Xsy9lhwjUGldsjEq/0D0p1EVf5uf6pZ8CSHq8A+Uyl0qaHczj3/rqB36Y1MqGa+tX9TfbRNEHrGQftNC/yJNqRGAoLPQbceu0Ty9Y50suMS/xcV6z4FRr8= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM3PR07MB2250; X-Microsoft-Exchange-Diagnostics: 1; DM3PR07MB2250; 20:PDq892onI2IDNr41R4BqupfH+Be+tGtWrrW28kg+BJ4Q5031VxF2EpI5YAVoKrnt17wXLLWChIz0fNcmWkgp4K8KQ+I7pDuyjbmiKRAPtVH9TG9vSRRDpsAC7lvLYqwzEpxh97Mfb074HjsPbKq8CydI11ZNwuuhPg6ABYPPIWzAxAz1T+DTB+06fquZ5GxK+jHAgW8r81k2f7HgjHyshwo2E5Bz6Rs8GpoTptNUw2n1F/z3N74lr2+FbLvbsk4MouBEp9eFQQO4XDUSuCwmZ0TqZnrfbXkrezhJUrX8iNFeco6cRhKWo15UULWHGmVdIdWboBBfzi/qVpqkszb52/fq5LIN2G7RJFe0JZQfzk4PAgIo0hC+Ng3OC9sMPxw2pNVflyugjNU1OFfEVDQINuM7epFeogwpFUulsGR0FUl4xOfwIK47AHhvWjGz3/eZ/YmZLErlPKwIAVLhffTcOZdVXNH0cW/sIpurqfDfNQ2Ip2pVYL+Pnszpm1BpnJR8/VnT+E2lvTfEqBieseZbUcJj8VDChKsbrbNH38EZP/aCVCNBZyeLwam/ZiKTuVfruhrGeRYr+pLxOd+GJ4kuT+1sp2g4y/UQLfD4vt5fbNM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001); SRVR:DM3PR07MB2250; BCL:0; PCL:0; RULEID:; SRVR:DM3PR07MB2250; X-Microsoft-Exchange-Diagnostics: 1; DM3PR07MB2250; 4:gltrb+FHzfE1qZmdyvrUMt0+Mr9wqWRGura8FBBdQAqncudX42qIvbgGfjEOVujeVDCoV4pgsGwsbo6W9yTiPpN6RyvlxoW6Tj1ADL2OihiehGIIfHlnddlbxmZ2177FeyYadBje9auosWFRSb0NlA5lGVo1buE83PiZpWNbwbbgAyn8XnHM5zyQynC44LAC5QTdOMfPvzjItqRbNP/j8mKi+d732GxoHlWxsVTi2OXTuygWv/LlEi0VRKoB9m0dJwcayE/534jdjXc0/H4AzTRSqZvvhpS09hMGTnBfRJaop1jOF7zuXfdAwsi2ZTakTYfeQblpRH6R9dg7pLb9mAZe10QAWOYYA7Xk10wfv9/zGczZO44LfARcSX1Anh+j X-Forefront-PRVS: 098076C36C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(199003)(189002)(2906002)(33646002)(229853001)(68736007)(105586002)(36756003)(7846002)(50226002)(50986999)(5001770100001)(19580395003)(76176999)(106356001)(7736002)(97736004)(19580405001)(101416001)(4326007)(4001430100002)(586003)(47776003)(5003940100001)(81156014)(81166006)(189998001)(76506005)(107886002)(92566002)(8676002)(50466002)(48376002)(2950100001)(77096005)(3846002)(6116002)(66066001)(42186005)(575784001)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM3PR07MB2250; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: caviumnetworks.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM3PR07MB2250; 23:UqRCV8eCafdw5aSAEZvN3ax650EAgu16kVH8QnAq/?= =?us-ascii?Q?dvzMCbLe3uvJcwEFDsySWgX0qlzt1EQtCtuxEOOrPsbZbfWrEwpvavz4OpAM?= =?us-ascii?Q?5AOsKeNNbQbgxdZAI8VM+9xQxjMjWmfC7OAxzysJRSEPSI/3CeMvgwR5ROeW?= =?us-ascii?Q?gRAz2Ot694boJ+nFjPLU7SevpQLYsDXzAELYFNIIiK12LUMWUWcDrXqN90AK?= =?us-ascii?Q?0K7SwVDmxBQVhXqqNRt97CUu0HOjsQUWgIWPjlh4lTNWfUyg6bAZ4qFJZm5u?= =?us-ascii?Q?mPmT3MzWcCwl+hIx/IPvATp4nV5w5Q7xAknYPFOMVzdtmJflOTlu/htC/k5e?= =?us-ascii?Q?gdtvKdt6aqfKUa3Du6ZoC3a5HbpEgp+1fbAFKiDymIg6TKTbsVWqBJAjR2Tt?= =?us-ascii?Q?/o4rNsQ8818NJr2yJvrtNCWPVbs0ZLL5g1WnICgrE2dO72O29CFUpYQQ7Db9?= =?us-ascii?Q?T+BjvdRmG1Q1ohIIbvVFLYqn2TTAd945jQvkllL2yCcDN3qgjJGXUmOBtMGs?= =?us-ascii?Q?x/P4IuM98mctZiqrU7CLdoeN6imv5OdYddJ/mpFM3wM53r0gRVthPzOhPizW?= =?us-ascii?Q?XwVBs8HnDbQli5yeeqRc2oUTOYjnyFtYDd4y8b2l6suuL4OPNqvr3f+4kpit?= =?us-ascii?Q?QLj67dE/cPO0yDSeIXMFDmkuyoNDgDCuwQgtunkbagfz3kE/MAoHYdJhbTyM?= =?us-ascii?Q?eUEVRD5cxtkfZk2n22qpQjLY98TXDUY0FAovtftuAZPqjE5rZyYCVuxhJJMo?= =?us-ascii?Q?WLzWrDSli1ccyRhmaxdp2qgJw7RBAjc/FYR5wuggVjbfS2TOv/g0peNUw5Yy?= =?us-ascii?Q?0I8R9dZseOGTxoKdCke2cps5ggetw/709g2uHEAQHYrnApaouxo3OSRoEPIu?= =?us-ascii?Q?u1RJVPnIcmbnrPCSayc1jbRAa0sfOvCE+C1zoxZLczuC5op201Nv9tBawTfL?= =?us-ascii?Q?a9VYF27g1NjtRVPCajFY7hr4ahMUAhW/1TI0ZJjlSbpGEVgMxS0vi+ojOSM9?= =?us-ascii?Q?mHuSvA2pn1IfDQtANGAFmxv+isOJIjr5AhiaNh/zWvSn/qX971GGRkq+P3a/?= =?us-ascii?Q?reyXatvyJMUGZOUcmAyDxmy3nbx9l97bnBCCCqxZRiBwcbxvy5mpYiM3INby?= =?us-ascii?Q?rdscSf7YqVPePcE1q8oIDxgrGqOZFn8?= X-Microsoft-Exchange-Diagnostics: 1; DM3PR07MB2250; 6:zS76Igks/tKVakjwcVMqU+HLyGGennPJKwygXpKVKWINfewfTUJv4YZApG3l+B1eyssVm9cbdOHynFPh3KmdOKDXn36w9yQHlRiBxoUJWMBUWkK9VHfoQHGAzjnD6ZFJV2ht8lCrcugF76VGtgW7SDByApDV96JtSKKApNzayaiOu3ifPejuRLPHC97DQb/fXW1hymEwXEpS3VkyLxgxUEdSW1mJBsMNXvjZ8VfHCqwVpultIF+U1PUg/8Af+DAMZlkpPMoyffduW7T1uoxZ+x7umHh9pQbMAkUnYR9bMi4=; 5:0QUUgHi0maNHzz6jZzzJvGk+EH4WA1VZH9dAPQRJn54Eu2mlJ0Nqe3ffYaqpLEvXd8tm6ty5W+tZnJCYBcZWAIrPmP9VCOXIsXEMmhrVj5DpQHM8LJJimC9lRLlYtvCEw/4xR9NOzlwvm+mYEC3ddw==; 24:2R/tyk7WTcUPeYuZiQU8nD3thxloeeGyTxn9LpVbBMZxI7OZAb5qSbQ5G0uNLzz6PcYdHblegEtnMuONeDoS79oQHqwfhfaB+H5lAW3A1Zw=; 7:zGN/0UHXwxRwdGA2RPc7MD7YS/hGfcln3dw5MsI3xfHuBQVosy1BK2nP9Opn3PWQGIDjTqaJsRzidQm9P7SmpDMhTbBzzTSgW23F1wtdo6f4gU0dryj0vIecIB7GDaKgcqNdfk6wre+uLN01IInOeRDhRTyvxbpo991hOoriG7bC/am1791p4PoUB5HMFj30k81Q9vZALu9uE0WgSabls17ITwM5+R24XhEmZago4hzde5rGlkK+uqnVrGsRv9He SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2016 05:08:17.6880 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR07MB2250 From: 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. [AARCH64] Use ELFW and ElfW macros instead of ELF64 and Elf64 names. * sysdeps/aarch64/dl-machine.h (elf_machine_runtime_setup): Use ElfW(Addr). (elf_machine_rela): Use ELFW(R_TYPE). (elf_machine_lazy_rel): Likewise. [AARCH64] Introduce AARCH64_R so we can reuse the reloc code between ILP32 and LP64. * sysdeps/aarch64/sysdep.h (AARCH64_R): Define. * sysdeps/aarch64/dl-irel.h: Include sysdep.h (elf_irela): Use reloc names based on AARCH64_R. * sysdeps/aarch64/dl-machine.h: Include sysdep.h (elf_machine_type_class): Use reloc names based on AARCH64_R. (elf_machine_rela): Likewise. (elf_machine_lazy_rel): Likewise. Signed-off-by: Yury Norov --- sysdeps/aarch64/dl-irel.h | 3 ++- sysdeps/aarch64/dl-machine.h | 53 +++++++++++++++++++++++--------------------- sysdeps/aarch64/sysdep.h | 6 +++++ 3 files changed, 36 insertions(+), 26 deletions(-) -- 2.7.4 diff --git a/sysdeps/aarch64/dl-irel.h b/sysdeps/aarch64/dl-irel.h index 63a8e50..460454f 100644 --- a/sysdeps/aarch64/dl-irel.h +++ b/sysdeps/aarch64/dl-irel.h @@ -23,6 +23,7 @@ #include #include #include +#include #define ELF_MACHINE_IRELA 1 @@ -40,7 +41,7 @@ elf_irela (const ElfW(Rela) *reloc) ElfW(Addr) *const reloc_addr = (void *) reloc->r_offset; const unsigned long int r_type = ELFW(R_TYPE) (reloc->r_info); - if (__glibc_likely (r_type == R_AARCH64_IRELATIVE)) + if (__glibc_likely (r_type == AARCH64_R(IRELATIVE))) { ElfW(Addr) value = elf_ifunc_invoke (reloc->r_addend); *reloc_addr = value; diff --git a/sysdeps/aarch64/dl-machine.h b/sysdeps/aarch64/dl-machine.h index 282805e..a16cb11 100644 --- a/sysdeps/aarch64/dl-machine.h +++ b/sysdeps/aarch64/dl-machine.h @@ -21,6 +21,7 @@ #define ELF_MACHINE_NAME "aarch64" +#include #include #include #include @@ -190,15 +191,15 @@ _dl_start_user: \n\ "); #define elf_machine_type_class(type) \ - ((((type) == R_AARCH64_JUMP_SLOT || \ - (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) \ - | (((type) == R_AARCH64_GLOB_DAT) * ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA)) + ((((type) == AARCH64_R(JUMP_SLOT) || \ + (type) == AARCH64_R(TLS_DTPMOD) || \ + (type) == AARCH64_R(TLS_DTPREL) || \ + (type) == AARCH64_R(TLS_TPREL) || \ + (type) == AARCH64_R(TLSDESC)) * ELF_RTYPE_CLASS_PLT) \ + | (((type) == AARCH64_R(COPY)) * ELF_RTYPE_CLASS_COPY) \ + | (((type) == AARCH64_R(GLOB_DAT)) * ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA)) -#define ELF_MACHINE_JMP_SLOT R_AARCH64_JUMP_SLOT +#define ELF_MACHINE_JMP_SLOT AARCH64_R(JUMP_SLOT) /* AArch64 uses RELA not REL */ #define ELF_MACHINE_NO_REL 1 @@ -237,9 +238,9 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc, void *const reloc_addr_arg, int skip_ifunc) { ElfW(Addr) *const reloc_addr = reloc_addr_arg; - const unsigned int r_type = ELF64_R_TYPE (reloc->r_info); + const unsigned int r_type = ELFW(R_TYPE) (reloc->r_info); - if (__builtin_expect (r_type == R_AARCH64_RELATIVE, 0)) + if (__builtin_expect (r_type == AARCH64_R(RELATIVE), 0)) *reloc_addr = map->l_addr + reloc->r_addend; else if (__builtin_expect (r_type == R_AARCH64_NONE, 0)) return; @@ -257,7 +258,7 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc, switch (r_type) { - case R_AARCH64_COPY: + case AARCH64_R(COPY): if (sym == NULL) break; @@ -275,15 +276,17 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc, MIN (sym->st_size, refsym->st_size)); break; - case R_AARCH64_RELATIVE: - case R_AARCH64_GLOB_DAT: - case R_AARCH64_JUMP_SLOT: - case R_AARCH64_ABS32: - case R_AARCH64_ABS64: + case AARCH64_R(RELATIVE): + case AARCH64_R(GLOB_DAT): + case AARCH64_R(JUMP_SLOT): + case AARCH64_R(ABS32): +#ifdef __LP64__ + case AARCH64_R(ABS64): +#endif *reloc_addr = value + reloc->r_addend; break; - case R_AARCH64_TLSDESC: + case AARCH64_R(TLSDESC): { struct tlsdesc volatile *td = (struct tlsdesc volatile *)reloc_addr; @@ -318,7 +321,7 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc, break; } - case R_AARCH64_TLS_DTPMOD: + case AARCH64_R(TLS_DTPMOD): #ifdef RTLD_BOOTSTRAP *reloc_addr = 1; #else @@ -329,12 +332,12 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc, #endif break; - case R_AARCH64_TLS_DTPREL: + case AARCH64_R(TLS_DTPREL): if (sym) *reloc_addr = sym->st_value + reloc->r_addend; break; - case R_AARCH64_TLS_TPREL: + case AARCH64_R(TLS_TPREL): if (sym) { CHECK_STATIC_TLS (map, sym_map); @@ -343,7 +346,7 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc, } break; - case R_AARCH64_IRELATIVE: + case AARCH64_R(IRELATIVE): value = map->l_addr + reloc->r_addend; value = elf_ifunc_invoke (value); *reloc_addr = value; @@ -374,16 +377,16 @@ elf_machine_lazy_rel (struct link_map *map, int skip_ifunc) { ElfW(Addr) *const reloc_addr = (void *) (l_addr + reloc->r_offset); - const unsigned int r_type = ELF64_R_TYPE (reloc->r_info); + const unsigned int r_type = ELFW(R_TYPE) (reloc->r_info); /* Check for unexpected PLT reloc type. */ - if (__builtin_expect (r_type == R_AARCH64_JUMP_SLOT, 1)) + if (__builtin_expect (r_type == AARCH64_R(JUMP_SLOT), 1)) { if (__builtin_expect (map->l_mach.plt, 0) == 0) *reloc_addr += l_addr; else *reloc_addr = map->l_mach.plt; } - else if (__builtin_expect (r_type == R_AARCH64_TLSDESC, 1)) + else if (__builtin_expect (r_type == AARCH64_R(TLSDESC), 1)) { struct tlsdesc volatile *td = (struct tlsdesc volatile *)reloc_addr; @@ -392,7 +395,7 @@ elf_machine_lazy_rel (struct link_map *map, td->entry = (void*)(D_PTR (map, l_info[ADDRIDX (DT_TLSDESC_PLT)]) + map->l_addr); } - else if (__glibc_unlikely (r_type == R_AARCH64_IRELATIVE)) + else if (__glibc_unlikely (r_type == AARCH64_R(IRELATIVE))) { ElfW(Addr) value = map->l_addr + reloc->r_addend; if (__glibc_likely (!skip_ifunc)) diff --git a/sysdeps/aarch64/sysdep.h b/sysdeps/aarch64/sysdep.h index 594ab0b..4cb028f 100644 --- a/sysdeps/aarch64/sysdep.h +++ b/sysdeps/aarch64/sysdep.h @@ -21,6 +21,12 @@ #include +#ifdef __LP64__ +#define AARCH64_R(NAME) R_AARCH64_ ## NAME +#else +#define AARCH64_R(NAME) R_AARCH64_P32_ ## NAME +#endif + #ifdef __ASSEMBLER__ /* Syntactic details of assembler. */