Print unattached sections in the link map.
[deliverable/binutils-gdb.git] / gold / reloc.cc
index dfe50b3dba2474cf3a0a9feeb924f03a48965bf5..115ab375e4638176645fe10c2780794b8b3cacc7 100644 (file)
@@ -1,6 +1,6 @@
 // reloc.cc -- relocate input files for gold.
 
-// Copyright 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2006-2014 Free Software Foundation, Inc.
 // Written by Ian Lance Taylor <iant@google.com>.
 
 // This file is part of gold.
@@ -25,6 +25,7 @@
 #include <algorithm>
 
 #include "workqueue.h"
+#include "layout.h"
 #include "symtab.h"
 #include "output.h"
 #include "merge.h"
@@ -32,6 +33,8 @@
 #include "target-reloc.h"
 #include "reloc.h"
 #include "icf.h"
+#include "compressed_output.h"
+#include "incremental.h"
 
 namespace gold
 {
@@ -53,7 +56,9 @@ Read_relocs::is_runnable()
 void
 Read_relocs::locks(Task_locker* tl)
 {
-  tl->add(this, this->object_->token());
+  Task_token* token = this->object_->token();
+  if (token != NULL)
+    tl->add(this, token);
 }
 
 // Read the relocations and then start a Scan_relocs_task.
@@ -61,7 +66,7 @@ Read_relocs::locks(Task_locker* tl)
 void
 Read_relocs::run(Workqueue* workqueue)
 {
-  Read_relocs_data *rd = new Read_relocs_data;
+  Read_relocs_datard = new Read_relocs_data;
   this->object_->read_relocs(rd);
   this->object_->set_relocs_data(rd);
   this->object_->release();
@@ -75,15 +80,15 @@ Read_relocs::run(Workqueue* workqueue)
       workqueue->queue_next(new Gc_process_relocs(this->symtab_,
                                                   this->layout_, 
                                                   this->object_, rd,
-                                                  this->symtab_lock_, 
-                                                  this->blocker_));
+                                                  this->this_blocker_,
+                                                 this->next_blocker_));
     }
   else
     {
       workqueue->queue_next(new Scan_relocs(this->symtab_, this->layout_,
                                            this->object_, rd,
-                                            this->symtab_lock_, 
-                                            this->blocker_));
+                                            this->this_blocker_,
+                                           this->next_blocker_));
     }
 }
 
@@ -97,13 +102,22 @@ Read_relocs::get_name() const
 
 // Gc_process_relocs methods.
 
-// These tasks process the relocations read by Read_relocs and 
+Gc_process_relocs::~Gc_process_relocs()
+{
+  if (this->this_blocker_ != NULL)
+    delete this->this_blocker_;
+}
+
+// These tasks process the relocations read by Read_relocs and
 // determine which sections are referenced and which are garbage.
