Do not mark pages executable unnecessarily to play nice with selinux
Change-Id: Ief4a5da38ac7c2cf7bf6f7a640cb63c5e8ed03bd
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 8ea4295..e35b95c 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -692,7 +692,8 @@
oat_filename += runtime->GetHostPrefix();
oat_filename += oat_location->ToModifiedUtf8();
runtime->GetHeap()->UnReserveOatFileAddressRange();
- OatFile* oat_file = OatFile::Open(oat_filename, oat_filename, image_header.GetOatDataBegin());
+ OatFile* oat_file = OatFile::Open(oat_filename, oat_filename, image_header.GetOatDataBegin(),
+ !Runtime::Current()->IsCompiler());
VLOG(startup) << "ClassLinker::OpenOat entering oat_filename=" << oat_filename;
if (oat_file == NULL) {
LOG(ERROR) << "Failed to open oat file " << oat_filename << " referenced from image.";
@@ -731,7 +732,8 @@
const DexFile* ClassLinker::FindDexFileInOatLocation(const std::string& dex_location,
uint32_t dex_location_checksum,
const std::string& oat_location) {
- UniquePtr<OatFile> oat_file(OatFile::Open(oat_location, oat_location, NULL));
+ UniquePtr<OatFile> oat_file(OatFile::Open(oat_location, oat_location, NULL,
+ !Runtime::Current()->IsCompiler()));
if (oat_file.get() == NULL) {
return NULL;
}
@@ -787,7 +789,8 @@
LOG(ERROR) << "Failed to generate oat file: " << oat_location;
return NULL;
}
- const OatFile* oat_file = OatFile::Open(oat_location, oat_location, NULL);
+ const OatFile* oat_file = OatFile::Open(oat_location, oat_location, NULL,
+ !Runtime::Current()->IsCompiler());
if (oat_file == NULL) {
LOG(ERROR) << "Failed to open generated oat file: " << oat_location;
return NULL;
@@ -936,7 +939,7 @@
return oat_file;
}
- oat_file = OatFile::Open(oat_location, oat_location, NULL);
+ oat_file = OatFile::Open(oat_location, oat_location, NULL, !Runtime::Current()->IsCompiler());
if (oat_file == NULL) {
return NULL;
}