diff options
author | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2022-04-07 17:04:59 +0100 |
---|---|---|
committer | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2022-11-22 14:31:25 +0000 |
commit | e252e5f0827ecbe82058c9c602f2dc5671072cdc (patch) | |
tree | 15489e430454c12e663379d35234df6daf56244f /sysdeps | |
parent | 81c2de89c6f6e9ade26f28e2ff65c5c0510600da (diff) | |
download | glibc-e252e5f0827ecbe82058c9c602f2dc5671072cdc.tar.gz glibc-e252e5f0827ecbe82058c9c602f2dc5671072cdc.tar.xz glibc-e252e5f0827ecbe82058c9c602f2dc5671072cdc.zip |
cheri: elf: use RX, RW capabilities to derive pointers
Instead of map->l_addr + offset use dl_rx_ptr (map, offset) dl_rw_ptr (map, offset) depending on RX or RW permission requirement.
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/generic/ldsodefs.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h index 4c407e4f24..563b440aab 100644 --- a/sysdeps/generic/ldsodefs.h +++ b/sysdeps/generic/ldsodefs.h @@ -115,7 +115,8 @@ dl_rw_ptr (const struct link_map *l, ElfW(Addr) vaddr) most architectures the entry is already relocated - but for some not and we need to relocate at access time. */ #define D_PTR(map, i) \ - ((map)->i->d_un.d_ptr + (dl_relocate_ld (map) ? 0 : (map)->l_addr)) + (dl_relocate_ld (map) ? (map)->i->d_un.d_ptr \ + : dl_rx_ptr ((map), (map)->i->d_un.d_ptr)) /* Result of the lookup functions and how to retrieve the base address. */ typedef struct link_map *lookup_t; |