Fix portable build.
Change-Id: I84f223c6629eaf567ef33cd616dbaf04af7ed0b3
diff --git a/compiler/elf_writer_mclinker.cc b/compiler/elf_writer_mclinker.cc
index b2d3a69..f688103 100644
--- a/compiler/elf_writer_mclinker.cc
+++ b/compiler/elf_writer_mclinker.cc
@@ -33,6 +33,7 @@
#include "class_linker.h"
#include "dex_method_iterator.h"
#include "driver/compiler_driver.h"
+#include "elf_file.h"
#include "globals.h"
#include "mirror/art_method.h"
#include "mirror/art_method-inl.h"
@@ -176,7 +177,7 @@
mcld::LDSection* null_section = ir_builder_->CreateELFHeader(*oat_input_,
"",
mcld::LDFileFormat::Null,
- llvm::ELF::SHT_NULL,
+ SHT_NULL,
0);
CHECK(null_section != NULL);
@@ -194,9 +195,8 @@
// TODO: ownership of text_section?
mcld::LDSection* text_section = ir_builder_->CreateELFHeader(*oat_input_,
".text",
- llvm::ELF::SHT_PROGBITS,
- llvm::ELF::SHF_EXECINSTR
- | llvm::ELF::SHF_ALLOC,
+ SHT_PROGBITS,
+ SHF_EXECINSTR | SHF_ALLOC,
alignment);
CHECK(text_section != NULL);
@@ -336,7 +336,7 @@
PLOG(ERROR) << "Failed to dup file descriptor for " << elf_file_->GetPath();
return false;
}
- if (!linker_->emit(fd)) {
+ if (!linker_->emit(*module_.get(), fd)) {
LOG(ERROR) << "Failed to emit " << elf_file_->GetPath();
return false;
}
@@ -350,7 +350,7 @@
UniquePtr<ElfFile> elf_file(ElfFile::Open(elf_file_, true, false, &error_msg));
CHECK(elf_file.get() != NULL) << elf_file_->GetPath() << ": " << error_msg;
- llvm::ELF::Elf32_Addr oatdata_address = GetOatDataAddress(elf_file.get());
+ uint32_t oatdata_address = GetOatDataAddress(elf_file.get());
DexMethodIterator it(dex_files);
while (it.HasNext()) {
const DexFile& dex_file = it.GetDexFile();
@@ -384,7 +384,7 @@
}
uint32_t ElfWriterMclinker::FixupCompiledCodeOffset(ElfFile& elf_file,
- llvm::ELF::Elf32_Addr oatdata_address,
+ Elf32_Addr oatdata_address,
const CompiledCode& compiled_code) {
const std::string& symbol = compiled_code.GetSymbol();
SafeMap<const std::string*, uint32_t>::iterator it = symbol_to_compiled_code_offset_.find(&symbol);
@@ -392,9 +392,9 @@
return it->second;
}
- llvm::ELF::Elf32_Addr compiled_code_address = elf_file.FindSymbolAddress(llvm::ELF::SHT_SYMTAB,
- symbol,
- true);
+ Elf32_Addr compiled_code_address = elf_file.FindSymbolAddress(SHT_SYMTAB,
+ symbol,
+ true);
CHECK_NE(0U, compiled_code_address) << symbol;
CHECK_LT(oatdata_address, compiled_code_address) << symbol;
uint32_t compiled_code_offset = compiled_code_address - oatdata_address;