diff options
author | Alex Light <allight@google.com> | 2014-07-02 16:28:08 -0700 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2014-07-22 08:24:14 -0700 |
commit | a59dd80f9f48cb750d329d4d4af2d99d72b484d1 (patch) | |
tree | 36958b15842205addaf6d2a13e40823eab47c8bc /oatdump/oatdump.cc | |
parent | 84568fdf08f8f476292996ad653b4453d2894d23 (diff) | |
download | art-a59dd80f9f48cb750d329d4d4af2d99d72b484d1.zip art-a59dd80f9f48cb750d329d4d4af2d99d72b484d1.tar.gz art-a59dd80f9f48cb750d329d4d4af2d99d72b484d1.tar.bz2 |
Runtime can now be set to require relocation
Add a pair of runtime flags -Xrelocate and -Xnorelocate that can force
the runtime to require that all files that are run are relocated, to
prevent attacks based on the known art base address.
Add support for running patchoat on oat files compiled without an image.
Change run-test to have new --prebuild and --relocate flags.
Bug: 15358152
Change-Id: I91166c62dd1ab80e5cbcb7883a2cd0d56afca32d
Diffstat (limited to 'oatdump/oatdump.cc')
-rw-r--r-- | oatdump/oatdump.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/oatdump/oatdump.cc b/oatdump/oatdump.cc index b8f20f3..068a450 100644 --- a/oatdump/oatdump.cc +++ b/oatdump/oatdump.cc @@ -165,6 +165,8 @@ class OatDumper { GetQuickToInterpreterBridgeOffset); #undef DUMP_OAT_HEADER_OFFSET + os << "IMAGE PATCH DELTA:\n" << oat_header.GetImagePatchDelta(); + os << "IMAGE FILE LOCATION OAT CHECKSUM:\n"; os << StringPrintf("0x%08x\n\n", oat_header.GetImageFileLocationOatChecksum()); @@ -771,6 +773,8 @@ class ImageDumper { os << "OAT FILE END:" << reinterpret_cast<void*>(image_header_.GetOatFileEnd()) << "\n\n"; + os << "PATCH DELTA:" << image_header_.GetPatchDelta() << "\n\n"; + { os << "ROOTS: " << reinterpret_cast<void*>(image_header_.GetImageRoots()) << "\n"; Indenter indent1_filter(os.rdbuf(), kIndentChar, kIndentBy1Count); @@ -819,10 +823,13 @@ class ImageDumper { os << "OAT LOCATION: " << oat_location; os << "\n"; std::string error_msg; - const OatFile* oat_file = class_linker->FindOatFileFromOatLocation(oat_location, &error_msg); - if (oat_file == NULL) { - os << "NOT FOUND: " << error_msg << "\n"; - return; + const OatFile* oat_file = class_linker->FindOpenedOatFileFromOatLocation(oat_location); + if (oat_file == nullptr) { + oat_file = OatFile::Open(oat_location, oat_location, NULL, false, &error_msg); + if (oat_file == nullptr) { + os << "NOT FOUND: " << error_msg << "\n"; + return; + } } os << "\n"; |