diff options
author | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2018-01-28 04:30:35 +0000 |
---|---|---|
committer | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2018-02-03 19:29:51 +0000 |
commit | 7cc754bc93eafa78695ec03bb0e4e8256d52c76d (patch) | |
tree | dc55c7555ce60aa779ea6e71c5856e4d6db74a6c /ldso | |
parent | 8948296356072119a07c6b9435dc16bdc74bdc56 (diff) |
bits/mman.h: consolidate header file
Sync with GNU C library and consolidate duplicate non
architecture specific defines.
MAP_UNINITIALIZED is only defined to 0x4000000 and used by
the Linux kernel when CONFIG_MMAP_ALLOW_UNINITIALIZED is enabled.
CONFIG_MMAP_ALLOW_UNINITIALIZED is only available for nommu.
See Documentation/nommu-mmap.txt.
Diffstat (limited to 'ldso')
-rw-r--r-- | ldso/include/ldso.h | 6 | ||||
-rw-r--r-- | ldso/ldso/dl-elf.c | 2 | ||||
-rw-r--r-- | ldso/ldso/ldso.c | 2 |
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); |