aarch64: morello: add D_PTR_RW

Writable version of D_PTR, required for updating GOT[1] and GOT[2].
This commit is contained in:
Szabolcs Nagy 2022-09-01 16:43:19 +01:00
parent e6a2c4c4bb
commit a1d26f7b1d
2 changed files with 5 additions and 1 deletions

View File

@ -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;

View 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;