summaryrefslogtreecommitdiffstats
path: root/runtime/oat_file.h
diff options
context:
space:
mode:
authorAlex Light <allight@google.com>2014-06-12 11:26:29 -0700
committerBrian Carlstrom <bdc@google.com>2014-07-07 15:19:58 -0700
commit53cb16b98acf3cf6f3a1e2204ad4958ecf1b5a3c (patch)
treec0129ef3de7148dc6a114449b4f751a560283eb0 /runtime/oat_file.h
parentae2efea4582df773f80be274bdc754f732b07df3 (diff)
downloadart-53cb16b98acf3cf6f3a1e2204ad4958ecf1b5a3c.zip
art-53cb16b98acf3cf6f3a1e2204ad4958ecf1b5a3c.tar.gz
art-53cb16b98acf3cf6f3a1e2204ad4958ecf1b5a3c.tar.bz2
Add patchoat tool to Art.
Add a new executable called patchoat to art. This tool takes already compiled images and oat files and changes their base address, acting as a cheap form of relocation. Add a --include-patch-information flag to dex2oat and code to add required patch information to oat files created with the quick compiler. Bug: 15358152 Change-Id: Ie0c580db45bb14ec180deb84930def6c3628d97d
Diffstat (limited to 'runtime/oat_file.h')
-rw-r--r--runtime/oat_file.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/runtime/oat_file.h b/runtime/oat_file.h
index eae0418..70253af 100644
--- a/runtime/oat_file.h
+++ b/runtime/oat_file.h
@@ -60,6 +60,12 @@ class OatFile {
~OatFile();
+ ElfFile* GetElfFile() const {
+ CHECK_NE(reinterpret_cast<uintptr_t>(elf_file_.get()), reinterpret_cast<uintptr_t>(nullptr))
+ << "Cannot get an elf file from " << GetLocation();
+ return elf_file_.get();
+ }
+
const std::string& GetLocation() const {
return location_;
}
@@ -227,6 +233,9 @@ class OatFile {
return End() - Begin();
}
+ const byte* Begin() const;
+ const byte* End() const;
+
private:
static void CheckLocation(const std::string& location);
@@ -248,9 +257,6 @@ class OatFile {
std::string* error_msg);
bool Setup(std::string* error_msg);
- const byte* Begin() const;
- const byte* End() const;
-
// The oat file name.
//
// The image will embed this to link its associated oat file.