OSDN Git Service

Merge "Fix frame size issue with 64-bit"
authorNarayan Kamath <narayan@google.com>
Mon, 1 Sep 2014 15:55:16 +0000 (15:55 +0000)
committerGerrit Code Review <noreply-gerritcodereview@google.com>
Mon, 1 Sep 2014 15:55:17 +0000 (15:55 +0000)
1  2 
compiler/elf_writer_quick.cc

@@@ -976,15 -1056,21 +976,21 @@@ bool ElfWriterQuick::Write(OatWriter* o
                             bool is_host_unused) {
    constexpr bool debug = false;
    const OatHeader& oat_header = oat_writer->GetOatHeader();
 -  Elf_Word oat_data_size = oat_header.GetExecutableOffset();
 +  Elf32_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();
  }
  
 -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) {
 +void ElfWriterQuick::WriteDebugSymbols(ElfBuilder* builder, OatWriter* oat_writer) {
    std::unique_ptr<std::vector<uint8_t>> cfi_info(
        ConstructCIEFrame(compiler_driver_->GetInstructionSet()));