ART: Add support for patching and loading OAT files compiled with PIC
* Images (.art) compiled with pic now have a new field added.
* isDexOptNeeded will now skip patch-ing for apps compiled PIC
* First-boot patching now only copies boot.art, boot.oat is linked
As a result, all system preopted dex files (with --compile-pic) no
longer take up any space in /data/dalvik-cache/<isa>.
Bug: 18035729
Change-Id: Ie1acad81a0fd8b2f24e1f3f07a06e6fdb548be62
diff --git a/runtime/oat_file.h b/runtime/oat_file.h
index ad6871d..2b94249 100644
--- a/runtime/oat_file.h
+++ b/runtime/oat_file.h
@@ -49,6 +49,7 @@
static OatFile* Open(const std::string& filename,
const std::string& location,
uint8_t* requested_base,
+ uint8_t* oat_file_begin,
bool executable,
std::string* error_msg);
@@ -315,13 +316,16 @@
static OatFile* OpenElfFile(File* file,
const std::string& location,
uint8_t* requested_base,
+ uint8_t* oat_file_begin, // Override base if not null
bool writable,
bool executable,
std::string* error_msg);
explicit OatFile(const std::string& filename, bool executable);
bool Dlopen(const std::string& elf_filename, uint8_t* requested_base, std::string* error_msg);
- bool ElfFileOpen(File* file, uint8_t* requested_base, bool writable, bool executable,
+ bool ElfFileOpen(File* file, uint8_t* requested_base,
+ uint8_t* oat_file_begin, // Override where the file is loaded to if not null
+ bool writable, bool executable,
std::string* error_msg);
bool Setup(std::string* error_msg);