From 6065402316da2b51eed5fc34cffbd991766bd408 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Tue, 16 Feb 2016 12:50:23 +0000 Subject: 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 --- compiler/image_test.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'compiler/image_test.cc') 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()); -- cgit v1.2.3-59-g8ed1b