summaryrefslogtreecommitdiff
path: root/compiler/image_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/image_test.cc')
-rw-r--r--compiler/image_test.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/image_test.cc b/compiler/image_test.cc
index 4920f9baa5..32f0a94c39 100644
--- a/compiler/image_test.cc
+++ b/compiler/image_test.cc
@@ -124,6 +124,10 @@ void ImageTest::TestWriteRead(ImageHeader::StorageMode storage_mode) {
&opened_dex_files);
ASSERT_TRUE(dex_files_ok);
oat_writer.PrepareLayout(compiler_driver_.get(), writer.get(), dex_files);
+ size_t rodata_size = oat_writer.GetOatHeader().GetExecutableOffset();
+ size_t text_size = oat_writer.GetSize() - rodata_size;
+ elf_writer->SetLoadedSectionSizes(rodata_size, text_size, oat_writer.GetBssSize());
+
bool image_space_ok = writer->PrepareImageAddressSpace();
ASSERT_TRUE(image_space_ok);
@@ -139,7 +143,6 @@ void ImageTest::TestWriteRead(ImageHeader::StorageMode storage_mode) {
bool header_ok = oat_writer.WriteHeader(elf_writer->GetStream(), 0u, 0u, 0u);
ASSERT_TRUE(header_ok);
- elf_writer->SetBssSize(oat_writer.GetBssSize());
elf_writer->WriteDynamicSection();
elf_writer->WriteDebugInfo(oat_writer.GetMethodDebugInfo());
elf_writer->WritePatchLocations(oat_writer.GetAbsolutePatchLocations());