diff options
author | 2016-02-16 12:50:23 +0000 | |
---|---|---|
committer | 2016-02-17 16:38:46 +0000 | |
commit | 6065402316da2b51eed5fc34cffbd991766bd408 (patch) | |
tree | cb93e32b978ea03a70baf980c470a03263c084c0 /compiler/image_test.cc | |
parent | 442643920a6c539e98aad76594e99b932b5631ba (diff) |
Allow method references across oat files for multi-image.
These were disabled because we didn't have sufficient
information about the multi-image layout when processing
link-time patches in OatWriter. This CL refactors the
ELF file creation so that the information is available.
Change-Id: I6f2e8dc8572d143c72cc2693bb0ba4fd76f889ab
Diffstat (limited to 'compiler/image_test.cc')
-rw-r--r-- | compiler/image_test.cc | 5 |
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()); |