summaryrefslogtreecommitdiff
path: root/ldso
diff options
context:
space:
mode:
Diffstat (limited to 'ldso')
-rw-r--r--ldso/include/dl-defs.h6
-rw-r--r--ldso/ldso/dl-elf.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/ldso/include/dl-defs.h b/ldso/include/dl-defs.h
index eb59ca28b..6a94ee9d9 100644
--- a/ldso/include/dl-defs.h
+++ b/ldso/include/dl-defs.h
@@ -62,6 +62,12 @@ typedef struct {
int sooffset;
int liboffset;
} libentry_t;
+
+#ifdef __ARCH_USE_MMU__
+#define LDSO_CACHE_MMAP_FLAGS (MAP_SHARED)
+#else
+#define LDSO_CACHE_MMAP_FLAGS (MAP_PRIVATE)
+#endif
#endif /* __LDSO_CACHE_SUPPORT__ */
#endif
diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c
index e67257e18..a6ed8f6b5 100644
--- a/ldso/ldso/dl-elf.c
+++ b/ldso/ldso/dl-elf.c
@@ -57,7 +57,7 @@ int _dl_map_cache(void)
}
_dl_cache_size = st.st_size;
- _dl_cache_addr = (caddr_t) _dl_mmap(0, _dl_cache_size, PROT_READ, MAP_SHARED, fd, 0);
+ _dl_cache_addr = _dl_mmap(0, _dl_cache_size, PROT_READ, LDSO_CACHE_MMAP_FLAGS, fd, 0);
_dl_close(fd);
if (_dl_mmap_check_error(_dl_cache_addr)) {
_dl_dprintf(2, "%s:%i: can't map '%s'\n",