]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
cheri: elf: Use elfptr_t in _dl_protect_relro
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Mon, 21 Jun 2021 09:51:05 +0000 (10:51 +0100)
committerSzabolcs Nagy <szabolcs.nagy@arm.com>
Thu, 27 Oct 2022 13:46:52 +0000 (14:46 +0100)
Derive the start of the relro area from the RW capability of the dso.

elf/dl-reloc.c

index 756bf950f6f98aa04e4ee23d202f27c26775584e..4656015ea21154f19e9dc2147feeccecf58bbb19 100644 (file)
@@ -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