From e050c8f927b41e1f5eca70707ac63015f362703a Mon Sep 17 00:00:00 2001 From: Alex Light Date: Wed, 16 Dec 2015 15:52:51 -0800 Subject: [PATCH] Ensure that ClassTable has correct alignment in image. Change-Id: I645b44fae1ec129364449af552c745bf32486b1a --- compiler/image_writer.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/image_writer.cc b/compiler/image_writer.cc index fce08ea5f..afa4904f4 100644 --- a/compiler/image_writer.cc +++ b/compiler/image_writer.cc @@ -1275,6 +1275,8 @@ void ImageWriter::CreateHeader(size_t oat_loaded_size, size_t oat_data_offset) { auto* interned_strings_section = §ions[ImageHeader::kSectionInternedStrings]; *interned_strings_section = ImageSection(cur_pos, intern_table_bytes_); cur_pos = interned_strings_section->End(); + // Round up to the alignment the class table expects. See HashSet::WriteToMemory. + cur_pos = RoundUp(cur_pos, sizeof(uint64_t)); // Calculate the size of the class table section. auto* class_table_section = §ions[ImageHeader::kSectionClassTable]; *class_table_section = ImageSection(cur_pos, class_table_bytes_); -- 2.11.0