Merge "Fix the binutils issue for Mac builds (duplicate definitions)." am: 7c568cd574 am: 6ae1b21657 am: 18bcd8df3f
am: 1ce80156f9

Change-Id: If563f8416e4e7c57825889ff8fc6b003ced39655
diff --git a/binutils-2.25/gold/aarch64.cc b/binutils-2.25/gold/aarch64.cc
index d4a8a5b..87e9ea9 100644
--- a/binutils-2.25/gold/aarch64.cc
+++ b/binutils-2.25/gold/aarch64.cc
@@ -8281,4 +8281,33 @@
 Target_selector_aarch64<64, true> target_selector_aarch64elfb;
 Target_selector_aarch64<64, false> target_selector_aarch64elf;
 
+#ifdef HAVE_TARGET_32_LITTLE
+template
+void
+AArch64_relobj<32, false>::do_relocate_stub_tables(const Symbol_table* symtab,
+                                                   const Layout* layout);
+#endif
+
+#ifdef HAVE_TARGET_32_BIG
+template
+void
+AArch64_relobj<32, true>::do_relocate_stub_tables(const Symbol_table* symtab,
+                                                  const Layout* layout);
+#endif
+
+#ifdef HAVE_TARGET_64_LITTLE
+template
+void
+AArch64_relobj<64, false>::do_relocate_stub_tables(const Symbol_table* symtab,
+                                                   const Layout* layout);
+#endif
+
+#ifdef HAVE_TARGET_64_BIG
+template
+void
+AArch64_relobj<64, true>::do_relocate_stub_tables(const Symbol_table* symtab,
+                                                  const Layout* layout);
+#endif
+
+
 } // End anonymous namespace.
diff --git a/binutils-2.25/gold/dwp.cc b/binutils-2.25/gold/dwp.cc
index 9eef68a..a78d865 100644
--- a/binutils-2.25/gold/dwp.cc
+++ b/binutils-2.25/gold/dwp.cc
@@ -435,6 +435,10 @@
   do_relocate(const Symbol_table*, const Layout*, Output_file*)
   { gold_unreachable(); }
 
+  void
+  clear_views()
+  { gold_unreachable(); }
+
  private:
   // General access to the ELF file.
   elfcpp::Elf_file<size, big_endian, Object> elf_file_;
diff --git a/binutils-2.25/gold/incremental.cc b/binutils-2.25/gold/incremental.cc
index b04e471..60f35aa 100644
--- a/binutils-2.25/gold/incremental.cc
+++ b/binutils-2.25/gold/incremental.cc
@@ -2671,6 +2671,12 @@
 {
 }
 
+template<int size, bool big_endian>
+void
+Sized_relobj_incr<size, big_endian>::clear_views()
+{
+}
+
 // Class Sized_incr_dynobj.  Most of these methods are not used for
 // Incremental objects, but are required to be implemented by the
 // base class Object.
diff --git a/binutils-2.25/gold/incremental.h b/binutils-2.25/gold/incremental.h
index 5440c86..deba600 100644
--- a/binutils-2.25/gold/incremental.h
+++ b/binutils-2.25/gold/incremental.h
@@ -1822,6 +1822,9 @@
 		    Sized_incremental_binary<size, big_endian>* ibase,
 		    unsigned int input_file_index);
 
+  virtual void
+  clear_views();
+
  private:
   // For convenience.
   typedef Sized_relobj_incr<size, big_endian> This;
diff --git a/binutils-2.25/gold/object.cc b/binutils-2.25/gold/object.cc
index 194bc43..a1e56df 100644
--- a/binutils-2.25/gold/object.cc
+++ b/binutils-2.25/gold/object.cc
@@ -616,6 +616,16 @@
     }
 }
 
+
+template<int size, bool big_endian>
+void
+Sized_relobj_file<size, big_endian>::clear_views()
+{
+  gold_assert(this->output_views_);
+  delete this->output_views_;
+  this->output_views_ = NULL;
+}
+
 // Return TRUE if this is a section whose contents will be needed in the
 // Add_symbols task.  This function is only called for sections that have
 // already passed the test in is_compressed_debug_section(), so we know
diff --git a/binutils-2.25/gold/object.h b/binutils-2.25/gold/object.h
index 9664fd3..eba3c76 100644
--- a/binutils-2.25/gold/object.h
+++ b/binutils-2.25/gold/object.h
@@ -1274,8 +1274,7 @@
   { return this->do_is_big_endian(); }
 
   virtual void
