summaryrefslogtreecommitdiff
path: root/compiler/oat_test.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2016-02-16 12:50:23 +0000
committer Vladimir Marko <vmarko@google.com> 2016-02-17 16:38:46 +0000
commit6065402316da2b51eed5fc34cffbd991766bd408 (patch)
treecb93e32b978ea03a70baf980c470a03263c084c0 /compiler/oat_test.cc
parent442643920a6c539e98aad76594e99b932b5631ba (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/oat_test.cc')
-rw-r--r--compiler/oat_test.cc24
1 files changed, 13 insertions, 11 deletions
diff --git a/compiler/oat_test.cc b/compiler/oat_test.cc
index 894d29ee99..d03b4f1055 100644
--- a/compiler/oat_test.cc
+++ b/compiler/oat_test.cc
@@ -111,17 +111,16 @@ class OatTest : public CommonCompilerTest {
compiler_kind,
insn_set,
insn_features_.get(),
- false,
- nullptr,
- nullptr,
- nullptr,
- 2,
- true,
- true,
+ /* boot_image */ false,
+ /* image_classes */ nullptr,
+ /* compiled_classes */ nullptr,
+ /* compiled_methods */ nullptr,
+ /* thread_count */ 2,
+ /* dump_stats */ true,
+ /* dump_passes */ true,
timer_.get(),
- -1,
- nullptr,
- nullptr));
+ /* swap_fd */ -1,
+ /* profile_compilation_info */ nullptr));
}
bool WriteElf(File* file,
@@ -201,6 +200,10 @@ class OatTest : public CommonCompilerTest {
class_linker->RegisterDexFile(*dex_file, runtime->GetLinearAlloc());
}
oat_writer.PrepareLayout(compiler_driver_.get(), nullptr, 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());
+
if (!oat_writer.WriteRodata(rodata)) {
return false;
}
@@ -216,7 +219,6 @@ class OatTest : public CommonCompilerTest {
return false;
}
- elf_writer->SetBssSize(oat_writer.GetBssSize());
elf_writer->WriteDynamicSection();
elf_writer->WriteDebugInfo(oat_writer.GetMethodDebugInfo());
elf_writer->WritePatchLocations(oat_writer.GetAbsolutePatchLocations());