OSDN Git Service

Merge "Revert "Revert "ART: Prepare for ELF64."""
authorNicolas Geoffray <ngeoffray@google.com>
Tue, 2 Sep 2014 08:12:44 +0000 (08:12 +0000)
committerGerrit Code Review <noreply-gerritcodereview@google.com>
Tue, 2 Sep 2014 08:12:44 +0000 (08:12 +0000)
1  2 
compiler/elf_writer_quick.cc

@@@ -976,21 -1056,15 +1056,21 @@@ bool ElfWriterQuick<Elf_Word, Elf_Sword
                             bool is_host_unused) {
    constexpr bool debug = false;
    const OatHeader& oat_header = oat_writer->GetOatHeader();
-   Elf32_Word oat_data_size = oat_header.GetExecutableOffset();
+   Elf_Word oat_data_size = oat_header.GetExecutableOffset();
    uint32_t oat_exec_size = oat_writer->GetSize() - oat_data_size;
  
 -  ElfBuilder builder(oat_writer, elf_file_, compiler_driver_->GetInstructionSet(), 0,
 -                     oat_data_size, oat_data_size, oat_exec_size,
 -                     compiler_driver_->GetCompilerOptions().GetIncludeDebugSymbols(),
 -                     debug);
 -
 -  if (!builder.Init()) {
 +  std::unique_ptr<ElfBuilder> builder(new ElfBuilder(
 +      oat_writer,
 +      elf_file_,
 +      compiler_driver_->GetInstructionSet(),
 +      0,
 +      oat_data_size,
 +      oat_data_size,
 +      oat_exec_size,
 +      compiler_driver_->GetCompilerOptions().GetIncludeDebugSymbols(),
 +      debug));
 +
 +  if (!builder->Init()) {
      return false;
    }
  
      ElfRawSectionBuilder oat_patches(".oat_patches", SHT_OAT_PATCH, 0, NULL, 0,
                                       sizeof(uintptr_t), sizeof(uintptr_t));
      ReservePatchSpace(oat_patches.GetBuffer(), debug);
 -    builder.RegisterRawSection(oat_patches);
 +    builder->RegisterRawSection(oat_patches);
    }
  
 -  return builder.Write();
 +  return builder->Write();
  }
  
- void ElfWriterQuick::WriteDebugSymbols(ElfBuilder* builder, OatWriter* oat_writer) {
+ template <typename Elf_Word, typename Elf_Sword, typename Elf_Addr,
+           typename Elf_Dyn, typename Elf_Sym, typename Elf_Ehdr,
+           typename Elf_Phdr, typename Elf_Shdr>
+ void ElfWriterQuick<Elf_Word, Elf_Sword, Elf_Addr, Elf_Dyn,
+   Elf_Sym, Elf_Ehdr, Elf_Phdr, Elf_Shdr>::WriteDebugSymbols(ElfBuilder* builder, OatWriter* oat_writer) {
    std::unique_ptr<std::vector<uint8_t>> cfi_info(
        ConstructCIEFrame(compiler_driver_->GetInstructionSet()));