-  clear_views()
-  {}
+  clear_views() = 0;
 
  protected:
   // The output section to be used for each input section, indexed by
@@ -1358,8 +1357,7 @@
   do_relocate(const Symbol_table* symtab, const Layout*, Output_file* of) = 0;
 
   virtual void
-  do_relocate_stub_tables(const Symbol_table*, const Layout*)
-  {}
+  do_relocate_stub_tables(const Symbol_table*, const Layout*) = 0;
 
   // Set the offset of a section--implemented by child class.
   virtual void
@@ -1957,6 +1955,9 @@
   section_offsets()
   { return this->section_offsets_; }
 
+  virtual void
+  do_relocate_stub_tables(const Symbol_table*, const Layout*);
+
   // Get the address of an output section.
   uint64_t
   do_output_section_address(unsigned int shndx);
@@ -2224,13 +2225,8 @@
   { return this->is_deferred_layout_; }
 
   // Discard output_views_ created in create_views().
-  void
-  clear_views()
-  {
-    gold_assert(this->output_views_);
-    delete this->output_views_;
-    this->output_views_ = NULL;
-  }
+  virtual void
+  clear_views();
 
  protected:
   typedef typename Sized_relobj<size, big_endian>::Output_sections
@@ -2338,10 +2334,6 @@
   void
   do_relocate(const Symbol_table* symtab, const Layout*, Output_file* of);
 
-  virtual void
-  do_relocate_stub_tables(const Symbol_table*, const Layout*)
-  {}
-
   // Get the size of a section.
   uint64_t
   do_section_size(unsigned int shndx)
diff --git a/binutils-2.25/gold/reloc.cc b/binutils-2.25/gold/reloc.cc
index 81cc252..8eb8e01 100644
--- a/binutils-2.25/gold/reloc.cc
+++ b/binutils-2.25/gold/reloc.cc
@@ -724,6 +724,11 @@
 			    layout->symtab_section_offset());
 }
 
+template<int size, bool big_endian>
+void
+Sized_relobj<size, big_endian>::do_relocate_stub_tables(const Symbol_table*, const Layout*)
+{}
+
 // Sort a Read_multiple vector by file offset.
 struct Read_multiple_compare
 {
@@ -1724,12 +1729,9 @@
 
 template
 void
-Sized_relobj_file<32, false>::do_relocate_stub_tables(const Symbol_table* symtab,
-                                                      const Layout* layout);
+Sized_relobj<32, false>::do_relocate_stub_tables(const Symbol_table* symtab,
+                                                 const Layout* layout);
 
-template
-void
-Sized_relobj_file<32, false>::clear_views();
 #endif
 
 #ifdef HAVE_TARGET_32_BIG
@@ -1741,12 +1743,8 @@
 
 template
 void
-Sized_relobj_file<32, true>::do_relocate_stub_tables(const Symbol_table* symtab,
-                                                     const Layout* layout);
-
-template
-void
-Sized_relobj_file<32, true>::clear_views();
+Sized_relobj<32, true>::do_relocate_stub_tables(const Symbol_table* symtab,
+                                                const Layout* layout);
 #endif
 
 #ifdef HAVE_TARGET_64_LITTLE
@@ -1758,12 +1756,8 @@
 
 template
 void
-Sized_relobj_file<64, false>::do_relocate_stub_tables(const Symbol_table* symtab,
-                                                      const Layout* layout);
-
-template
-void
-Sized_relobj_file<64, false>::clear_views();
+Sized_relobj<64, false>::do_relocate_stub_tables(const Symbol_table* symtab,
+                                                 const Layout* layout);
 #endif
 
 #ifdef HAVE_TARGET_64_BIG
@@ -1775,12 +1769,8 @@
 
 template
 void
-Sized_relobj_file<64, true>::do_relocate_stub_tables(const Symbol_table* symtab,
-                                                     const Layout* layout);
-
-template
-void
-Sized_relobj_file<64, true>::clear_views();
+Sized_relobj<64, true>::do_relocate_stub_tables(const Symbol_table* symtab,
+                                                const Layout* layout);
 #endif
 
 #ifdef HAVE_TARGET_32_LITTLE