]> Git Repo - uclibc-ng.git/commitdiff
rtld: Do not protect RELRO segments when we don't use an MMU.
authorChristophe Lyon <[email protected]>
Wed, 4 Jul 2018 15:55:15 +0000 (17:55 +0200)
committerWaldemar Brodkorb <[email protected]>
Fri, 10 Aug 2018 14:01:21 +0000 (16:01 +0200)
Without MMU, we cannot mark memory regions as read-only.

* ldso/ldso/dl-elf.c (_dl_protect_relro): Do nothing if
__ARCH_USE_MMU__ is defined.

Signed-off-by: Christophe Lyon <[email protected]>
ldso/ldso/dl-elf.c

index d264e6a49ddb7e866e2dd83ea203558231d08ae6..1768b5bb88ee05725bf689942022cfdee1a86e6f 100644 (file)
@@ -117,6 +117,7 @@ int _dl_unmap_cache(void)
 void
 _dl_protect_relro (struct elf_resolve *l)
 {
+#ifdef __ARCH_USE_MMU__
        ElfW(Addr) base = (ElfW(Addr)) DL_RELOC_ADDR(l->loadaddr, l->relro_addr);
        ElfW(Addr) start = (base & PAGE_ALIGN);
        ElfW(Addr) end = ((base + l->relro_size) & PAGE_ALIGN);
@@ -126,6 +127,7 @@ _dl_protect_relro (struct elf_resolve *l)
                _dl_dprintf(2, "%s: cannot apply additional memory protection after relocation", l->libname);
                _dl_exit(0);
        }
+#endif
 }
 
 /* This function's behavior must exactly match that
This page took 0.028243 seconds and 4 git commands to generate.