Writable version of D_PTR, required for updating GOT[1] and GOT[2].
#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;
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;