Add low_4gb support to MapFile and MapFileAtAddress
Motivation is to use this for loading app images in low 4GB at a
non fixed address.
Added test.
Bug: 22858531
Change-Id: I0f79a4a7bfbfbdfc112e41b25c8682b1fb932ab7
diff --git a/runtime/dex_file.cc b/runtime/dex_file.cc
index 3a93aac..70096f5 100644
--- a/runtime/dex_file.cc
+++ b/runtime/dex_file.cc
@@ -231,7 +231,14 @@
return nullptr;
}
size_t length = sbuf.st_size;
- map.reset(MemMap::MapFile(length, PROT_READ, MAP_PRIVATE, fd, 0, location, error_msg));
+ map.reset(MemMap::MapFile(length,
+ PROT_READ,
+ MAP_PRIVATE,
+ fd,
+ 0,
+ /*low_4gb*/false,
+ location,
+ error_msg));
if (map.get() == nullptr) {
DCHECK(!error_msg->empty());
return nullptr;