summaryrefslogtreecommitdiffstats
path: root/runtime/image.h
diff options
context:
space:
mode:
authorIgor Murashkin <iam@google.com>2014-10-22 11:37:02 -0700
committerIgor Murashkin <iam@google.com>2014-10-27 20:19:37 -0700
commit46774767fcf7780d1455e755729198648d08742e (patch)
tree09a5d87ff0acbc7eb1fa94ec901ba10009178f03 /runtime/image.h
parent11bd683f6dbebe2f3d02fa383fc9dbc69a83ace8 (diff)
downloadart-46774767fcf7780d1455e755729198648d08742e.zip
art-46774767fcf7780d1455e755729198648d08742e.tar.gz
art-46774767fcf7780d1455e755729198648d08742e.tar.bz2
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
Diffstat (limited to 'runtime/image.h')
-rw-r--r--runtime/image.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/runtime/image.h b/runtime/image.h
index 03de509..7e2b847 100644
--- a/runtime/image.h
+++ b/runtime/image.h
@@ -28,7 +28,7 @@ namespace art {
// header of image files written by ImageWriter, read and validated by Space.
class PACKED(4) ImageHeader {
public:
- ImageHeader() {}
+ ImageHeader() : compile_pic_(0) {}
ImageHeader(uint32_t image_begin,
uint32_t image_size_,
@@ -39,7 +39,8 @@ class PACKED(4) ImageHeader {
uint32_t oat_file_begin,
uint32_t oat_data_begin,
uint32_t oat_data_end,
- uint32_t oat_file_end);
+ uint32_t oat_file_end,
+ bool compile_pic_);
bool IsValid() const;
const char* GetMagic() const;
@@ -121,6 +122,10 @@ class PACKED(4) ImageHeader {
void RelocateImage(off_t delta);
+ bool CompilePic() const {
+ return compile_pic_ != 0;
+ }
+
private:
static const uint8_t kImageMagic[4];
static const uint8_t kImageVersion[4];
@@ -162,6 +167,9 @@ class PACKED(4) ImageHeader {
// Absolute address of an Object[] of objects needed to reinitialize from an image.
uint32_t image_roots_;
+ // Boolean (0 or 1) to denote if the image was compiled with --compile-pic option
+ const uint32_t compile_pic_;
+
friend class ImageWriter;
};