summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2022-02-14 14:09:15 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2022-02-15 09:39:42 +0000
commit2c3b085a3d16fc2b53175f56d3e4bcd52f34cf2d (patch)
tree356a3fa326bb26242b839dd0bd6a9e9c96243c19
parent6ac1b0548826dac56fcb723a6aa14ada6d5b87e6 (diff)
Use the right alignof when mapping an uncompressed dex file.
We should use the header alignment, not the dex file alignment. Test: odrefresh --force-compile; /proc/$(pidof dex2oat64)/maps |grep extracted Bug: 217955940 Change-Id: I6827d4c4cd133874810ff5463686c330392f5f7b
-rw-r--r--dex2oat/linker/oat_writer.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/dex2oat/linker/oat_writer.cc b/dex2oat/linker/oat_writer.cc
index eccc3d52c1..229322c08c 100644
--- a/dex2oat/linker/oat_writer.cc
+++ b/dex2oat/linker/oat_writer.cc
@@ -3490,7 +3490,10 @@ bool OatWriter::OpenDexFiles(
for (OatDexFile& oat_dex_file : oat_dex_files_) {
std::string error_msg;
maps.emplace_back(oat_dex_file.source_.GetZipEntry()->MapDirectlyOrExtract(
- oat_dex_file.dex_file_location_data_, "zipped dex", &error_msg, alignof(DexFile)));
+ oat_dex_file.dex_file_location_data_,
+ "zipped dex",
+ &error_msg,
+ alignof(DexFile::Header)));
MemMap* map = &maps.back();
if (!map->IsValid()) {
LOG(ERROR) << error_msg;