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
diff --git a/compiler/image_test.cc b/compiler/image_test.cc
index 4920f9b..32f0a94 100644
--- a/compiler/image_test.cc
+++ b/compiler/image_test.cc
@@ -124,6 +124,10 @@
&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 @@
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());