]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
aarch64: morello: add D_PTR_RW
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Thu, 1 Sep 2022 15:43:19 +0000 (16:43 +0100)
committerSzabolcs Nagy <szabolcs.nagy@arm.com>
Wed, 12 Oct 2022 13:22:03 +0000 (14:22 +0100)
Writable version of D_PTR, required for updating GOT[1] and GOT[2].

sysdeps/aarch64/ldsodefs.h
sysdeps/aarch64/morello/dl-machine.h

index b0b23df93cd67e2dd4c395018e872938454f5c7d..e86c7e1e0e5c689be36383abec3dcc5f99200f8c 100644 (file)
 #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;
index 4eaffc2cf68d5521e214413335c2e32308a1c01d..e6c69fc321711a801300b9f1324ec9764aa7d1e8 100644 (file)
@@ -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 = (uint64_t) got[1] + l->l_addr;