Merge "Ensure that ClassTable has correct alignment in image."
diff --git a/compiler/image_writer.cc b/compiler/image_writer.cc
index fce08ea..afa4904 100644
--- a/compiler/image_writer.cc
+++ b/compiler/image_writer.cc
@@ -1275,6 +1275,8 @@
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_);