summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Carlstrom <bdc@google.com>2013-09-03 14:15:31 -0700
committerBrian Carlstrom <bdc@google.com>2013-09-03 14:15:31 -0700
commit68708f536d11f8824d881b640f3902093075c0a6 (patch)
treed1409b81bf3274b596e404dcd6b74b180f4ca41a
parent179486aee731f734207873244542993ed4bcff21 (diff)
downloadart-68708f536d11f8824d881b640f3902093075c0a6.zip
art-68708f536d11f8824d881b640f3902093075c0a6.tar.gz
art-68708f536d11f8824d881b640f3902093075c0a6.tar.bz2
Fix image_test on target
Bug: 10606994 Change-Id: I39838483e59479ceb9ba014bef9086b32f2596a8
-rw-r--r--runtime/image.cc15
-rw-r--r--runtime/image.h16
2 files changed, 17 insertions, 14 deletions
diff --git a/runtime/image.cc b/runtime/image.cc
index d11594c..dd9b6d7 100644
--- a/runtime/image.cc
+++ b/runtime/image.cc
@@ -58,6 +58,21 @@ ImageHeader::ImageHeader(uint32_t image_begin,
memcpy(version_, kImageVersion, sizeof(kImageVersion));
}
+bool ImageHeader::IsValid() const {
+ if (memcmp(magic_, kImageMagic, sizeof(kImageMagic)) != 0) {
+ return false;
+ }
+ if (memcmp(version_, kImageVersion, sizeof(kImageVersion)) != 0) {
+ return false;
+ }
+ return true;
+}
+
+const char* ImageHeader::GetMagic() const {
+ CHECK(IsValid());
+ return reinterpret_cast<const char*>(magic_);
+}
+
mirror::Object* ImageHeader::GetImageRoot(ImageRoot image_root) const {
return GetImageRoots()->Get(image_root);
}
diff --git a/runtime/image.h b/runtime/image.h
index 0e0a90a..2cb468f 100644
--- a/runtime/image.h
+++ b/runtime/image.h
@@ -41,20 +41,8 @@ class PACKED(4) ImageHeader {
uint32_t oat_data_end,
uint32_t oat_file_end);
- bool IsValid() const {
- if (memcmp(magic_, kImageMagic, sizeof(kImageMagic)) != 0) {
- return false;
- }
- if (memcmp(version_, kImageVersion, sizeof(kImageVersion)) != 0) {
- return false;
- }
- return true;
- }
-
- const char* GetMagic() const {
- CHECK(IsValid());
- return reinterpret_cast<const char*>(magic_);
- }
+ bool IsValid() const;
+ const char* GetMagic() const;
byte* GetImageBegin() const {
return reinterpret_cast<byte*>(image_begin_);