summaryrefslogtreecommitdiff
path: root/ldso
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2007-04-17 21:54:11 +0000
committerMike Frysinger <vapier@gentoo.org>2007-04-17 21:54:11 +0000
commit338053615c6e1504a290355c66e105826ae9e51f (patch)
treebfae7b9aed037b55304ce3cb2059c75975edd8b8 /ldso
parentc9b4265653c0b77872fb40e029de396fe8efd6d3 (diff)
fix ld.so.cache handling on no-mmu setups
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",