From 2f3c9e7127b6fac0a712cf59b7a9a2f007bf7711 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Mon, 21 Jun 2021 10:51:05 +0100 Subject: [PATCH] cheri: elf: Use elfptr_t in _dl_protect_relro Derive the start of the relro area from the RW capability of the dso. --- elf/dl-reloc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/elf/dl-reloc.c b/elf/dl-reloc.c index 756bf950f6f..4656015ea21 100644 --- a/elf/dl-reloc.c +++ b/elf/dl-reloc.c @@ -353,8 +353,7 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[], void _dl_protect_relro (struct link_map *l) { - ElfW(Addr) start = ALIGN_DOWN((l->l_addr - + l->l_relro_addr), + elfptr_t start = ALIGN_DOWN(dl_rx_ptr (l, l->l_relro_addr), GLRO(dl_pagesize)); ElfW(Addr) end = ALIGN_DOWN((l->l_addr + l->l_relro_addr -- 2.47.2