-// This task is done only when --gc-sections is used.
+// This task is done only when --gc-sections is used.  This is blocked
+// by THIS_BLOCKER_.  It unblocks NEXT_BLOCKER_.
 
 Task_token*
 Gc_process_relocs::is_runnable()
 {
+  if (this->this_blocker_ != NULL && this->this_blocker_->is_blocked())
+    return this->this_blocker_;
   if (this->object_->is_locked())
     return this->object_->token();
   return NULL;
@@ -113,7 +127,7 @@ void
 Gc_process_relocs::locks(Task_locker* tl)
 {
   tl->add(this, this->object_->token());
-  tl->add(this, this->blocker_);
+  tl->add(this, this->next_blocker_);
 }
 
 void
@@ -133,6 +147,12 @@ Gc_process_relocs::get_name() const
 
 // Scan_relocs methods.
 
+Scan_relocs::~Scan_relocs()
+{
+  if (this->this_blocker_ != NULL)
+    delete this->this_blocker_;
+}
+
 // These tasks scan the relocations read by Read_relocs and mark up
 // the symbol table to indicate which relocations are required.  We
 // use a lock on the symbol table to keep them from interfering with
@@ -141,8 +161,8 @@ Gc_process_relocs::get_name() const
 Task_token*
 Scan_relocs::is_runnable()
 {
-  if (!this->symtab_lock_->is_writable())
-    return this->symtab_lock_;
+  if (this->this_blocker_ != NULL && this->this_blocker_->is_blocked())
+    return this->this_blocker_;
   if (this->object_->is_locked())
     return this->object_->token();
   return NULL;
@@ -154,9 +174,10 @@ Scan_relocs::is_runnable()
 void
 Scan_relocs::locks(Task_locker* tl)
 {
-  tl->add(this, this->object_->token());
-  tl->add(this, this->symtab_lock_);
-  tl->add(this, this->blocker_);
+  Task_token* token = this->object_->token();
+  if (token != NULL)
+    tl->add(this, token);
+  tl->add(this, this->next_blocker_);
 }
 
 // Scan the relocs.
@@ -165,9 +186,9 @@ void
 Scan_relocs::run(Workqueue*)
 {
   this->object_->scan_relocs(this->symtab_, this->layout_, this->rd_);
-  this->object_->release();
   delete this->rd_;
   this->rd_ = NULL;
+  this->object_->release();
 }
 
 // Return a debugging name for the task.
@@ -205,7 +226,9 @@ Relocate_task::locks(Task_locker* tl)
   if (this->input_sections_blocker_ != NULL)
     tl->add(this, this->input_sections_blocker_);
   tl->add(this, this->final_blocker_);
-  tl->add(this, this->object_->token());
+  Task_token* token = this->object_->token();
+  if (token != NULL)
+    tl->add(this, token);
 }
 
 // Run the task.
@@ -235,25 +258,25 @@ Relocate_task::get_name() const
 
 template<int size, bool big_endian>
 void
-Sized_relobj<size, big_endian>::do_read_relocs(Read_relocs_data* rd)
+Sized_relobj_file<size, big_endian>::do_read_relocs(Read_relocs_data* rd)
 {
   rd->relocs.clear();
 
-  unsigned int sec_shnum = this->shnum();
-  if (sec_shnum == 0)
+  unsigned int shnum = this->shnum();
+  if (shnum == 0)
     return;
 
-  rd->relocs.reserve(sec_shnum / 2);
+  rd->relocs.reserve(shnum / 2);
 
   const Output_sections& out_sections(this->output_sections());
-  const std::vector<Address>& out_offsets(this->section_offsets_);
+  const std::vector<Address>& out_offsets(this->section_offsets());
 
-  const unsigned char *pshdrs = this->get_view(this->elf_file_.shoff(),
-                                              sec_shnum * This::shdr_size,
+  const unsigned charpshdrs = this->get_view(this->elf_file_.shoff(),
+                                              shnum * This::shdr_size,
                                               true, true);
   // Skip the first, dummy, section.
-  const unsigned char *ps = pshdrs + This::shdr_size;
-  for (unsigned int i = 1; i < sec_shnum; ++i, ps += This::shdr_size)
+  const unsigned charps = pshdrs + This::shdr_size;
+  for (unsigned int i = 1; i < shnum; ++i, ps += This::shdr_size)
     {
       typename This::Shdr shdr(ps);
 
@@ -262,7 +285,7 @@ Sized_relobj<size, big_endian>::do_read_relocs(Read_relocs_data* rd)
        continue;
 
       unsigned int shndx = this->adjust_shndx(shdr.get_sh_info());
-      if (shndx >= sec_shnum)
+      if (shndx >= shnum)
        {
          this->error(_("relocation section %u has bad info %u"),
                      i, shndx);
@@ -285,7 +308,8 @@ Sized_relobj<size, big_endian>::do_read_relocs(Read_relocs_data* rd)
                                   != 0);
       if (!is_section_allocated
          && !parameters->options().relocatable()
-         && !parameters->options().emit_relocs())
+         && !parameters->options().emit_relocs()
+         && !parameters->incremental())
        continue;
 
       if (this->adjust_shndx(shdr.get_sh_link()) != this->symtab_shndx_)
@@ -298,6 +322,9 @@ Sized_relobj<size, big_endian>::do_read_relocs(Read_relocs_data* rd)
 
       off_t sh_size = shdr.get_sh_size();
 
+      if (sh_size == 0)
+       continue;
+
       unsigned int reloc_size;
       if (sh_type == elfcpp::SHT_REL)
        reloc_size = elfcpp::Elf_sizes<size>::rel_size;
@@ -341,24 +368,24 @@ Sized_relobj<size, big_endian>::do_read_relocs(Read_relocs_data* rd)
       typename This::Shdr symtabshdr(pshdrs
                                     + this->symtab_shndx_ * This::shdr_size);
       gold_assert(symtabshdr.get_sh_type() == elfcpp::SHT_SYMTAB);
-      const int symsize = This::sym_size;
+      const int sym_size = This::sym_size;
       const unsigned int loccount = this->local_symbol_count_;
       gold_assert(loccount == symtabshdr.get_sh_info());
-      off_t locsize = loccount * symsize;
+      off_t locsize = loccount * sym_size;
       rd->local_symbols = this->get_lasting_view(symtabshdr.get_sh_offset(),
                                                 locsize, true, true);
     }
 }
 
 // Process the relocs to generate mappings from source sections to referenced
-// sections.  This is used during garbage colletion to determine garbage 
+// sections.  This is used during garbage collection to determine garbage
 // sections.
 
 template<int size, bool big_endian>
 void
-Sized_relobj<size, big_endian>::do_gc_process_relocs(Symbol_table* symtab,
-                                                    Layout* alayout,
-                                                    Read_relocs_data* rd)
+Sized_relobj_file<size, big_endian>::do_gc_process_relocs(Symbol_table* symtab,
+                                                         Layout* layout,
+                                                         Read_relocs_data* rd)
 {  
   Sized_target<size, big_endian>* target =
     parameters->sized_target<size, big_endian>();
@@ -379,7 +406,7 @@ Sized_relobj<size, big_endian>::do_gc_process_relocs(Symbol_table* symtab,
            // only scan allocated sections.  We may see a non-allocated
            // section here if we are emitting relocs.
            if (p->is_data_section_allocated)
-              target->gc_process_relocs(symtab, alayout, this, 
+              target->gc_process_relocs(symtab, layout, this, 
                                         p->data_shndx, p->sh_type, 
                                         p->contents->data(), p->reloc_count, 
                                         p->output_section,
@@ -396,8 +423,8 @@ Sized_relobj<size, big_endian>::do_gc_process_relocs(Symbol_table* symtab,
 
 template<int size, bool big_endian>
 void
-Sized_relobj<size, big_endian>::do_scan_relocs(Symbol_table* symtab,
-                                              Layout* alayout,
+Sized_relobj_file<size, big_endian>::do_scan_relocs(Symbol_table* symtab,
+                                              Layout* layout,
                                               Read_relocs_data* rd)
 {
   Sized_target<size, big_endian>* target =
@@ -409,6 +436,10 @@ Sized_relobj<size, big_endian>::do_scan_relocs(Symbol_table* symtab,
   else
     local_symbols = rd->local_symbols->data();
 
+  // For incremental links, allocate the counters for incremental relocations.
+  if (layout->incremental_inputs() != NULL)
+    this->allocate_incremental_reloc_counts();
+
   for (Read_relocs_data::Relocs_list::iterator p = rd->relocs.begin();
        p != rd->relocs.end();
        ++p)
@@ -428,21 +459,23 @@ Sized_relobj<size, big_endian>::do_scan_relocs(Symbol_table* symtab,
          // only scan allocated sections.  We may see a non-allocated
          // section here if we are emitting relocs.
          if (p->is_data_section_allocated)
-           target->scan_relocs(symtab, alayout, this, p->data_shndx,
+           target->scan_relocs(symtab, layout, this, p->data_shndx,
                                p->sh_type, p->contents->data(),
                                p->reloc_count, p->output_section,
                                p->needs_special_offset_handling,
                                this->local_symbol_count_,
                                local_symbols);
          if (parameters->options().emit_relocs())
-           this->emit_relocs_scan(symtab, alayout, local_symbols, p);
+           this->emit_relocs_scan(symtab, layout, local_symbols, p);
+         if (layout->incremental_inputs() != NULL)
+           this->incremental_relocs_scan(p);
        }
       else
        {
          Relocatable_relocs* rr = this->relocatable_relocs(p->reloc_shndx);
          gold_assert(rr != NULL);
          rr->set_reloc_count(p->reloc_count);
-         target->scan_relocatable_relocs(symtab, alayout, this,
+         target->scan_relocatable_relocs(symtab, layout, this,
                                          p->data_shndx, p->sh_type,
                                          p->contents->data(),
                                          p->reloc_count,
@@ -457,6 +490,10 @@ Sized_relobj<size, big_endian>::do_scan_relocs(Symbol_table* symtab,
       p->contents = NULL;
     }
 
+  // For incremental links, finalize the allocation of relocations.
+  if (layout->incremental_inputs() != NULL)
+    this->finalize_incremental_relocs(layout, true);
+
   if (rd->local_symbols != NULL)
     {
       delete rd->local_symbols;
@@ -503,9 +540,9 @@ class Emit_relocs_strategy
 
 template<int size, bool big_endian>
 void
-Sized_relobj<size, big_endian>::emit_relocs_scan(
+Sized_relobj_file<size, big_endian>::emit_relocs_scan(
     Symbol_table* symtab,
-    Layout* alayout,
+    Layout* layout,
     const unsigned char* plocal_syms,
     const Read_relocs_data::Relocs_list::iterator& p)
 {
@@ -514,12 +551,12 @@ Sized_relobj<size, big_endian>::emit_relocs_scan(
   rr->set_reloc_count(p->reloc_count);
 
   if (p->sh_type == elfcpp::SHT_REL)
-    this->emit_relocs_scan_reltype<elfcpp::SHT_REL>(symtab, alayout,
+    this->emit_relocs_scan_reltype<elfcpp::SHT_REL>(symtab, layout,
                                                    plocal_syms, p, rr);
   else
     {
       gold_assert(p->sh_type == elfcpp::SHT_RELA);
-      this->emit_relocs_scan_reltype<elfcpp::SHT_RELA>(symtab, alayout,
+      this->emit_relocs_scan_reltype<elfcpp::SHT_RELA>(symtab, layout,
                                                       plocal_syms, p, rr);
     }
 }
@@ -530,9 +567,9 @@ Sized_relobj<size, big_endian>::emit_relocs_scan(
 template<int size, bool big_endian>
 template<int sh_type>
 void
-Sized_relobj<size, big_endian>::emit_relocs_scan_reltype(
+Sized_relobj_file<size, big_endian>::emit_relocs_scan_reltype(
     Symbol_table* symtab,
-    Layout* alayout,
+    Layout* layout,
     const unsigned char* plocal_syms,
     const Read_relocs_data::Relocs_list::iterator& p,
     Relocatable_relocs* rr)
@@ -540,7 +577,7 @@ Sized_relobj<size, big_endian>::emit_relocs_scan_reltype(
   scan_relocatable_relocs<size, big_endian, sh_type,
                          Emit_relocs_strategy<sh_type> >(
     symtab,
-    alayout,
+    layout,
     this,
     p->data_shndx,
     p->contents->data(),
@@ -552,29 +589,77 @@ Sized_relobj<size, big_endian>::emit_relocs_scan_reltype(
     rr);
 }
 
+// Scan the input relocations for --incremental.
+
+template<int size, bool big_endian>
+void
+Sized_relobj_file<size, big_endian>::incremental_relocs_scan(
+    const Read_relocs_data::Relocs_list::iterator& p)
+{
+  if (p->sh_type == elfcpp::SHT_REL)
+    this->incremental_relocs_scan_reltype<elfcpp::SHT_REL>(p);
+  else
+    {
+      gold_assert(p->sh_type == elfcpp::SHT_RELA);
+      this->incremental_relocs_scan_reltype<elfcpp::SHT_RELA>(p);
+    }
+}
+
+// Scan the input relocation for --incremental, templatized on the
+// type of the relocation section.
+
+template<int size, bool big_endian>
+template<int sh_type>
+void
+Sized_relobj_file<size, big_endian>::incremental_relocs_scan_reltype(
+    const Read_relocs_data::Relocs_list::iterator& p)
+{
+  typedef typename Reloc_types<sh_type, size, big_endian>::Reloc Reltype;
+  const int reloc_size = Reloc_types<sh_type, size, big_endian>::reloc_size;
+  const unsigned char* prelocs = p->contents->data();
+  size_t reloc_count = p->reloc_count;
+
+  for (size_t i = 0; i < reloc_count; ++i, prelocs += reloc_size)
+    {
+      Reltype reloc(prelocs);
+
+      if (p->needs_special_offset_handling
+         && !p->output_section->is_input_address_mapped(this, p->data_shndx,
+                                                        reloc.get_r_offset()))
+       continue;
+
+      typename elfcpp::Elf_types<size>::Elf_WXword r_info =
+         reloc.get_r_info();
+      const unsigned int r_sym = elfcpp::elf_r_sym<size>(r_info);
+
+      if (r_sym >= this->local_symbol_count_)
+       this->count_incremental_reloc(r_sym - this->local_symbol_count_);
+    }
+}
+
 // Relocate the input sections and write out the local symbols.
 
 template<int size, bool big_endian>
 void
-Sized_relobj<size, big_endian>::do_relocate(const Symbol_table* symtab,
-                                           const Layout* alayout,
-                                           Output_file* of)
+Sized_relobj_file<size, big_endian>::do_relocate(const Symbol_table* symtab,
+                                                const Layout* layout,
+                                                Output_file* of)
 {
-  unsigned int sec_shnum = this->shnum();
+  unsigned int shnum = this->shnum();
 
   // Read the section headers.
   const unsigned char* pshdrs = this->get_view(this->elf_file_.shoff(),
-                                              sec_shnum * This::shdr_size,
+                                              shnum * This::shdr_size,
                                               true, true);
 
   Views views;
-  views.resize(sec_shnum);
+  views.resize(shnum);
 
   // Make two passes over the sections.  The first one copies the
   // section data to the output file.  The second one applies
   // relocations.
 
-  this->write_sections(pshdrs, of, &views);
+  this->write_sections(layout, pshdrs, of, &views);
 
   // To speed up relocations, we set up hash tables for fast lookup of
   // input offsets to output addresses.
@@ -582,17 +667,19 @@ Sized_relobj<size, big_endian>::do_relocate(const Symbol_table* symtab,
 
   // Apply relocations.
 
-  this->relocate_sections(symtab, alayout, pshdrs, &views);
+  this->relocate_sections(symtab, layout, pshdrs, of, &views);
 
   // After we've done the relocations, we release the hash tables,
   // since we no longer need them.
   this->free_input_to_output_maps();
 
   // Write out the accumulated views.
-  for (unsigned int i = 1; i < sec_shnum; ++i)
+  for (unsigned int i = 1; i < shnum; ++i)
     {
       if (views[i].view != NULL)
        {
+         if (views[i].is_ctors_reverse_view)
+           this->reverse_words(views[i].view, views[i].view_size);
          if (!views[i].is_postprocessing_view)
            {
              if (views[i].is_input_output_view)
@@ -607,11 +694,9 @@ Sized_relobj<size, big_endian>::do_relocate(const Symbol_table* symtab,
     }
 
   // Write out the local symbols.
-  this->write_local_symbols(of, alayout->sympool(), alayout->dynpool(),
-                           alayout->symtab_xindex(), alayout->dynsym_xindex());
-
-  // We should no longer need the local symbol values.
-  this->clear_local_symbols();
+  this->write_local_symbols(of, layout->sympool(), layout->dynpool(),
+                           layout->symtab_xindex(), layout->dynsym_xindex(),
+                           layout->symtab_section_offset());
 }
 
 // Sort a Read_multiple vector by file offset.
@@ -629,19 +714,20 @@ struct Read_multiple_compare
 
 template<int size, bool big_endian>
 void
-Sized_relobj<size, big_endian>::write_sections(const unsigned char* pshdrs,
-                                              Output_file* of,
-                                              Views* pviews)
+Sized_relobj_file<size, big_endian>::write_sections(const Layout* layout,
+                                                   const unsigned char* pshdrs,
+                                                   Output_file* of,
+                                                   Views* pviews)
 {
-  unsigned int sec_shnum = this->shnum();
+  unsigned int shnum = this->shnum();
   const Output_sections& out_sections(this->output_sections());
-  const std::vector<Address>& out_offsets(this->section_offsets_);
+  const std::vector<Address>& out_offsets(this->section_offsets());
 
   File_read::Read_multiple rm;
   bool is_sorted = true;
 
   const unsigned char* p = pshdrs + This::shdr_size;
-  for (unsigned int i = 1; i < sec_shnum; ++i, p += This::shdr_size)
+  for (unsigned int i = 1; i < shnum; ++i, p += This::shdr_size)
     {
       View_size* pvs = &(*pviews)[i];
 
@@ -678,6 +764,7 @@ Sized_relobj<size, big_endian>::write_sections(const unsigned char* pshdrs,
          pvs->address = posd->address();
          pvs->is_input_output_view = false;
          pvs->is_postprocessing_view = false;
+         pvs->is_ctors_reverse_view = false;
 
          continue;
        }
@@ -702,30 +789,37 @@ Sized_relobj<size, big_endian>::write_sections(const unsigned char* pshdrs,
       // buffer, and the output section is responsible for writing the
       // final data to the output file.
 
-      off_t out_section_offset;
+      off_t output_section_offset;
       Address output_section_size;
       if (!os->requires_postprocessing())
        {
-         out_section_offset = os->offset();
+         output_section_offset = os->offset();
          output_section_size = convert_types<Address, off_t>(os->data_size());
        }
       else
        {
-         out_section_offset = 0;
+         output_section_offset = 0;
          output_section_size =
               convert_types<Address, off_t>(os->postprocessing_buffer_size());
        }
 
       off_t view_start;
       section_size_type view_size;
+      bool must_decompress = false;
       if (output_offset != invalid_address)
        {
-         view_start = out_section_offset + output_offset;
+         view_start = output_section_offset + output_offset;
          view_size = convert_to_section_size_type(shdr.get_sh_size());
+         section_size_type uncompressed_size;
+         if (this->section_is_compressed(i, &uncompressed_size))
+           {
+             view_size = uncompressed_size;
+             must_decompress = true;
+           }
        }
       else
        {
-         view_start = out_section_offset;
+         view_start = output_section_offset;
          view_size = convert_to_section_size_type(output_section_size);
        }
 
@@ -735,36 +829,49 @@ Sized_relobj<size, big_endian>::write_sections(const unsigned char* pshdrs,
       gold_assert(output_offset == invalid_address
                  || output_offset + view_size <= output_section_size);
 
-      unsigned char* aview;
+      unsigned char* view;
       if (os->requires_postprocessing())
        {
          unsigned char* buffer = os->postprocessing_buffer();
-         aview = buffer + view_start;
-         if (output_offset != invalid_address)
+         view = buffer + view_start;
+         if (output_offset != invalid_address && !must_decompress)
            {
              off_t sh_offset = shdr.get_sh_offset();
              if (!rm.empty() && rm.back().file_offset > sh_offset)
                is_sorted = false;
              rm.push_back(File_read::Read_multiple_entry(sh_offset,
-                                                         view_size, aview));
+                                                         view_size, view));
            }
        }
       else
        {
          if (output_offset == invalid_address)
-           aview = of->get_input_output_view(view_start, view_size);
+           view = of->get_input_output_view(view_start, view_size);
          else
            {
-             aview = of->get_output_view(view_start, view_size);
-             off_t sh_offset = shdr.get_sh_offset();
-             if (!rm.empty() && rm.back().file_offset > sh_offset)
-               is_sorted = false;
-             rm.push_back(File_read::Read_multiple_entry(sh_offset,
-                                                         view_size, aview));
+             view = of->get_output_view(view_start, view_size);
+             if (!must_decompress)
+               {
+                 off_t sh_offset = shdr.get_sh_offset();
+                 if (!rm.empty() && rm.back().file_offset > sh_offset)
+                   is_sorted = false;
+                 rm.push_back(File_read::Read_multiple_entry(sh_offset,
+                                                             view_size, view));
+               }
            }
        }
 
-      pvs->view = aview;
+      if (must_decompress)
+        {
+         // Read and decompress the section.
+          section_size_type len;
+         const unsigned char* p = this->section_contents(i, &len, false);
+         if (!decompress_input_section(p, len, view, view_size))
+           this->error(_("could not decompress section %s"),
+                       this->section_name(i).c_str());
+        }
+
+      pvs->view = view;
       pvs->address = os->address();
       if (output_offset != invalid_address)
        pvs->address += output_offset;
@@ -772,6 +879,12 @@ Sized_relobj<size, big_endian>::write_sections(const unsigned char* pshdrs,
       pvs->view_size = view_size;
       pvs->is_input_output_view = output_offset == invalid_address;
       pvs->is_postprocessing_view = os->requires_postprocessing();
+      pvs->is_ctors_reverse_view =
+       (!parameters->options().relocatable()
+        && view_size > size / 8
+        && (strcmp(os->name(), ".init_array") == 0
+            || strcmp(os->name(), ".fini_array") == 0)
+        && layout->is_ctors_in_init_array(this, i));
     }
 
   // Actually read the data.
@@ -788,26 +901,27 @@ Sized_relobj<size, big_endian>::write_sections(const unsigned char* pshdrs,
 
 template<int size, bool big_endian>
 void
-Sized_relobj<size, big_endian>::do_relocate_sections(
+Sized_relobj_file<size, big_endian>::do_relocate_sections(
     const Symbol_table* symtab,
-    const Layout* alayout,
+    const Layout* layout,
     const unsigned char* pshdrs,
+    Output_file* of,
     Views* pviews)
 {
-  unsigned int sec_shnum = this->shnum();
+  unsigned int shnum = this->shnum();
   Sized_target<size, big_endian>* target =
     parameters->sized_target<size, big_endian>();
 
   const Output_sections& out_sections(this->output_sections());
-  const std::vector<Address>& out_offsets(this->section_offsets_);
+  const std::vector<Address>& out_offsets(this->section_offsets());
 
   Relocate_info<size, big_endian> relinfo;
   relinfo.symtab = symtab;
-  relinfo.layout = alayout;
+  relinfo.layout = layout;
   relinfo.object = this;
 
   const unsigned char* p = pshdrs + This::shdr_size;
-  for (unsigned int i = 1; i < sec_shnum; ++i, p += This::shdr_size)
+  for (unsigned int i = 1; i < shnum; ++i, p += This::shdr_size)
     {
       typename This::Shdr shdr(p);
 
@@ -880,7 +994,7 @@ Sized_relobj<size, big_endian>::do_relocate_sections(
       relinfo.reloc_shdr = p;
       relinfo.data_shndx = index;
       relinfo.data_shdr = pshdrs + index * This::shdr_size;
-      unsigned char* aview = (*pviews)[index].view;
+      unsigned char* view = (*pviews)[index].view;
       Address address = (*pviews)[index].address;
       section_size_type view_size = (*pviews)[index].view_size;
 
@@ -890,7 +1004,7 @@ Sized_relobj<size, big_endian>::do_relocate_sections(
          typename This::Shdr data_shdr(pshdrs + index * This::shdr_size);
          if ((data_shdr.get_sh_flags() & elfcpp::SHF_EXECINSTR) != 0)
            this->split_stack_adjust(symtab, pshdrs, sh_type, index,
-                                    prelocs, reloc_count, aview, view_size,
+                                    prelocs, reloc_count, view, view_size,
                                     &reloc_map);
        }
 
@@ -898,91 +1012,151 @@ Sized_relobj<size, big_endian>::do_relocate_sections(
        {
          target->relocate_section(&relinfo, sh_type, prelocs, reloc_count, os,
                                   output_offset == invalid_address,
-                                  aview, address, view_size, reloc_map);
+                                  view, address, view_size, reloc_map);
          if (parameters->options().emit_relocs())
-           this->emit_relocs(&relinfo, i, sh_type, prelocs, reloc_count,
-                             os, output_offset, aview, address, view_size,
-                             (*pviews)[i].view, (*pviews)[i].view_size);
+           {
+             Relocatable_relocs* rr = this->relocatable_relocs(i);
+             target->relocate_relocs(&relinfo, sh_type, prelocs, reloc_count,
+                                     os, output_offset, rr,
+                                     view, address, view_size,
+                                     (*pviews)[i].view,
+                                     (*pviews)[i].view_size);
+           }
+         if (parameters->incremental())
+           this->incremental_relocs_write(&relinfo, sh_type, prelocs,
+                                          reloc_count, os, output_offset, of);
        }
       else
        {
          Relocatable_relocs* rr = this->relocatable_relocs(i);
-         target->relocate_for_relocatable(&relinfo, sh_type, prelocs,
-                                          reloc_count, os, output_offset, rr,
-                                          aview, address, view_size,
-                                          (*pviews)[i].view,
-                                          (*pviews)[i].view_size);
+         target->relocate_relocs(&relinfo, sh_type, prelocs, reloc_count,
+                                 os, output_offset, rr,
+                                 view, address, view_size,
+                                 (*pviews)[i].view,
+                                 (*pviews)[i].view_size);
        }
     }
 }
 
-// Emit the relocs for --emit-relocs.
+// Write the incremental relocs.
 
 template<int size, bool big_endian>
 void
-Sized_relobj<size, big_endian>::emit_relocs(
+Sized_relobj_file<size, big_endian>::incremental_relocs_write(
     const Relocate_info<size, big_endian>* relinfo,
-    unsigned int i,
     unsigned int sh_type,
     const unsigned char* prelocs,
     size_t reloc_count,
-    Output_section* aoutput_section,
-    typename elfcpp::Elf_types<size>::Elf_Addr offset_in_output_section,
-    unsigned char* aview,
-    typename elfcpp::Elf_types<size>::Elf_Addr address,
-    section_size_type view_size,
-    unsigned char* reloc_view,
-    section_size_type reloc_view_size)
+    Output_section* output_section,
+    Address output_offset,
+    Output_file* of)
 {
   if (sh_type == elfcpp::SHT_REL)
-    this->emit_relocs_reltype<elfcpp::SHT_REL>(relinfo, i, prelocs,
-                                              reloc_count, aoutput_section,
-                                              offset_in_output_section,
-                                              aview, address, view_size,
-                                              reloc_view, reloc_view_size);
+    this->incremental_relocs_write_reltype<elfcpp::SHT_REL>(
+       relinfo,
+       prelocs,
+       reloc_count,
+       output_section,
+       output_offset,
+       of);
   else
     {
       gold_assert(sh_type == elfcpp::SHT_RELA);
-      this->emit_relocs_reltype<elfcpp::SHT_RELA>(relinfo, i, prelocs,
-                                                 reloc_count, aoutput_section,
-                                                 offset_in_output_section,
-                                                 aview, address, view_size,
-                                                 reloc_view, reloc_view_size);
+      this->incremental_relocs_write_reltype<elfcpp::SHT_RELA>(
+         relinfo,
+         prelocs,
+         reloc_count,
+         output_section,
+         output_offset,
+         of);
     }
 }
 
-// Emit the relocs for --emit-relocs, templatized on the type of the
+// Write the incremental relocs, templatized on the type of the
 // relocation section.
 
 template<int size, bool big_endian>
 template<int sh_type>
 void
-Sized_relobj<size, big_endian>::emit_relocs_reltype(
+Sized_relobj_file<size, big_endian>::incremental_relocs_write_reltype(
     const Relocate_info<size, big_endian>* relinfo,
-    unsigned int i,
     const unsigned char* prelocs,
     size_t reloc_count,
-    Output_section* aoutput_section,
-    typename elfcpp::Elf_types<size>::Elf_Addr offset_in_output_section,
-    unsigned char* aview,
-    typename elfcpp::Elf_types<size>::Elf_Addr address,
-    section_size_type view_size,
-    unsigned char* reloc_view,
-    section_size_type reloc_view_size)
+    Output_section* output_section,
+    Address output_offset,
+    Output_file* of)
 {
-  const Relocatable_relocs* rr = this->relocatable_relocs(i);
-  relocate_for_relocatable<size, big_endian, sh_type>(
-    relinfo,
-    prelocs,
-    reloc_count,
-    aoutput_section,
-    offset_in_output_section,
-    rr,
-    aview,
-    address,
-    view_size,
-    reloc_view,
-    reloc_view_size);
+  typedef typename Reloc_types<sh_type, size, big_endian>::Reloc Reloc;
+  const unsigned int reloc_size =
+      Reloc_types<sh_type, size, big_endian>::reloc_size;
+  const unsigned int sizeof_addr = size / 8;
+  const unsigned int incr_reloc_size =
+      Incremental_relocs_reader<size, big_endian>::reloc_size;
+
+  unsigned int out_shndx = output_section->out_shndx();
+
+  // Get a view for the .gnu_incremental_relocs section.
+
+  Incremental_inputs* inputs = relinfo->layout->incremental_inputs();
+  gold_assert(inputs != NULL);
+  const off_t relocs_off = inputs->relocs_section()->offset();
+  const off_t relocs_size = inputs->relocs_section()->data_size();
+  unsigned char* const view = of->get_output_view(relocs_off, relocs_size);
+
+  for (size_t i = 0; i < reloc_count; ++i, prelocs += reloc_size)
+    {
+      Reloc reloc(prelocs);
+
+      typename elfcpp::Elf_types<size>::Elf_WXword r_info = reloc.get_r_info();
+      const unsigned int r_sym = elfcpp::elf_r_sym<size>(r_info);
+      const unsigned int r_type = elfcpp::elf_r_type<size>(r_info);
+
+      if (r_sym < this->local_symbol_count_)
+        continue;
+
+      // Get the new offset--the location in the output section where
+      // this relocation should be applied.
+
+      Address offset = reloc.get_r_offset();
+      if (output_offset != invalid_address)
+       offset += output_offset;
+      else
+       {
+          section_offset_type sot_offset =
+              convert_types<section_offset_type, Address>(offset);
+         section_offset_type new_sot_offset =
+             output_section->output_offset(relinfo->object,
+                                           relinfo->data_shndx,
+                                           sot_offset);
+         gold_assert(new_sot_offset != -1);
+         offset += new_sot_offset;
+       }
+
+      // Get the addend.
+      typename elfcpp::Elf_types<size>::Elf_Swxword addend;
+      if (sh_type == elfcpp::SHT_RELA)
+       addend =
+           Reloc_types<sh_type, size, big_endian>::get_reloc_addend(&reloc);
+      else
+        {
+          // FIXME: Get the addend for SHT_REL.
+          addend = 0;
+        }
+
+      // Get the index of the output relocation.
+
+      unsigned int reloc_index =
+          this->next_incremental_reloc_index(r_sym - this->local_symbol_count_);
+
+      // Write the relocation.
+
+      unsigned char* pov = view + reloc_index * incr_reloc_size;
+      elfcpp::Swap<32, big_endian>::writeval(pov, r_type);
+      elfcpp::Swap<32, big_endian>::writeval(pov + 4, out_shndx);
+      elfcpp::Swap<size, big_endian>::writeval(pov + 8, offset);
+      elfcpp::Swap<size, big_endian>::writeval(pov + 8 + sizeof_addr, addend);
+      of->write_output_view(pov - view, incr_reloc_size, view);
+    }
 }
 
 // Create merge hash tables for the local symbols.  These are used to
@@ -990,7 +1164,7 @@ Sized_relobj<size, big_endian>::emit_relocs_reltype(
 
 template<int size, bool big_endian>
 void
-Sized_relobj<size, big_endian>::initialize_input_to_output_maps()
+Sized_relobj_file<size, big_endian>::initialize_input_to_output_maps()
 {
   const unsigned int loccount = this->local_symbol_count_;
   for (unsigned int i = 1; i < loccount; ++i)
@@ -1004,7 +1178,7 @@ Sized_relobj<size, big_endian>::initialize_input_to_output_maps()
 
 template<int size, bool big_endian>
 void
-Sized_relobj<size, big_endian>::free_input_to_output_maps()
+Sized_relobj_file<size, big_endian>::free_input_to_output_maps()
 {
   const unsigned int loccount = this->local_symbol_count_;
   for (unsigned int i = 1; i < loccount; ++i)
@@ -1022,28 +1196,28 @@ Sized_relobj<size, big_endian>::free_input_to_output_maps()
 
 template<int size, bool big_endian>
 void
-Sized_relobj<size, big_endian>::split_stack_adjust(
+Sized_relobj_file<size, big_endian>::split_stack_adjust(
     const Symbol_table* symtab,
     const unsigned char* pshdrs,
     unsigned int sh_type,
     unsigned int shndx,
     const unsigned char* prelocs,
     size_t reloc_count,
-    unsigned char* aview,
+    unsigned char* view,
     section_size_type view_size,
     Reloc_symbol_changes** reloc_map)
 {
   if (sh_type == elfcpp::SHT_REL)
     this->split_stack_adjust_reltype<elfcpp::SHT_REL>(symtab, pshdrs, shndx,
                                                      prelocs, reloc_count,
-                                                     aview, view_size,
+                                                     view, view_size,
                                                      reloc_map);
   else
     {
       gold_assert(sh_type == elfcpp::SHT_RELA);
       this->split_stack_adjust_reltype<elfcpp::SHT_RELA>(symtab, pshdrs, shndx,
                                                         prelocs, reloc_count,
-                                                        aview, view_size,
+                                                        view, view_size,
                                                         reloc_map);
     }
 }
@@ -1054,13 +1228,13 @@ Sized_relobj<size, big_endian>::split_stack_adjust(
 template<int size, bool big_endian>
 template<int sh_type>
 void
-Sized_relobj<size, big_endian>::split_stack_adjust_reltype(
+Sized_relobj_file<size, big_endian>::split_stack_adjust_reltype(
     const Symbol_table* symtab,
     const unsigned char* pshdrs,
     unsigned int shndx,
     const unsigned char* prelocs,
     size_t reloc_count,
-    unsigned char* aview,
+    unsigned char* view,
     section_size_type view_size,
     Reloc_symbol_changes** reloc_map)
 {
@@ -1092,14 +1266,17 @@ Sized_relobj<size, big_endian>::split_stack_adjust_reltype(
       // cases we will ask for a large stack unnecessarily, but this
       // is not fatal.  FIXME: Some targets have symbols which are
       // functions but are not type STT_FUNC, e.g., STT_ARM_TFUNC.
-      if (gsym->type() == elfcpp::STT_FUNC
-         && !gsym->is_undefined()
+      if (!gsym->is_undefined()
          && gsym->source() == Symbol::FROM_OBJECT
          && !gsym->object()->uses_split_stack())
        {
-         section_offset_type off =
-           convert_to_section_size_type(reloc.get_r_offset());
-         non_split_refs.push_back(off);
+         unsigned int r_type = elfcpp::elf_r_type<size>(reloc.get_r_info());
+         if (parameters->target().is_call_to_non_split(gsym, r_type))
+           {
+             section_offset_type offset =
+               convert_to_section_size_type(reloc.get_r_offset());
+             non_split_refs.push_back(offset);
+           }
        }
     }
 
@@ -1152,7 +1329,7 @@ Sized_relobj<size, big_endian>::split_stack_adjust_reltype(
       std::string from;
       std::string to;
       parameters->target().calls_non_split(this, shndx, p->first, p->second,
-                                          aview, view_size, &from, &to);
+                                          view, view_size, &from, &to);
       if (!from.empty())
        {
          gold_assert(!to.empty());
@@ -1171,10 +1348,10 @@ Sized_relobj<size, big_endian>::split_stack_adjust_reltype(
              if (r_sym < local_count)
                continue;
 
-             section_offset_type off =
+             section_offset_type offset =
                convert_to_section_size_type(reloc.get_r_offset());
-             if (off < p->first
-                 || (off
+             if (offset < p->first
+                 || (offset
                      >= (p->first
                          + static_cast<section_offset_type>(p->second))))
                continue;
@@ -1208,16 +1385,16 @@ Sized_relobj<size, big_endian>::split_stack_adjust_reltype(
 
 template<int size, bool big_endian>
 void
-Sized_relobj<size, big_endian>::find_functions(
+Sized_relobj_file<size, big_endian>::find_functions(
     const unsigned char* pshdrs,
     unsigned int shndx,
-    Sized_relobj<size, big_endian>::Function_offsets* function_offsets)
+    Sized_relobj_file<size, big_endian>::Function_offsets* function_offsets)
 {
   // We need to read the symbols to find the functions.  If we wanted
   // to, we could cache reading the symbols across all sections in the
   // object.
-  const unsigned int sym_tab_shndx = this->symtab_shndx_;
-  typename This::Shdr symtabshdr(pshdrs + sym_tab_shndx * This::shdr_size);
+  const unsigned int symtab_shndx = this->symtab_shndx_;
+  typename This::Shdr symtabshdr(pshdrs + symtab_shndx * This::shdr_size);
   gold_assert(symtabshdr.get_sh_type() == elfcpp::SHT_SYMTAB);
 
   typename elfcpp::Elf_types<size>::Elf_WXword sh_size =
@@ -1225,9 +1402,9 @@ Sized_relobj<size, big_endian>::find_functions(
   const unsigned char* psyms = this->get_view(symtabshdr.get_sh_offset(),
                                              sh_size, true, true);
 
-  const int symsize = This::sym_size;
-  const unsigned int symcount = sh_size / symsize;
-  for (unsigned int i = 0; i < symcount; ++i, psyms += symsize)
+  const int sym_size = This::sym_size;
+  const unsigned int symcount = sh_size / sym_size;
+  for (unsigned int i = 0; i < symcount; ++i, psyms += sym_size)
     {
       typename elfcpp::Sym<size, big_endian> isym(psyms);
 
@@ -1252,6 +1429,26 @@ Sized_relobj<size, big_endian>::find_functions(
     }
 }
 
+// Reverse the words in a section.  Used for .ctors sections mapped to
+// .init_array sections.  See ctors_sections_in_init_array in
+// layout.cc.
+
+template<int size, bool big_endian>
+void
+Sized_relobj_file<size, big_endian>::reverse_words(unsigned char* view,
+                                                  section_size_type view_size)
+{
+  typedef typename elfcpp::Swap<size, big_endian>::Valtype Valtype;
+  Valtype* vview = reinterpret_cast<Valtype*>(view);
+  section_size_type vview_size = view_size / (size / 8);
+  for (section_size_type i = 0; i < vview_size / 2; ++i)
+    {
+      Valtype tmp = vview[i];
+      vview[i] = vview[vview_size - 1 - i];
+      vview[vview_size - 1 - i] = tmp;
+    }
+}
+
 // Class Merged_symbol_value.
 
 template<int size>
@@ -1368,6 +1565,20 @@ Track_relocs<size, big_endian>::next_symndx() const
   return elfcpp::elf_r_sym<size>(rel.get_r_info());
 }
 
+// Return the addend of the next reloc, or 0 if there isn't one.
+
+template<int size, bool big_endian>
+uint64_t
+Track_relocs<size, big_endian>::next_addend() const
+{
+  if (this->pos_ >= this->len_)
+    return 0;
+  if (this->reloc_size_ == elfcpp::Elf_sizes<size>::rel_size)
+    return 0;
+  elfcpp::Rela<size, big_endian> rela(this->prelocs_ + this->pos_);
+  return rela.get_r_addend();
+}
+
 // Advance to the next reloc whose r_offset is greater than or equal
 // to OFFSET.  Return the number of relocs we skip.
 
@@ -1394,201 +1605,205 @@ Track_relocs<size, big_endian>::advance(off_t offset)
 #ifdef HAVE_TARGET_32_LITTLE
 template
 void
-Sized_relobj<32, false>::do_read_relocs(Read_relocs_data* rd);
+Sized_relobj_file<32, false>::do_read_relocs(Read_relocs_data* rd);
 #endif
 
 #ifdef HAVE_TARGET_32_BIG
 template
 void
-Sized_relobj<32, true>::do_read_relocs(Read_relocs_data* rd);
+Sized_relobj_file<32, true>::do_read_relocs(Read_relocs_data* rd);
 #endif
 
 #ifdef HAVE_TARGET_64_LITTLE
 template
 void
-Sized_relobj<64, false>::do_read_relocs(Read_relocs_data* rd);
+Sized_relobj_file<64, false>::do_read_relocs(Read_relocs_data* rd);
 #endif
 
 #ifdef HAVE_TARGET_64_BIG
 template
 void
-Sized_relobj<64, true>::do_read_relocs(Read_relocs_data* rd);
+Sized_relobj_file<64, true>::do_read_relocs(Read_relocs_data* rd);
 #endif
 
 #ifdef HAVE_TARGET_32_LITTLE
 template
 void
-Sized_relobj<32, false>::do_gc_process_relocs(Symbol_table* symtab,
-                                             Layout* alayout,
-                                             Read_relocs_data* rd);
+Sized_relobj_file<32, false>::do_gc_process_relocs(Symbol_table* symtab,
+                                                  Layout* layout,
+                                                  Read_relocs_data* rd);
 #endif
 
 #ifdef HAVE_TARGET_32_BIG
 template
 void
-Sized_relobj<32, true>::do_gc_process_relocs(Symbol_table* symtab,
-                                            Layout* alayout,
-                                            Read_relocs_data* rd);
+Sized_relobj_file<32, true>::do_gc_process_relocs(Symbol_table* symtab,
+                                                 Layout* layout,
+                                                 Read_relocs_data* rd);
 #endif
 
 #ifdef HAVE_TARGET_64_LITTLE
 template
 void
-Sized_relobj<64, false>::do_gc_process_relocs(Symbol_table* symtab,
-                                             Layout* alayout,
-                                             Read_relocs_data* rd);
+Sized_relobj_file<64, false>::do_gc_process_relocs(Symbol_table* symtab,
+                                                  Layout* layout,
+                                                  Read_relocs_data* rd);
 #endif
 
 #ifdef HAVE_TARGET_64_BIG
 template
 void
-Sized_relobj<64, true>::do_gc_process_relocs(Symbol_table* symtab,
-                                            Layout* alayout,
-                                            Read_relocs_data* rd);
+Sized_relobj_file<64, true>::do_gc_process_relocs(Symbol_table* symtab,
+                                                 Layout* layout,
+                                                 Read_relocs_data* rd);
 #endif
 
 #ifdef HAVE_TARGET_32_LITTLE
 template
 void
-Sized_relobj<32, false>::do_scan_relocs(Symbol_table* symtab,
-                                       Layout* alayout,
-                                       Read_relocs_data* rd);
+Sized_relobj_file<32, false>::do_scan_relocs(Symbol_table* symtab,
+                                            Layout* layout,
+                                            Read_relocs_data* rd);
 #endif
 
 #ifdef HAVE_TARGET_32_BIG
 template
 void
-Sized_relobj<32, true>::do_scan_relocs(Symbol_table* symtab,
-                                      Layout* alayout,
-                                      Read_relocs_data* rd);
+Sized_relobj_file<32, true>::do_scan_relocs(Symbol_table* symtab,
+                                           Layout* layout,
+                                           Read_relocs_data* rd);
 #endif
 
 #ifdef HAVE_TARGET_64_LITTLE
 template
 void
-Sized_relobj<64, false>::do_scan_relocs(Symbol_table* symtab,
-                                       Layout* alayout,
-                                       Read_relocs_data* rd);
+Sized_relobj_file<64, false>::do_scan_relocs(Symbol_table* symtab,
+                                            Layout* layout,
+                                            Read_relocs_data* rd);
 #endif
 
 #ifdef HAVE_TARGET_64_BIG
 template
 void
-Sized_relobj<64, true>::do_scan_relocs(Symbol_table* symtab,
-                                      Layout* alayout,
-                                      Read_relocs_data* rd);
+Sized_relobj_file<64, true>::do_scan_relocs(Symbol_table* symtab,
+                                           Layout* layout,
+                                           Read_relocs_data* rd);
 #endif
 
 #ifdef HAVE_TARGET_32_LITTLE
 template
 void
-Sized_relobj<32, false>::do_relocate(const Symbol_table* symtab,
-                                    const Layout* alayout,
-                                    Output_file* of);
+Sized_relobj_file<32, false>::do_relocate(const Symbol_table* symtab,
+                                         const Layout* layout,
+                                         Output_file* of);
 #endif
 
 #ifdef HAVE_TARGET_32_BIG
 template
 void
-Sized_relobj<32, true>::do_relocate(const Symbol_table* symtab,
-                                   const Layout* alayout,
-                                   Output_file* of);
+Sized_relobj_file<32, true>::do_relocate(const Symbol_table* symtab,
+                                        const Layout* layout,
+                                        Output_file* of);
 #endif
 
 #ifdef HAVE_TARGET_64_LITTLE
 template
 void
-Sized_relobj<64, false>::do_relocate(const Symbol_table* symtab,
-                                    const Layout* alayout,
-                                    Output_file* of);
+Sized_relobj_file<64, false>::do_relocate(const Symbol_table* symtab,
+                                         const Layout* layout,
+                                         Output_file* of);
 #endif
 
 #ifdef HAVE_TARGET_64_BIG
 template
 void
-Sized_relobj<64, true>::do_relocate(const Symbol_table* symtab,
-                                   const Layout* alayout,
-                                   Output_file* of);
+Sized_relobj_file<64, true>::do_relocate(const Symbol_table* symtab,
+                                        const Layout* layout,
+                                        Output_file* of);
 #endif
 
 #ifdef HAVE_TARGET_32_LITTLE
 template
 void
-Sized_relobj<32, false>::do_relocate_sections(
+Sized_relobj_file<32, false>::do_relocate_sections(
     const Symbol_table* symtab,
-    const Layout* alayout,
+    const Layout* layout,
     const unsigned char* pshdrs,
+    Output_file* of,
     Views* pviews);
 #endif
 
 #ifdef HAVE_TARGET_32_BIG
 template
 void
-Sized_relobj<32, true>::do_relocate_sections(
+Sized_relobj_file<32, true>::do_relocate_sections(
     const Symbol_table* symtab,
-    const Layout* alayout,
+    const Layout* layout,
     const unsigned char* pshdrs,
+    Output_file* of,
     Views* pviews);
 #endif
 
 #ifdef HAVE_TARGET_64_LITTLE
 template
 void
-Sized_relobj<64, false>::do_relocate_sections(
+Sized_relobj_file<64, false>::do_relocate_sections(
     const Symbol_table* symtab,
-    const Layout* alayout,
+    const Layout* layout,
     const unsigned char* pshdrs,
+    Output_file* of,
     Views* pviews);
 #endif
 
 #ifdef HAVE_TARGET_64_BIG
 template
 void
-Sized_relobj<64, true>::do_relocate_sections(
+Sized_relobj_file<64, true>::do_relocate_sections(
     const Symbol_table* symtab,
     const Layout* layout,
     const unsigned char* pshdrs,
+    Output_file* of,
     Views* pviews);
 #endif
 
 #ifdef HAVE_TARGET_32_LITTLE
 template
 void
-Sized_relobj<32, false>::initialize_input_to_output_maps();
+Sized_relobj_file<32, false>::initialize_input_to_output_maps();
 
 template
 void
-Sized_relobj<32, false>::free_input_to_output_maps();
+Sized_relobj_file<32, false>::free_input_to_output_maps();
 #endif
 
 #ifdef HAVE_TARGET_32_BIG
 template
 void
-Sized_relobj<32, true>::initialize_input_to_output_maps();
+Sized_relobj_file<32, true>::initialize_input_to_output_maps();
 
 template
 void
-Sized_relobj<32, true>::free_input_to_output_maps();
+Sized_relobj_file<32, true>::free_input_to_output_maps();
 #endif
 
 #ifdef HAVE_TARGET_64_LITTLE
 template
 void
-Sized_relobj<64, false>::initialize_input_to_output_maps();
+Sized_relobj_file<64, false>::initialize_input_to_output_maps();
 
 template
 void
-Sized_relobj<64, false>::free_input_to_output_maps();
+Sized_relobj_file<64, false>::free_input_to_output_maps();
 #endif
 
 #ifdef HAVE_TARGET_64_BIG
 template
 void
-Sized_relobj<64, true>::initialize_input_to_output_maps();
+Sized_relobj_file<64, true>::initialize_input_to_output_maps();
 
 template
 void
-Sized_relobj<64, true>::free_input_to_output_maps();
+Sized_relobj_file<64, true>::free_input_to_output_maps();
 #endif
 
 #if defined(HAVE_TARGET_32_LITTLE) || defined(HAVE_TARGET_32_BIG)
This page took 0.042879 seconds and 4 git commands to generate.