diff options
author | Alex Light <allight@google.com> | 2014-06-12 11:26:29 -0700 |
---|---|---|
committer | Brian Carlstrom <bdc@google.com> | 2014-07-07 15:19:58 -0700 |
commit | 53cb16b98acf3cf6f3a1e2204ad4958ecf1b5a3c (patch) | |
tree | c0129ef3de7148dc6a114449b4f751a560283eb0 /runtime/image.h | |
parent | ae2efea4582df773f80be274bdc754f732b07df3 (diff) | |
download | art-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/image.h')
-rw-r--r-- | runtime/image.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/runtime/image.h b/runtime/image.h index abe1ad8..424a40b 100644 --- a/runtime/image.h +++ b/runtime/image.h @@ -84,6 +84,10 @@ class PACKED(4) ImageHeader { return reinterpret_cast<byte*>(oat_file_end_); } + off_t GetPatchDelta() const { + return patch_delta_; + } + size_t GetBitmapOffset() const { return RoundUp(image_size_, kPageSize); } @@ -112,10 +116,11 @@ class PACKED(4) ImageHeader { mirror::Object* GetImageRoot(ImageRoot image_root) const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); - - private: mirror::ObjectArray<mirror::Object>* GetImageRoots() const; + void RelocateImage(off_t delta); + + private: static const byte kImageMagic[4]; static const byte kImageVersion[4]; @@ -150,11 +155,13 @@ class PACKED(4) ImageHeader { // .so files. Used for positioning a following alloc spaces. uint32_t oat_file_end_; + // The total delta that this image has been patched. + int32_t patch_delta_; + // Absolute address of an Object[] of objects needed to reinitialize from an image. uint32_t image_roots_; friend class ImageWriter; - friend class ImageDumper; // For GetImageRoots() }; } // namespace art |