From 22bb0a204629e7e1f95c60f1ece69c98e7c534ad Mon Sep 17 00:00:00 2001 From: Chandan Uddaraju Date: Thu, 10 Sep 2009 11:41:43 -0700 Subject: Bionic/linker: Add flag to mmap system call to use the specified address for libraries Add flag to mmap system call to use the specified address for libraries. This fixed the issue of the address mismatch of prelinked libraries after the 2G/2G virtual memory changes. CRs-fixed: 195174 --- linker/linker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linker/linker.c b/linker/linker.c index 789a828..292cf46 100644 --- a/linker/linker.c +++ b/linker/linker.c @@ -698,7 +698,7 @@ get_lib_extents(int fd, const char *name, void *__hdr, unsigned *total_sz) static int reserve_mem_region(soinfo *si) { void *base = mmap((void *)si->base, si->size, PROT_READ | PROT_EXEC, - MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + MAP_PRIVATE | MAP_FIXED | MAP_ANONYMOUS, -1, 0); if (base == MAP_FAILED) { DL_ERR("%5d can NOT map (%sprelinked) library '%s' at 0x%08x " "as requested, will try general pool: %d (%s)", -- cgit v1.1