summaryrefslogtreecommitdiffstats
path: root/dex2oat
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2014-09-16 16:40:09 -0700
committerAndreas Gampe <agampe@google.com>2014-09-17 14:46:48 -0700
commit33cb94e5e5b50330fb9fbafe90d1a2a6bd026e2f (patch)
tree0b02b157d163b51e60f9a3e85b6d96b6ee27fa3a /dex2oat
parenta20b7b3ecf90bb761d7085403782721f2fb474c5 (diff)
downloadandroid_art-33cb94e5e5b50330fb9fbafe90d1a2a6bd026e2f.tar.gz
android_art-33cb94e5e5b50330fb9fbafe90d1a2a6bd026e2f.tar.bz2
android_art-33cb94e5e5b50330fb9fbafe90d1a2a6bd026e2f.zip
ART: Sync oat file to disk before patching
Bug: 15567083, 17439961, 17510489, 17478752 (cherry picked from commit 035592c51fee2995a3d90a9043f91a7a3128df2b) Change-Id: I828dc6775044b5050c2520eb097abe6a920fd3ee
Diffstat (limited to 'dex2oat')
-rw-r--r--dex2oat/dex2oat.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc
index be6f09794f..d97144ec99 100644
--- a/dex2oat/dex2oat.cc
+++ b/dex2oat/dex2oat.cc
@@ -435,6 +435,11 @@ class Dex2Oat {
return nullptr;
}
+ // Flush result to disk. Patching code will re-open the file (mmap), so ensure that our view
+ // of the file already made it there and won't be re-ordered with writes from PatchOat or
+ // image patching.
+ oat_file->Flush();
+
if (!driver->IsImage() && driver->GetCompilerOptions().GetIncludePatchInformation()) {
t2.NewTiming("Patching ELF");
std::string error_msg;