Move .oat files to ELF format
Generates .oat in ELF file format using MCLinker
- Uses MCLinker IRBuilder to create a synthetic .o from OatWriter output.
- Uses new ElfFile for prelinking to support art image optimizations.
Adapted OatFile to load using dlopen, ElfFile, or memory, removing raw MemMap mechanism.
Changed image code to not assume oat data will be immediately after
image to allow space for ELF headers.
Passes test-art and works with installd.
Change-Id: Idc026eddb5de93f4b97490c405f3ed7b39589749
diff --git a/src/compiler.h b/src/compiler.h
index ad2a254..13130d7 100644
--- a/src/compiler.h
+++ b/src/compiler.h
@@ -188,6 +188,17 @@
void SetBitcodeFileName(std::string const& filename);
+ // TODO: remove when libart links against LLVM (when separate compiler library is gone)
+ bool WriteElf(std::vector<uint8_t>& oat_contents, File* file);
+ bool FixupElf(File* file, uintptr_t oat_data_begin) const;
+ void GetOatElfInformation(File* file, size_t& oat_loaded_size, size_t& oat_data_offset) const;
+
+ // TODO: move to a common home for llvm helpers once quick/portable are merged
+ static void InstructionSetToLLVMTarget(InstructionSet instruction_set,
+ std::string& target_triple,
+ std::string& target_cpu,
+ std::string& target_attr);
+
void SetCompilerContext(void* compiler_context) {
compiler_context_ = compiler_context;
}