summaryrefslogtreecommitdiff
path: root/ldso
diff options
context:
space:
mode:
Diffstat (limited to 'ldso')
-rw-r--r--ldso/include/ldso.h6
-rw-r--r--ldso/ldso/dl-elf.c2
-rw-r--r--ldso/ldso/ldso.c2
3 files changed, 8 insertions, 2 deletions
diff --git a/ldso/include/ldso.h b/ldso/include/ldso.h
index 884c116b9..f19957d1d 100644
--- a/ldso/include/ldso.h
+++ b/ldso/include/ldso.h
@@ -9,6 +9,12 @@
#include <features.h>
+#ifdef __ARCH_USE_MMU__
+# define _MAP_UNINITIALIZED 0
+#else
+# define _MAP_UNINITIALIZED MAP_UNINITIALIZED
+#endif
+
/* Prepare for the case that `__builtin_expect' is not available. */
#if defined __GNUC__ && __GNUC__ == 2 && __GNUC_MINOR__ < 96
#define __builtin_expect(x, expected_value) (x)
diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c
index 930ccacb8..d264e6a49 100644
--- a/ldso/ldso/dl-elf.c
+++ b/ldso/ldso/dl-elf.c
@@ -569,7 +569,7 @@ struct elf_resolve *_dl_load_elf_shared_library(unsigned int rflags,
return NULL;
}
header = _dl_mmap((void *) 0, _dl_pagesize, PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_ANONYMOUS | MAP_UNINITIALIZED, -1, 0);
+ MAP_PRIVATE | MAP_ANONYMOUS | _MAP_UNINITIALIZED, -1, 0);
if (_dl_mmap_check_error(header)) {
_dl_dprintf(2, "%s:%i: can't map '%s'\n", _dl_progname, __LINE__, libname);
_dl_internal_error_number = LD_ERROR_MMAP_FAILED;
diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c
index 0257d1f33..17818b5fd 100644
--- a/ldso/ldso/ldso.c
+++ b/ldso/ldso/ldso.c
@@ -235,7 +235,7 @@ void *_dl_malloc(size_t size)
_dl_debug_early("mmapping more memory\n");
_dl_mmap_zero = _dl_malloc_addr = _dl_mmap((void *) 0, rounded_size,
- PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_UNINITIALIZED, -1, 0);
+ PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | _MAP_UNINITIALIZED, -1, 0);
if (_dl_mmap_check_error(_dl_mmap_zero)) {
_dl_dprintf(2, "%s: mmap of a spare page failed!\n", _dl_progname);
_dl_exit(20);