aboutsummaryrefslogtreecommitdiff
path: root/ldso/ldso/dl-elf.c
diff options
context:
space:
mode:
Diffstat (limited to 'ldso/ldso/dl-elf.c')
-rw-r--r--ldso/ldso/dl-elf.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c
index 5f59162a7..e4377248c 100644
--- a/ldso/ldso/dl-elf.c
+++ b/ldso/ldso/dl-elf.c
@@ -30,6 +30,7 @@
*/
+#include "sys/mman.h"
#include "ldso.h"
#ifdef __LDSO_CACHE_SUPPORT__
@@ -118,6 +119,7 @@ int _dl_unmap_cache(void)
void
_dl_protect_relro (struct elf_resolve *l)
{
+#ifndef ARCH_CANNOT_PROTECT_MEMORY
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);
@@ -127,6 +129,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