From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1944) id 4044A3852C5C; Wed, 23 Nov 2022 14:48:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4044A3852C5C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669214931; bh=eQ8kE+K1DbvBHw+Oeu+85A4Z3GmkrEnJZR28T8M5UVE=; h=From:To:Subject:Date:From; b=VBvXCBrXF1uJJX93fipzyCM4Zy1+eQRRhySDyjbr+8FLtBxatdjQ7dUE6f+SewC1p c25yXJButQgJkpPNUJ5aBNC/jT5/RHTao0HWHVJmyPpuwKDingbYelSlpPQFPTwRTG 3pEB8QuIb362HgY3c3KoO2eZW94+jnfk4aoEJq6c= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Szabolcs Nagy To: glibc-cvs@sourceware.org Subject: [glibc/arm/morello/main] aarch64: morello: add D_PTR_RW X-Act-Checkin: glibc X-Git-Author: Szabolcs Nagy X-Git-Refname: refs/heads/arm/morello/main X-Git-Oldrev: b9af312764f7a1f8d0c9c11118bbceae28c950f4 X-Git-Newrev: 096943551e02aef644c7f180ee7a1f3474141e80 Message-Id: <20221123144851.4044A3852C5C@sourceware.org> Date: Wed, 23 Nov 2022 14:48:51 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=096943551e02aef644c7f180ee7a1f3474141e80 commit 096943551e02aef644c7f180ee7a1f3474141e80 Author: Szabolcs Nagy Date: Thu Sep 1 16:43:19 2022 +0100 aarch64: morello: add D_PTR_RW Writable version of D_PTR, required for updating GOT[1] and GOT[2]. Diff: --- sysdeps/aarch64/ldsodefs.h | 4 ++++ sysdeps/aarch64/morello/dl-machine.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sysdeps/aarch64/ldsodefs.h b/sysdeps/aarch64/ldsodefs.h index b0b23df93c..e86c7e1e0e 100644 --- a/sysdeps/aarch64/ldsodefs.h +++ b/sysdeps/aarch64/ldsodefs.h @@ -25,6 +25,10 @@ #ifdef __CHERI_PURE_CAPABILITY__ # define DO_ELF_MACHINE_REL_RELATIVE(map, l_addr, relative) \ elf_machine_rela_relative (map, relative) + +#define D_PTR_RW(map, i) \ + (dl_relocate_ld (map) ? (map)->i->d_un.d_ptr \ + : dl_rw_ptr ((map), (map)->i->d_un.d_ptr)) #endif struct La_aarch64_regs; diff --git a/sysdeps/aarch64/morello/dl-machine.h b/sysdeps/aarch64/morello/dl-machine.h index 11e026302c..0f681b1925 100644 --- a/sysdeps/aarch64/morello/dl-machine.h +++ b/sysdeps/aarch64/morello/dl-machine.h @@ -53,7 +53,7 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[], extern void _dl_runtime_resolve (ElfW(Word)); extern void _dl_runtime_profile (ElfW(Word)); - got = (uintptr_t *) D_PTR (l, l_info[DT_PLTGOT]); + got = (uintptr_t *) D_PTR_RW (l, l_info[DT_PLTGOT]); if (got[1]) { l->l_mach.plt = dl_rx_ptr (l, got[1]);