Synced repos to: 58244
diff --git a/binutils/binutils-2.21/bfd/elf32-i386.c b/binutils/binutils-2.21/bfd/elf32-i386.c
index 1bcc0f3..e9b3933 100644
--- a/binutils/binutils-2.21/bfd/elf32-i386.c
+++ b/binutils/binutils-2.21/bfd/elf32-i386.c
@@ -1807,23 +1807,10 @@
       r_symndx = ELF32_R_SYM (rel->r_info);
       if (r_symndx >= symtab_hdr->sh_info)
 	{
-	  struct elf_i386_link_hash_entry *eh;
-	  struct elf_dyn_relocs **pp;
-	  struct elf_dyn_relocs *p;
-
 	  h = sym_hashes[r_symndx - symtab_hdr->sh_info];
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
-	  eh = (struct elf_i386_link_hash_entry *) h;
-
-	  for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
-	    if (p->sec == sec)
-	      {
-		/* Everything must go for SEC.  */
-		*pp = p->next;
-		break;
-	      }
 	}
       else
 	{
@@ -1843,6 +1830,22 @@
 	    }
 	}
 
+      if (h)
+	{
+	  struct elf_i386_link_hash_entry *eh;
+	  struct elf_dyn_relocs **pp;
+	  struct elf_dyn_relocs *p;
+
+	  eh = (struct elf_i386_link_hash_entry *) h;
+	  for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
+	    if (p->sec == sec)
+	      {
+		/* Everything must go for SEC.  */
+		*pp = p->next;
+		break;
+	      }
+	}
+
       r_type = ELF32_R_TYPE (rel->r_info);
       if (! elf_i386_tls_transition (info, abfd, sec, NULL,
 				     symtab_hdr, sym_hashes,
@@ -1883,7 +1886,8 @@
 
 	case R_386_32:
 	case R_386_PC32:
-	  if (info->shared)
+	  if (info->shared
+	      && (h == NULL || h->type != STT_GNU_IFUNC))
 	    break;
 	  /* Fall through */
 
@@ -2379,10 +2383,6 @@
   if (h->root.type == bfd_link_hash_warning)
     h = (struct elf_link_hash_entry *) h->root.u.i.link;
 
-  /* Skip local IFUNC symbols. */
-  if (h->forced_local && h->type == STT_GNU_IFUNC)
-    return TRUE;
-
   eh = (struct elf_i386_link_hash_entry *) h;
   for (p = eh->dyn_relocs; p != NULL; p = p->next)
     {
diff --git a/binutils/binutils-2.21/bfd/elf64-x86-64.c b/binutils/binutils-2.21/bfd/elf64-x86-64.c
index e68b083..8253bc7 100644
--- a/binutils/binutils-2.21/bfd/elf64-x86-64.c
+++ b/binutils/binutils-2.21/bfd/elf64-x86-64.c
@@ -1645,23 +1645,10 @@
       r_symndx = ELF64_R_SYM (rel->r_info);
       if (r_symndx >= symtab_hdr->sh_info)
 	{
-	  struct elf64_x86_64_link_hash_entry *eh;
-	  struct elf_dyn_relocs **pp;
-	  struct elf_dyn_relocs *p;
-
 	  h = sym_hashes[r_symndx - symtab_hdr->sh_info];
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
-	  eh = (struct elf64_x86_64_link_hash_entry *) h;
-
-	  for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
-	    if (p->sec == sec)
-	      {
-		/* Everything must go for SEC.  */
-		*pp = p->next;
-		break;
-	      }
 	}
       else
 	{
@@ -1682,7 +1669,24 @@
 	    }
 	}
 
-      r_type = ELF64_R_TYPE (rel->r_info);
+      if (h)
+	{
+	  struct elf64_x86_64_link_hash_entry *eh;
+	  struct elf_dyn_relocs **pp;
+	  struct elf_dyn_relocs *p;
+
+	  eh = (struct elf64_x86_64_link_hash_entry *) h;
+
+	  for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
+	    if (p->sec == sec)
+	      {
+		/* Everything must go for SEC.  */
+		*pp = p->next;
+		break;
+	      }
+	}
+
+      r_type = ELF32_R_TYPE (rel->r_info);
       if (! elf64_x86_64_tls_transition (info, abfd, sec, NULL,
 					 symtab_hdr, sym_hashes,
 					 &r_type, GOT_UNKNOWN,
@@ -1733,7 +1737,8 @@
 	case R_X86_64_PC16:
 	case R_X86_64_PC32:
 	case R_X86_64_PC64:
-	  if (info->shared)
+	  if (info->shared
+	      && (h == NULL || h->type != STT_GNU_IFUNC))
 	    break;
 	  /* Fall thru */
 
@@ -2182,10 +2187,6 @@
   if (h->root.type == bfd_link_hash_warning)
     h = (struct elf_link_hash_entry *) h->root.u.i.link;
 
-  /* Skip local IFUNC symbols. */
-  if (h->forced_local && h->type == STT_GNU_IFUNC)
-    return TRUE;
-
   eh = (struct elf64_x86_64_link_hash_entry *) h;
   for (p = eh->dyn_relocs; p != NULL; p = p->next)
     {
diff --git a/binutils/binutils-2.21/binutils/doc/binutils.texi b/binutils/binutils-2.21/binutils/doc/binutils.texi
index d3285a5..9b9056f 100644
--- a/binutils/binutils-2.21/binutils/doc/binutils.texi
+++ b/binutils/binutils-2.21/binutils/doc/binutils.texi
@@ -1746,7 +1746,7 @@
         [@option{-R}|@option{--dynamic-reloc}]
         [@option{-s}|@option{--full-contents}]
         [@option{-W[lLiaprmfFsoRt]}|
-         @option{--dwarf}[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index]]
+         @option{--dwarf}[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges]]
         [@option{-G}|@option{--stabs}]
         [@option{-t}|@option{--syms}]
         [@option{-T}|@option{--dynamic-syms}]
@@ -2119,7 +2119,7 @@
 instructions.
 
 @item -W[lLiaprmfFsoRt]
-@itemx --dwarf[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index]
+@itemx --dwarf[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges]
 @cindex DWARF
 @cindex debug symbols
 Displays the contents of the debug sections in the file, if any are
@@ -2127,7 +2127,7 @@
 then only data found in those specific sections will be dumped.
 
 Note that there is no single letter option to display the content of
-trace sections or .gdb_index.
+trace sections.
 
 @item -G
 @itemx --stabs
@@ -3949,7 +3949,7 @@
         [@option{-R} <number or name>|@option{--relocated-dump=}<number or name>]
         [@option{-c}|@option{--archive-index}]
         [@option{-w[lLiaprmfFsoRt]}|
-         @option{--debug-dump}[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index]]
+         @option{--debug-dump}[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges]]
         [@option{-I}|@option{--histogram}]
         [@option{-v}|@option{--version}]
         [@option{-W}|@option{--wide}]
@@ -4101,13 +4101,13 @@
 command to @command{ar}, but without using the BFD library.  @xref{ar}.
 
 @item -w[lLiaprmfFsoRt]
-@itemx --debug-dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index]
+@itemx --debug-dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges]
 Displays the contents of the debug sections in the file, if any are
 present.  If one of the optional letters or words follows the switch
 then only data found in those specific sections will be dumped.
 
 Note that there is no single letter option to display the content of
-trace sections or .gdb_index.
+trace sections.
 
 Note: the @option{=decodedline} option will display the interpreted
 contents of a .debug_line section whereas the @option{=rawline} option
diff --git a/binutils/binutils-2.21/binutils/dwarf.c b/binutils/binutils-2.21/binutils/dwarf.c
index 0dfe14a..60aa7d1 100644
--- a/binutils/binutils-2.21/binutils/dwarf.c
+++ b/binutils/binutils-2.21/binutils/dwarf.c
@@ -22,7 +22,6 @@
 #include "sysdep.h"
 #include "libiberty.h"
 #include "bfd.h"
-#include "bfd_stdint.h"
 #include "bucomm.h"
 #include "elf/common.h"
 #include "dwarf2.h"
@@ -56,7 +55,6 @@
 int do_debug_macinfo;
 int do_debug_str;
 int do_debug_loc;
-int do_gdb_index;
 int do_trace_info;
 int do_trace_abbrevs;
 int do_trace_aranges;
@@ -1876,14 +1874,6 @@
     case DW_AT_use_GNAT_descriptive_type:	return "DW_AT_use_GNAT_descriptive_type";
     case DW_AT_GNAT_descriptive_type:		return "DW_AT_GNAT_descriptive_type";
 
-    /* GNU extensions for Fission.  */
-    case DW_AT_GNU_dwo_name:			return "DW_AT_GNU_dwo_name";
-    case DW_AT_GNU_dwo_id:			return "DW_AT_GNU_dwo_id";
-    case DW_AT_GNU_ref_base:			return "DW_AT_GNU_ref_base";
-    case DW_AT_GNU_addr_base:			return "DW_AT_GNU_addr_base";
-    case DW_AT_GNU_pubnames:			return "DW_AT_GNU_pubnames";
-    case DW_AT_GNU_pubtypes:			return "DW_AT_GNU_pubtypes";
-
       /* UPC extension.  */
     case DW_AT_upc_threads_scaled:	return "DW_AT_upc_threads_scaled";
 
@@ -4993,141 +4983,6 @@
 #undef SLEB
 
 static int
-display_gdb_index (struct dwarf_section *section,
-		   void *file ATTRIBUTE_UNUSED)
-{
-  unsigned char *start = section->start;
-  uint32_t version;
-  uint32_t cu_list_offset, tu_list_offset;
-  uint32_t address_table_offset, symbol_table_offset, constant_pool_offset;
-  unsigned int cu_list_elements, tu_list_elements;
-  unsigned int address_table_size, symbol_table_slots;
-  unsigned char *cu_list, *tu_list;
-  unsigned char *address_table, *symbol_table, *constant_pool;
-  unsigned int i;
-
-  /* The documentation for the format of this file is in gdb/dwarf2read.c.  */
-
-  printf (_("Contents of the %s section:\n"), section->name);
-
-  if (section->size < 6 * sizeof (uint32_t))
-    {
-      warn (_("Truncated header in the %s section.\n"), section->name);
-      return 0;
-    }
-
-  version = byte_get_little_endian (start, 4);
-  printf (_("Version %d\n"), version);
-
-  /* Prior versions are obsolete, and future versions may not be
-     backwards compatible.  */
-  switch (version)
-    {
-    case 3:
-      warn (_("The address table data in version 3 may be wrong.\n"));
-      break;
-    case 4:
-      break;
-    default:
-      warn (_("Unsupported version %u.\n"), version);
-      return 0;
-    }
-
-  cu_list_offset = byte_get_little_endian (start + 4, 4);
-  tu_list_offset = byte_get_little_endian (start + 8, 4);
-  address_table_offset = byte_get_little_endian (start + 12, 4);
-  symbol_table_offset = byte_get_little_endian (start + 16, 4);
-  constant_pool_offset = byte_get_little_endian (start + 20, 4);
-
-  if (cu_list_offset > section->size
-      || tu_list_offset > section->size
-      || address_table_offset > section->size
-      || symbol_table_offset > section->size
-      || constant_pool_offset > section->size)
-    {
-      warn (_("Corrupt header in the %s section.\n"), section->name);
-      return 0;
-    }
-
-  cu_list_elements = (tu_list_offset - cu_list_offset) / 8;
-  tu_list_elements = (address_table_offset - tu_list_offset) / 8;
-  address_table_size = symbol_table_offset - address_table_offset;
-  symbol_table_slots = (constant_pool_offset - symbol_table_offset) / 8;
-
-  cu_list = start + cu_list_offset;
-  tu_list = start + tu_list_offset;
-  address_table = start + address_table_offset;
-  symbol_table = start + symbol_table_offset;
-  constant_pool = start + constant_pool_offset;
-
-  printf (_("\nCU table:\n"));
-  for (i = 0; i < cu_list_elements; i += 2)
-    {
-      uint64_t cu_offset = byte_get_little_endian (cu_list + i * 8, 8);
-      uint64_t cu_length = byte_get_little_endian (cu_list + i * 8 + 8, 8);
-
-      printf (_("[%3u] 0x%lx - 0x%lx\n"), i / 2,
-	      (unsigned long) cu_offset,
-	      (unsigned long) (cu_offset + cu_length - 1));
-    }
-
-  printf (_("\nTU table:\n"));
-  for (i = 0; i < tu_list_elements; i += 3)
-    {
-      uint64_t tu_offset = byte_get_little_endian (tu_list + i * 8, 8);
-      uint64_t type_offset = byte_get_little_endian (tu_list + i * 8 + 8, 8);
-      uint64_t signature = byte_get_little_endian (tu_list + i * 8 + 16, 8);
-
-      printf (_("[%3u] 0x%lx 0x%lx "), i / 3,
-	      (unsigned long) tu_offset,
-	      (unsigned long) type_offset);
-      print_dwarf_vma (signature, 8);
-      printf ("\n");
-    }
-
-  printf (_("\nAddress table:\n"));
-  for (i = 0; i < address_table_size; i += 2 * 8 + 4)
-    {
-      uint64_t low = byte_get_little_endian (address_table + i, 8);
-      uint64_t high = byte_get_little_endian (address_table + i + 8, 8);
-      uint32_t cu_index = byte_get_little_endian (address_table + i + 16, 4);
-
-      print_dwarf_vma (low, 8);
-      print_dwarf_vma (high, 8);
-      printf (_("%u\n"), cu_index);
-    }
-
-  printf (_("\nSymbol table:\n"));
-  for (i = 0; i < symbol_table_slots; ++i)
-    {
-      uint32_t name_offset = byte_get_little_endian (symbol_table + i * 8, 4);
-      uint32_t cu_vector_offset = byte_get_little_endian (symbol_table + i * 8 + 4, 4);
-      uint32_t num_cus, cu;
-
-      if (name_offset != 0
-	  || cu_vector_offset != 0)
-	{
-	  unsigned int j;
-
-	  printf ("[%3u] %s:", i, constant_pool + name_offset);
-	  num_cus = byte_get_little_endian (constant_pool + cu_vector_offset, 4);
-	  for (j = 0; j < num_cus; ++j)
-	    {
-	      cu = byte_get_little_endian (constant_pool + cu_vector_offset + 4 + j * 4, 4);
-	      /* Convert to TU number if it's for a type unit.  */
-	      if (cu >= cu_list_elements / 2)
-		printf (" T%u", cu - cu_list_elements / 2);
-	      else
-		printf (" %u", cu);
-	    }
-	  printf ("\n");
-	}
-    }
-
-  return 1;
-}
-
-static int
 display_debug_not_supported (struct dwarf_section *section,
 			     void *file ATTRIBUTE_UNUSED)
 {
@@ -5252,8 +5107,6 @@
 	 with earlier versions of readelf.  */
       { "ranges", & do_debug_aranges, 1 },
       { "str", & do_debug_str, 1 },
-      /* The special .gdb_index section.  */
-      { "gdb_index", & do_gdb_index, 1 },
       /* These trace_* sections are used by Itanium VMS.  */
       { "trace_abbrev", & do_trace_abbrevs, 1 },
       { "trace_aranges", & do_trace_aranges, 1 },
@@ -5378,7 +5231,6 @@
   do_debug_macinfo = 1;
   do_debug_str = 1;
   do_debug_loc = 1;
-  do_gdb_index = 1;
   do_trace_info = 1;
   do_trace_abbrevs = 1;
   do_trace_aranges = 1;
@@ -5418,8 +5270,6 @@
     display_debug_types,		&do_debug_info,		1 },
   { { ".debug_weaknames",	".zdebug_weaknames",	NULL, NULL, 0, 0 },
     display_debug_not_supported,	NULL,			0 },
-  { { ".gdb_index",		"",			NULL, NULL, 0, 0 },
-    display_gdb_index,			&do_gdb_index,		0 },
   { { ".trace_info",		"",			NULL, NULL, 0, 0 },
     display_trace_info,			&do_trace_info,		1 },
   { { ".trace_abbrev",		"",			NULL, NULL, 0, 0 },
diff --git a/binutils/binutils-2.21/binutils/dwarf.h b/binutils/binutils-2.21/binutils/dwarf.h
index 36abbd2..1c47c5e 100644
--- a/binutils/binutils-2.21/binutils/dwarf.h
+++ b/binutils/binutils-2.21/binutils/dwarf.h
@@ -71,7 +71,6 @@
   static_vars,
   types,
   weaknames,
-  gdb_index,
   trace_info,
   trace_abbrev,
   trace_aranges,
@@ -120,7 +119,6 @@
 extern int do_debug_macinfo;
 extern int do_debug_str;
 extern int do_debug_loc;
-extern int do_gdb_index;
 extern int do_trace_info;
 extern int do_trace_abbrevs;
 extern int do_trace_aranges;
diff --git a/binutils/binutils-2.21/binutils/objdump.c b/binutils/binutils-2.21/binutils/objdump.c
index e924edc..c672f15 100644
--- a/binutils/binutils-2.21/binutils/objdump.c
+++ b/binutils/binutils-2.21/binutils/objdump.c
@@ -206,7 +206,7 @@
   -W[lLiaprmfFsoRt] or\n\
   --dwarf[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,\n\
           =frames-interp,=str,=loc,=Ranges,=pubtypes,\n\
-          =gdb_index,=trace_info,=trace_abbrev,=trace_aranges]\n\
+          =trace_info,=trace_abbrev,=trace_aranges]\n\
                            Display DWARF info in the file\n\
   -t, --syms               Display the contents of the symbol table(s)\n\
   -T, --dynamic-syms       Display the contents of the dynamic symbol table\n\
diff --git a/binutils/binutils-2.21/binutils/readelf.c b/binutils/binutils-2.21/binutils/readelf.c
index aaa8e0a..0ed5c7c 100644
--- a/binutils/binutils-2.21/binutils/readelf.c
+++ b/binutils/binutils-2.21/binutils/readelf.c
@@ -3201,7 +3201,7 @@
   -w[lLiaprmfFsoRt] or\n\
   --debug-dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,\n\
                =frames-interp,=str,=loc,=Ranges,=pubtypes,\n\
-               =gdb_index,=trace_info,=trace_abbrev,=trace_aranges]\n\
+               =trace_info,=trace_abbrev,=trace_aranges]\n\
                          Display the contents of DWARF2 debug sections\n"));
 #ifdef SUPPORT_DISASSEMBLY
   fprintf (stream, _("\
@@ -4624,8 +4624,6 @@
 	request_dump_bynumber (i, DEBUG_DUMP);
       else if (do_debug_frames && streq (name, ".eh_frame"))
 	request_dump_bynumber (i, DEBUG_DUMP);
-      else if (do_gdb_index && streq (name, ".gdb_index"))
-	request_dump_bynumber (i, DEBUG_DUMP);
       /* Trace sections for Itanium VMS.  */
       else if ((do_debugging || do_trace_info || do_trace_abbrevs
                 || do_trace_aranges)
diff --git a/binutils/binutils-2.21/elfcpp/dwarf.h b/binutils/binutils-2.21/elfcpp/dwarf.h
index 0965a2d..c6ff402 100644
--- a/binutils/binutils-2.21/elfcpp/dwarf.h
+++ b/binutils/binutils-2.21/elfcpp/dwarf.h
@@ -100,11 +100,6 @@
   DW_TAG_condition = 0x3f,
   DW_TAG_shared_type = 0x40,
 
-  // DWARF4.
-  DW_TAG_type_unit = 0x41,
-  DW_TAG_rvalue_reference_type = 0x42,
-  DW_TAG_template_alias = 0x43,
-
   // SGI/MIPS extensions.
   DW_TAG_MIPS_loop = 0x4081,
 
@@ -152,226 +147,7 @@
   DW_FORM_ref4 = 0x13,
   DW_FORM_ref8 = 0x14,
   DW_FORM_ref_udata = 0x15,
-  DW_FORM_indirect = 0x16,
-
-  // DWARF4.
-  DW_FORM_sec_offset = 0x17,
-  DW_FORM_exprloc = 0x18,
-  DW_FORM_flag_present = 0x19,
-  DW_FORM_ref_sig8 = 0x20,
-
-  // Extensions for Fission.
-  DW_FORM_GNU_ref_index = 0x70,
-  DW_FORM_GNU_addr_index = 0x71,
-  DW_FORM_GNU_str_index = 0x72
-};
-
-/* Attribute names and codes.  */
-enum DW_AT
-{
-  DW_AT_sibling = 0x01,
-  DW_AT_location = 0x02,
-  DW_AT_name = 0x03,
-  DW_AT_ordering = 0x09,
-  DW_AT_subscr_data = 0x0a,
-  DW_AT_byte_size = 0x0b,
-  DW_AT_bit_offset = 0x0c,
-  DW_AT_bit_size = 0x0d,
-  DW_AT_element_list = 0x0f,
-  DW_AT_stmt_list = 0x10,
-  DW_AT_low_pc = 0x11,
-  DW_AT_high_pc = 0x12,
-  DW_AT_language = 0x13,
-  DW_AT_member = 0x14,
-  DW_AT_discr = 0x15,
-  DW_AT_discr_value = 0x16,
-  DW_AT_visibility = 0x17,
-  DW_AT_import = 0x18,
-  DW_AT_string_length = 0x19,
-  DW_AT_common_reference = 0x1a,
-  DW_AT_comp_dir = 0x1b,
-  DW_AT_const_value = 0x1c,
-  DW_AT_containing_type = 0x1d,
-  DW_AT_default_value = 0x1e,
-  DW_AT_inline = 0x20,
-  DW_AT_is_optional = 0x21,
-  DW_AT_lower_bound = 0x22,
-  DW_AT_producer = 0x25,
-  DW_AT_prototyped = 0x27,
-  DW_AT_return_addr = 0x2a,
-  DW_AT_start_scope = 0x2c,
-  DW_AT_bit_stride = 0x2e,
-  DW_AT_upper_bound = 0x2f,
-  DW_AT_abstract_origin = 0x31,
-  DW_AT_accessibility = 0x32,
-  DW_AT_address_class = 0x33,
-  DW_AT_artificial = 0x34,
-  DW_AT_base_types = 0x35,
-  DW_AT_calling_convention = 0x36,
-  DW_AT_count = 0x37,
-  DW_AT_data_member_location = 0x38,
-  DW_AT_decl_column = 0x39,
-  DW_AT_decl_file = 0x3a,
-  DW_AT_decl_line = 0x3b,
-  DW_AT_declaration = 0x3c,
-  DW_AT_discr_list = 0x3d,
-  DW_AT_encoding = 0x3e,
-  DW_AT_external = 0x3f,
-  DW_AT_frame_base = 0x40,
-  DW_AT_friend = 0x41,
-  DW_AT_identifier_case = 0x42,
-  DW_AT_macro_info = 0x43,
-  DW_AT_namelist_items = 0x44,
-  DW_AT_priority = 0x45,
-  DW_AT_segment = 0x46,
-  DW_AT_specification = 0x47,
-  DW_AT_static_link = 0x48,
-  DW_AT_type = 0x49,
-  DW_AT_use_location = 0x4a,
-  DW_AT_variable_parameter = 0x4b,
-  DW_AT_virtuality = 0x4c,
-  DW_AT_vtable_elem_location = 0x4d,
-
-  // DWARF3.
-  DW_AT_allocated     = 0x4e,
-  DW_AT_associated    = 0x4f,
-  DW_AT_data_location = 0x50,
-  DW_AT_byte_stride   = 0x51,
-  DW_AT_entry_pc      = 0x52,
-  DW_AT_use_UTF8      = 0x53,
-  DW_AT_extension     = 0x54,
-  DW_AT_ranges        = 0x55,
-  DW_AT_trampoline    = 0x56,
-  DW_AT_call_column   = 0x57,
-  DW_AT_call_file     = 0x58,
-  DW_AT_call_line     = 0x59,
-  DW_AT_description   = 0x5a,
-  DW_AT_binary_scale  = 0x5b,
-  DW_AT_decimal_scale = 0x5c,
-  DW_AT_small         = 0x5d,
-  DW_AT_decimal_sign  = 0x5e,
-  DW_AT_digit_count   = 0x5f,
-  DW_AT_picture_string = 0x60,
-  DW_AT_mutable       = 0x61,
-  DW_AT_threads_scaled = 0x62,
-  DW_AT_explicit      = 0x63,
-  DW_AT_object_pointer = 0x64,
-  DW_AT_endianity     = 0x65,
-  DW_AT_elemental     = 0x66,
-  DW_AT_pure          = 0x67,
-  DW_AT_recursive     = 0x68,
-
-  // DWARF4.
-  DW_AT_signature       = 0x69,
-  DW_AT_main_subprogram = 0x6a,
-  DW_AT_data_bit_offset = 0x6b,
-  DW_AT_const_expr      = 0x6c,
-  DW_AT_enum_class      = 0x6d,
-  DW_AT_linkage_name    = 0x6e,
-
-  DW_AT_lo_user = 0x2000,
-  DW_AT_hi_user = 0x3fff,
-
-  // SGI/MIPS extensions.
-  DW_AT_MIPS_fde = 0x2001,
-  DW_AT_MIPS_loop_begin = 0x2002,
-  DW_AT_MIPS_tail_loop_begin = 0x2003,
-  DW_AT_MIPS_epilog_begin = 0x2004,
-  DW_AT_MIPS_loop_unroll_factor = 0x2005,
-  DW_AT_MIPS_software_pipeline_depth = 0x2006,
-  DW_AT_MIPS_linkage_name = 0x2007,
-  DW_AT_MIPS_stride = 0x2008,
-  DW_AT_MIPS_abstract_name = 0x2009,
-  DW_AT_MIPS_clone_origin = 0x200a,
-  DW_AT_MIPS_has_inlines = 0x200b,
-
-  // HP extensions.
-  DW_AT_HP_block_index         = 0x2000,
-  DW_AT_HP_unmodifiable        = 0x2001, // Same as DW_AT_MIPS_fde.
-  DW_AT_HP_prologue            = 0x2005, // Same as DW_AT_MIPS_loop_unroll.
-  DW_AT_HP_epilogue            = 0x2008, // Same as DW_AT_MIPS_stride.
-  DW_AT_HP_actuals_stmt_list   = 0x2010,
-  DW_AT_HP_proc_per_section    = 0x2011,
-  DW_AT_HP_raw_data_ptr        = 0x2012,
-  DW_AT_HP_pass_by_reference   = 0x2013,
-  DW_AT_HP_opt_level           = 0x2014,
-  DW_AT_HP_prof_version_id     = 0x2015,
-  DW_AT_HP_opt_flags           = 0x2016,
-  DW_AT_HP_cold_region_low_pc  = 0x2017,
-  DW_AT_HP_cold_region_high_pc = 0x2018,
-  DW_AT_HP_all_variables_modifiable = 0x2019,
-  DW_AT_HP_linkage_name        = 0x201a,
-  DW_AT_HP_prof_flags          = 0x201b,  // In comp unit of procs_info for -g.
-  DW_AT_HP_unit_name           = 0x201f,
-  DW_AT_HP_unit_size           = 0x2020,
-  DW_AT_HP_widened_byte_size   = 0x2021,
-  DW_AT_HP_definition_points   = 0x2022,
-  DW_AT_HP_default_location    = 0x2023,
-  DW_AT_HP_is_result_param     = 0x2029,
-
-  // GNU extensions.
-  DW_AT_sf_names   = 0x2101,
-  DW_AT_src_info   = 0x2102,
-  DW_AT_mac_info   = 0x2103,
-  DW_AT_src_coords = 0x2104,
-  DW_AT_body_begin = 0x2105,
-  DW_AT_body_end   = 0x2106,
-  DW_AT_GNU_vector = 0x2107,
-
-  // Thread-safety annotations.
-  // See http://gcc.gnu.org/wiki/ThreadSafetyAnnotation .
-  DW_AT_GNU_guarded_by    = 0x2108,
-  DW_AT_GNU_pt_guarded_by = 0x2109,
-  DW_AT_GNU_guarded       = 0x210a,
-  DW_AT_GNU_pt_guarded    = 0x210b,
-  DW_AT_GNU_locks_excluded = 0x210c,
-  DW_AT_GNU_exclusive_locks_required = 0x210d,
-  DW_AT_GNU_shared_locks_required = 0x210e,
-
-  // One-definition rule violation detection.
-  // See http://gcc.gnu.org/wiki/DwarfSeparateTypeInfo .
-  DW_AT_GNU_odr_signature = 0x210f,
-
-  // Template template argument name.
-  // See http://gcc.gnu.org/wiki/TemplateParmsDwarf .
-  DW_AT_GNU_template_name = 0x2110,
-
-  // The GNU call site extension.
-  // See http://www.dwarfstd.org/ShowIssue.php?issue=100909.2&type=open .
-  DW_AT_GNU_call_site_value = 0x2111,
-  DW_AT_GNU_call_site_data_value = 0x2112,
-  DW_AT_GNU_call_site_target = 0x2113,
-  DW_AT_GNU_call_site_target_clobbered = 0x2114,
-  DW_AT_GNU_tail_call = 0x2115,
-  DW_AT_GNU_all_tail_call_sites = 0x2116,
-  DW_AT_GNU_all_call_sites = 0x2117,
-  DW_AT_GNU_all_source_call_sites = 0x2118,
-  // Section offset into .debug_macro section.
-  DW_AT_GNU_macros = 0x2119,
-  // Extensions for Fission.
-  DW_AT_GNU_dwo_name = 0x2130,
-  DW_AT_GNU_dwo_id = 0x2131,
-  DW_AT_GNU_ref_base = 0x2132,
-  DW_AT_GNU_addr_base = 0x2133,
-  DW_AT_GNU_pubnames = 0x2134,
-  DW_AT_GNU_pubtypes = 0x2135,
-
-  // VMS extensions.
-  DW_AT_VMS_rtnbeg_pd_address = 0x2201,
-
-  // GNAT extensions.
-  // GNAT descriptive type.
-  // See http://gcc.gnu.org/wiki/DW_AT_GNAT_descriptive_type .
-  DW_AT_use_GNAT_descriptive_type = 0x2301,
-  DW_AT_GNAT_descriptive_type	= 0x2302,
-
-  // UPC extension.
-  DW_AT_upc_threads_scaled = 0x3210,
-
-  // PGI (STMicroelectronics) extensions.
-  DW_AT_PGI_lbase    = 0x3a00,
-  DW_AT_PGI_soffset  = 0x3a01,
-  DW_AT_PGI_lstride  = 0x3a02
+  DW_FORM_indirect = 0x16
 };
 
 // Frame unwind information.
@@ -427,8 +203,6 @@
   DW_LNE_end_sequence = 1,
   DW_LNE_set_address = 2,
   DW_LNE_define_file = 3,
-  // DWARF4.
-  DW_LNE_set_discriminator = 4,
   // HP extensions.
   DW_LNE_HP_negate_is_UV_update      = 0x11,
   DW_LNE_HP_push_context             = 0x12,
@@ -462,8 +236,6 @@
   DW_ATE_signed_fixed                =0xd,
   DW_ATE_unsigned_fixed              =0xe,
   DW_ATE_decimal_float               =0xf,
-  // DWARF4.
-  DW_ATE_UTF                         =0x10,
   DW_ATE_lo_user                     =0x80,
   DW_ATE_hi_user                     =0xff
 };
@@ -625,62 +397,12 @@
   DW_OP_form_tls_address             =0x9b,
   DW_OP_call_frame_cfa               =0x9c,
   DW_OP_bit_piece                    =0x9d,
-  // DWARF4.
-  DW_OP_implicit_value               =0x9e,
-  DW_OP_stack_value                  =0x9f,
   DW_OP_lo_user                      =0xe0,
   DW_OP_hi_user                      =0xff,
   // GNU extensions
   DW_OP_GNU_push_tls_address         =0xe0
 };
 
-enum DW_CHILDREN
-{
-  DW_CHILDREN_no		     =0x00,
-  DW_CHILDREN_yes		     =0x01
-};
-
-// Source language names and codes.
-enum DW_LANG
-  {
-    DW_LANG_C89 = 0x0001,
-    DW_LANG_C = 0x0002,
-    DW_LANG_Ada83 = 0x0003,
-    DW_LANG_C_plus_plus = 0x0004,
-    DW_LANG_Cobol74 = 0x0005,
-    DW_LANG_Cobol85 = 0x0006,
-    DW_LANG_Fortran77 = 0x0007,
-    DW_LANG_Fortran90 = 0x0008,
-    DW_LANG_Pascal83 = 0x0009,
-    DW_LANG_Modula2 = 0x000a,
-    // DWARF 3.
-    DW_LANG_Java = 0x000b,
-    DW_LANG_C99 = 0x000c,
-    DW_LANG_Ada95 = 0x000d,
-    DW_LANG_Fortran95 = 0x000e,
-    DW_LANG_PLI = 0x000f,
-    DW_LANG_ObjC = 0x0010,
-    DW_LANG_ObjC_plus_plus = 0x0011,
-    DW_LANG_UPC = 0x0012,
-    DW_LANG_D = 0x0013,
-    // DWARF 4.
-    DW_LANG_Python = 0x0014,
-    // DWARF 5.
-    DW_LANG_Go = 0x0016,
-    DW_LANG_lo_user = 0x8000,	// Implementation-defined range start.
-    DW_LANG_hi_user = 0xffff,	// Implementation-defined range start.
-    // MIPS.
-    DW_LANG_Mips_Assembler = 0x8001,
-    // UPC.
-    DW_LANG_Upc = 0x8765,
-    // HP extensions.
-    DW_LANG_HP_Bliss     = 0x8003,
-    DW_LANG_HP_Basic91   = 0x8004,
-    DW_LANG_HP_Pascal91  = 0x8005,
-    DW_LANG_HP_IMacro    = 0x8006,
-    DW_LANG_HP_Assembler = 0x8007
-  };
-
 } // End namespace elfcpp.
 
 #endif // !defined(ELFCPP_DWARF_H)
diff --git a/binutils/binutils-2.21/gas/testsuite/gas/elf/dwarf2-4.d b/binutils/binutils-2.21/gas/testsuite/gas/elf/dwarf2-4.d
deleted file mode 100644
index 39e0326..0000000
--- a/binutils/binutils-2.21/gas/testsuite/gas/elf/dwarf2-4.d
+++ /dev/null
@@ -1,12 +0,0 @@
-#as:  --compress-debug-sections
-#readelf: -w
-#name: DWARF2 4
-#not-target: ia64-*-*
-
-Contents of the .[z]?debug_abbrev section:
-
-
-
-Section '.debug_info' has no debugging data.
-
-Section '.debug_line' has no debugging data.
diff --git a/binutils/binutils-2.21/gas/testsuite/gas/elf/dwarf2-4.s b/binutils/binutils-2.21/gas/testsuite/gas/elf/dwarf2-4.s
deleted file mode 100644
index ce38362..0000000
--- a/binutils/binutils-2.21/gas/testsuite/gas/elf/dwarf2-4.s
+++ /dev/null
@@ -1,12 +0,0 @@
-	.file	"__dn_comp.c"
-	.section	.debug_abbrev,"",%progbits
-.Ldebug_abbrev0:
-	.section	.debug_info,"",%progbits
-.Ldebug_info0:
-	.section	.debug_line,"",%progbits
-.Ldebug_line0:
-	.text
-.Ltext0:
-.Letext0:
-	.section	.debug_abbrev
-	.byte	0x0
diff --git a/binutils/binutils-2.21/gas/testsuite/gas/elf/elf.exp b/binutils/binutils-2.21/gas/testsuite/gas/elf/elf.exp
index 3be070e..5ce538a 100644
--- a/binutils/binutils-2.21/gas/testsuite/gas/elf/elf.exp
+++ b/binutils/binutils-2.21/gas/testsuite/gas/elf/elf.exp
@@ -176,6 +176,5 @@
     run_dump_test "dwarf2-1"
     run_dump_test "dwarf2-2"
     run_dump_test "dwarf2-3"
-    run_dump_test "dwarf2-4"
     run_dump_test "bad-section-flag"
 }
diff --git a/binutils/binutils-2.21/gas/write.c b/binutils/binutils-2.21/gas/write.c
index 5efe503..939b80e 100644
--- a/binutils/binutils-2.21/gas/write.c
+++ b/binutils/binutils-2.21/gas/write.c
@@ -1353,7 +1353,6 @@
   flagword flags = bfd_get_section_flags (abfd, sec);
 
   if (seginfo == NULL
-      || sec->size < 32
       || (flags & (SEC_ALLOC | SEC_HAS_CONTENTS)) == SEC_ALLOC)
     return;
 
diff --git a/binutils/binutils-2.21/gold/Makefile.am b/binutils/binutils-2.21/gold/Makefile.am
index fd5fc3a..df5e66c 100644
--- a/binutils/binutils-2.21/gold/Makefile.am
+++ b/binutils/binutils-2.21/gold/Makefile.am
@@ -55,7 +55,6 @@
 	expression.cc \
 	fileread.cc \
         gc.cc \
-        gdb-index.cc \
 	gold.cc \
 	gold-threads.cc \
 	icf.cc \
@@ -103,7 +102,6 @@
 	fileread.h \
 	freebsd.h \
         gc.h \
-        gdb-index.h \
 	gold.h \
 	gold-threads.h \
 	icf.h \
@@ -153,14 +151,12 @@
 
 sources_var = main.cc
 deps_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL_DEP)
-ldadd_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(GOLD_LDADD) $(LIBINTL) \
+ldadd_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL) \
 	 $(THREADSLIB) $(LIBDL)
-ldflags_var = $(GOLD_LDFLAGS)
 
 ld_new_SOURCES = $(sources_var)
 ld_new_DEPENDENCIES = $(deps_var)
 ld_new_LDADD = $(ldadd_var)
-ld_new_LDFLAGS = $(ldflags_var)
 
 EXTRA_ld_new_SOURCES = $(TARGETSOURCES)
 
diff --git a/binutils/binutils-2.21/gold/Makefile.in b/binutils/binutils-2.21/gold/Makefile.in
index 50801a1..bf729cf 100644
--- a/binutils/binutils-2.21/gold/Makefile.in
+++ b/binutils/binutils-2.21/gold/Makefile.in
@@ -77,11 +77,11 @@
 	descriptors.$(OBJEXT) dirsearch.$(OBJEXT) dynobj.$(OBJEXT) \
 	dwarf_reader.$(OBJEXT) ehframe.$(OBJEXT) errors.$(OBJEXT) \
 	expression.$(OBJEXT) fileread.$(OBJEXT) gc.$(OBJEXT) \
-	gdb-index.$(OBJEXT) gold.$(OBJEXT) gold-threads.$(OBJEXT) \
-	icf.$(OBJEXT) incremental.$(OBJEXT) int_encoding.$(OBJEXT) \
-	layout.$(OBJEXT) mapfile.$(OBJEXT) merge.$(OBJEXT) \
-	object.$(OBJEXT) options.$(OBJEXT) output.$(OBJEXT) \
-	parameters.$(OBJEXT) plugin.$(OBJEXT) readsyms.$(OBJEXT) \
+	gold.$(OBJEXT) gold-threads.$(OBJEXT) icf.$(OBJEXT) \
+	incremental.$(OBJEXT) int_encoding.$(OBJEXT) layout.$(OBJEXT) \
+	mapfile.$(OBJEXT) merge.$(OBJEXT) object.$(OBJEXT) \
+	options.$(OBJEXT) output.$(OBJEXT) parameters.$(OBJEXT) \
+	plugin.$(OBJEXT) readsyms.$(OBJEXT) \
 	reduced_debug_output.$(OBJEXT) reloc.$(OBJEXT) \
 	resolve.$(OBJEXT) script-sections.$(OBJEXT) script.$(OBJEXT) \
 	stringpool.$(OBJEXT) symtab.$(OBJEXT) target.$(OBJEXT) \
@@ -101,9 +101,7 @@
 ld_new_OBJECTS = $(am_ld_new_OBJECTS)
 am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) libgold.a $(LIBIBERTY) \
 	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-ld_new_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(ld_new_LDFLAGS) \
-	$(LDFLAGS) -o $@
+	$(am__DEPENDENCIES_1)
 @GCC_TRUE@@NATIVE_LINKER_TRUE@am_ld1_OBJECTS = $(am__objects_4)
 ld1_OBJECTS = $(am_ld1_OBJECTS)
 ld1_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(ld1_LDFLAGS) \
@@ -253,8 +251,6 @@
 EXEEXT = @EXEEXT@
 GENCAT = @GENCAT@
 GMSGFMT = @GMSGFMT@
-GOLD_LDADD = @GOLD_LDADD@
-GOLD_LDFLAGS = @GOLD_LDFLAGS@
 GREP = @GREP@
 INCINTL = @INCINTL@
 INSTALL = @INSTALL@
@@ -277,7 +273,6 @@
 MKINSTALLDIRS = @MKINSTALLDIRS@
 MSGFMT = @MSGFMT@
 MSGMERGE = @MSGMERGE@
-NM = @NM@
 NO_WERROR = @NO_WERROR@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
@@ -399,7 +394,6 @@
 	expression.cc \
 	fileread.cc \
         gc.cc \
-        gdb-index.cc \
 	gold.cc \
 	gold-threads.cc \
 	icf.cc \
@@ -447,7 +441,6 @@
 	fileread.h \
 	freebsd.h \
         gc.h \
-        gdb-index.h \
 	gold.h \
 	gold-threads.h \
 	icf.h \
@@ -494,14 +487,12 @@
 libgold_a_LIBADD = $(LIBOBJS)
 sources_var = main.cc
 deps_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL_DEP)
-ldadd_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(GOLD_LDADD) $(LIBINTL) \
+ldadd_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL) \
 	 $(THREADSLIB) $(LIBDL)
 
-ldflags_var = $(GOLD_LDFLAGS)
 ld_new_SOURCES = $(sources_var)
 ld_new_DEPENDENCIES = $(deps_var)
 ld_new_LDADD = $(ldadd_var)
-ld_new_LDFLAGS = $(ldflags_var)
 EXTRA_ld_new_SOURCES = $(TARGETSOURCES)
 incremental_dump_SOURCES = incremental-dump.cc
 incremental_dump_DEPENDENCIES = $(TARGETOBJS) libgold.a $(LIBIBERTY) \
@@ -609,7 +600,7 @@
 	$(CXXLINK) $(incremental_dump_OBJECTS) $(incremental_dump_LDADD) $(LIBS)
 ld-new$(EXEEXT): $(ld_new_OBJECTS) $(ld_new_DEPENDENCIES) 
 	@rm -f ld-new$(EXEEXT)
-	$(ld_new_LINK) $(ld_new_OBJECTS) $(ld_new_LDADD) $(LIBS)
+	$(CXXLINK) $(ld_new_OBJECTS) $(ld_new_LDADD) $(LIBS)
 ld1$(EXEEXT): $(ld1_OBJECTS) $(ld1_DEPENDENCIES) 
 	@rm -f ld1$(EXEEXT)
 	$(ld1_LINK) $(ld1_OBJECTS) $(ld1_LDADD) $(LIBS)
@@ -652,7 +643,6 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/expression.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fileread.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gc.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdb-index.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gold-threads.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gold.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i386.Po@am__quote@
diff --git a/binutils/binutils-2.21/gold/arm.cc b/binutils/binutils-2.21/gold/arm.cc
index 5897568..3ad1c3e 100644
--- a/binutils/binutils-2.21/gold/arm.cc
+++ b/binutils/binutils-2.21/gold/arm.cc
@@ -4480,6 +4480,8 @@
     }
 
   int64_t branch_offset;
+  bool output_is_position_independent =
+      parameters->options().output_is_position_independent();
   if (r_type == elfcpp::R_ARM_THM_CALL || r_type == elfcpp::R_ARM_THM_JUMP24)
     {
       // For THUMB BLX instruction, bit 1 of target comes from bit 1 of the
@@ -4508,7 +4510,7 @@
 	      // Thumb to thumb.
 	      if (!thumb_only)
 		{
-		  stub_type = (parameters->options().shared()
+		  stub_type = (output_is_position_independent
 			       || should_force_pic_veneer)
 		    // PIC stubs.
 		    ? ((may_use_blx
@@ -4529,7 +4531,7 @@
 		}
 	      else
 		{
-		  stub_type = (parameters->options().shared()
+		  stub_type = (output_is_position_independent
 			       || should_force_pic_veneer)
 		    ? arm_stub_long_branch_thumb_only_pic	// PIC stub.
 		    : arm_stub_long_branch_thumb_only;	// non-PIC stub.
@@ -4542,7 +4544,7 @@
 	      // FIXME: We should check that the input section is from an
 	      // object that has interwork enabled.
 
-	      stub_type = (parameters->options().shared()
+	      stub_type = (output_is_position_independent
 			   || should_force_pic_veneer)
 		// PIC stubs.
 		? ((may_use_blx
@@ -4584,7 +4586,7 @@
 	      || (r_type == elfcpp::R_ARM_JUMP24)
 	      || (r_type == elfcpp::R_ARM_PLT32))
 	    {
-	      stub_type = (parameters->options().shared()
+	      stub_type = (output_is_position_independent
 			   || should_force_pic_veneer)
 		// PIC stubs.
 		? (may_use_blx
@@ -4603,7 +4605,7 @@
 	  if (branch_offset > ARM_MAX_FWD_BRANCH_OFFSET
 	      || (branch_offset < ARM_MAX_BWD_BRANCH_OFFSET))
 	    {
-	      stub_type = (parameters->options().shared()
+	      stub_type = (output_is_position_independent
 			   || should_force_pic_veneer)
 		? arm_stub_long_branch_any_arm_pic	// PIC stubs.
 		: arm_stub_long_branch_any_any;		/// non-PIC.
diff --git a/binutils/binutils-2.21/gold/configure b/binutils/binutils-2.21/gold/configure
index 798c94c..1a0d47d 100755
--- a/binutils/binutils-2.21/gold/configure
+++ b/binutils/binutils-2.21/gold/configure
@@ -599,13 +599,9 @@
 HAVE_ZLIB_TRUE
 LIBOBJS
 LFS_CFLAGS
-GOLD_LDADD
-GOLD_LDFLAGS
 WARN_CXXFLAGS
 NO_WERROR
 WARN_CFLAGS
-IFUNC_STATIC_FALSE
-IFUNC_STATIC_TRUE
 IFUNC_FALSE
 IFUNC_TRUE
 RANDOM_SEED_CFLAGS
@@ -675,7 +671,6 @@
 LDFLAGS
 CFLAGS
 CC
-NM
 TARGETOBJS
 DEFAULT_TARGET_X86_64_FALSE
 DEFAULT_TARGET_X86_64_TRUE
@@ -779,8 +774,6 @@
 enable_nls
 enable_werror
 enable_build_warnings
-with_gold_ldflags
-with_gold_ldadd
 enable_maintainer_mode
 '
       ac_precious_vars='build_alias
@@ -1435,8 +1428,6 @@
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
   --with-sysroot=DIR    search for usr/lib et al within DIR
-  --with-gold-ldflags=FLAGS  additional link flags for gold
-  --with-gold-ldadd=LIBS     additional libraries for gold
 
 Some influential environment variables:
   CC          C compiler command
@@ -3535,99 +3526,6 @@
 _ACEOF
 
 
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args.
-set dummy ${ac_tool_prefix}nm; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_NM+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$NM"; then
-  ac_cv_prog_NM="$NM" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_NM="${ac_tool_prefix}nm"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-NM=$ac_cv_prog_NM
-if test -n "$NM"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5
-$as_echo "$NM" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_NM"; then
-  ac_ct_NM=$NM
-  # Extract the first word of "nm", so it can be a program name with args.
-set dummy nm; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_NM+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_NM"; then
-  ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_NM="nm"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_NM=$ac_cv_prog_ac_ct_NM
-if test -n "$ac_ct_NM"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NM" >&5
-$as_echo "$ac_ct_NM" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_NM" = x; then
-    NM=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    NM=$ac_ct_NM
-  fi
-else
-  NM="$ac_cv_prog_NM"
-fi
-
-
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -6472,14 +6370,12 @@
 fi
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for glibc ifunc support" >&5
-$as_echo_n "checking for glibc ifunc support... " >&6; }
-if test "${gold_cv_lib_glibc_ifunc+set}" = set; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for glibc >= 2.11" >&5
+$as_echo_n "checking for glibc >= 2.11... " >&6; }
+if test "${gold_cv_lib_glibc2_11+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
-  save_LDFLAGS="$LDFLAGS"
-LDFLAGS="$LDFLAGS -static"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <features.h>
@@ -6488,39 +6384,20 @@
 #elif __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 11)
 error
 #endif
-void func (void) { }
-void invoke (void);
-__asm__(".type invoke, %gnu_indirect_function");
-typedef void (*funcptr) (void);
-funcptr dispatch (void) __asm__ ("invoke");
-funcptr dispatch (void) { return &func; }
-int
-main ()
-{
-invoke();
-  ;
-  return 0;
-}
+__asm__(".type foo, %gnu_indirect_function");
 
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-if ${NM} conftest$EXEEXT | grep "__rela\?_iplt_start" >/dev/null 2>&1; then
-  gold_cv_lib_glibc_ifunc=both
+if ac_fn_c_try_compile "$LINENO"; then :
+  gold_cv_lib_glibc2_11=yes
 else
-  gold_cv_lib_glibc_ifunc=dyn
+  gold_cv_lib_glibc2_11=no
 fi
-else
-  gold_cv_lib_glibc_ifunc=no
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LDFLAGS="$save_LDFLAGS"
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gold_cv_lib_glibc_ifunc" >&5
-$as_echo "$gold_cv_lib_glibc_ifunc" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gold_cv_lib_glibc2_11" >&5
+$as_echo "$gold_cv_lib_glibc2_11" >&6; }
 
- if test "$gold_cv_lib_glibc_ifunc" != "no"; then
+ if test "$gold_cv_lib_glibc2_11" = "yes"; then
   IFUNC_TRUE=
   IFUNC_FALSE='#'
 else
@@ -6528,14 +6405,6 @@
   IFUNC_FALSE=
 fi
 
- if test "$gold_cv_lib_glibc_ifunc" = "both"; then
-  IFUNC_STATIC_TRUE=
-  IFUNC_STATIC_FALSE='#'
-else
-  IFUNC_STATIC_TRUE='#'
-  IFUNC_STATIC_FALSE=
-fi
-
 
 
 GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
@@ -6614,34 +6483,6 @@
 WARN_CXXFLAGS=`echo ${WARN_CFLAGS} | sed -e 's/-Wstrict-prototypes//' -e 's/-Wmissing-prototypes//' -e 's/-Wshadow//'`
 
 
-
-# Check whether --with-gold-ldflags was given.
-if test "${with_gold_ldflags+set}" = set; then :
-  withval=$with_gold_ldflags; if test "$withval" = "no" -o "$withval" = "yes"; then
-   GOLD_LDFLAGS=
- else
-   GOLD_LDFLAGS=$withval
- fi
-else
-  GOLD_LDFLAGS=
-fi
-
-
-
-
-# Check whether --with-gold-ldadd was given.
-if test "${with_gold_ldadd+set}" = set; then :
-  withval=$with_gold_ldadd; if test "$withval" = "no" -o "$withval" = "yes"; then
-   GOLD_LDADD=
- else
-   GOLD_LDADD=$withval
- fi
-else
-  GOLD_LDADD=
-fi
-
-
-
 LFS_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
 
 
@@ -7444,10 +7285,6 @@
   as_fn_error "conditional \"IFUNC\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
-if test -z "${IFUNC_STATIC_TRUE}" && test -z "${IFUNC_STATIC_FALSE}"; then
-  as_fn_error "conditional \"IFUNC_STATIC\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${HAVE_ZLIB_TRUE}" && test -z "${HAVE_ZLIB_FALSE}"; then
   as_fn_error "conditional \"HAVE_ZLIB\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/binutils/binutils-2.21/gold/configure.ac b/binutils/binutils-2.21/gold/configure.ac
index 9bf566c..60243d0 100644
--- a/binutils/binutils-2.21/gold/configure.ac
+++ b/binutils/binutils-2.21/gold/configure.ac
@@ -238,8 +238,6 @@
 AC_DEFINE_UNQUOTED(GOLD_DEFAULT_OSABI, $default_osabi,
 		   [Default OSABI code])
 
-AC_CHECK_TOOL(NM, nm)
-
 AC_PROG_CC
 AC_PROG_CXX
 AC_PROG_YACC
@@ -372,59 +370,24 @@
 
 dnl On GNU/Linux ifunc is supported by the dynamic linker in glibc
 dnl 2.11 or later, and by binutils 2.20.1 or later.
-AC_CACHE_CHECK([for glibc ifunc support], [gold_cv_lib_glibc_ifunc],
-[save_LDFLAGS="$LDFLAGS"
-LDFLAGS="$LDFLAGS -static"
-AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+AC_CACHE_CHECK([for glibc >= 2.11], [gold_cv_lib_glibc2_11],
+[AC_COMPILE_IFELSE([
 #include <features.h>
 #if !defined __GLIBC__
 error
 #elif __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 11)
 error
 #endif
-void func (void) { }
-void invoke (void);
-__asm__(".type invoke, %gnu_indirect_function");
-typedef void (*funcptr) (void);
-funcptr dispatch (void) __asm__ ("invoke");
-funcptr dispatch (void) { return &func; }]],
-[[invoke();]])
-], [
-if ${NM} conftest$EXEEXT | grep "__rela\?_iplt_start" >/dev/null 2>&1; then
-  gold_cv_lib_glibc_ifunc=both
-else
-  gold_cv_lib_glibc_ifunc=dyn
-fi], [gold_cv_lib_glibc_ifunc=no])
-LDFLAGS="$save_LDFLAGS"])
+__asm__(".type foo, %gnu_indirect_function");
+], [gold_cv_lib_glibc2_11=yes], [gold_cv_lib_glibc2_11=no])])
 
-AM_CONDITIONAL(IFUNC, test "$gold_cv_lib_glibc_ifunc" != "no")
-AM_CONDITIONAL(IFUNC_STATIC, test "$gold_cv_lib_glibc_ifunc" = "both")
+AM_CONDITIONAL(IFUNC, test "$gold_cv_lib_glibc2_11" = "yes")
 
 AM_BINUTILS_WARNINGS
 
 WARN_CXXFLAGS=`echo ${WARN_CFLAGS} | sed -e 's/-Wstrict-prototypes//' -e 's/-Wmissing-prototypes//' -e 's/-Wshadow//'`
 AC_SUBST(WARN_CXXFLAGS)
 
-AC_ARG_WITH(gold-ldflags,
-[  --with-gold-ldflags=FLAGS  additional link flags for gold],
-[if test "$withval" = "no" -o "$withval" = "yes"; then
-   GOLD_LDFLAGS=
- else
-   GOLD_LDFLAGS=$withval
- fi],
-[GOLD_LDFLAGS=])
-AC_SUBST(GOLD_LDFLAGS)
-
-AC_ARG_WITH(gold-ldadd,
-[  --with-gold-ldadd=LIBS     additional libraries for gold],
-[if test "$withval" = "no" -o "$withval" = "yes"; then
-   GOLD_LDADD=
- else
-   GOLD_LDADD=$withval
- fi],
-[GOLD_LDADD=])
-AC_SUBST(GOLD_LDADD)
-
 dnl Force support for large files by default.  This may need to be
 dnl host dependent.  If build == host, we can check getconf LFS_CFLAGS.
 LFS_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
diff --git a/binutils/binutils-2.21/gold/dwarf_reader.cc b/binutils/binutils-2.21/gold/dwarf_reader.cc
index 64ab86b..ee046a1 100644
--- a/binutils/binutils-2.21/gold/dwarf_reader.cc
+++ b/binutils/binutils-2.21/gold/dwarf_reader.cc
@@ -36,1395 +36,6 @@
 
 namespace gold {
 
-// Class Sized_elf_reloc_mapper
-
-// Initialize the relocation tracker for section RELOC_SHNDX.
-
-template<int size, bool big_endian>
-bool
-Sized_elf_reloc_mapper<size, big_endian>::do_initialize(
-    unsigned int reloc_shndx, unsigned int reloc_type)
-{
-  this->reloc_type_ = reloc_type;
-  return this->track_relocs_.initialize(this->object_, reloc_shndx,
-					reloc_type);
-}
-
-// Looks in the symtab to see what section a symbol is in.
-
-template<int size, bool big_endian>
-unsigned int
-Sized_elf_reloc_mapper<size, big_endian>::symbol_section(
-    unsigned int symndx, Address* value, bool* is_ordinary)
-{
-  const int symsize = elfcpp::Elf_sizes<size>::sym_size;
-  gold_assert(symndx * symsize < this->symtab_size_);
-  elfcpp::Sym<size, big_endian> elfsym(this->symtab_ + symndx * symsize);
-  *value = elfsym.get_st_value();
-  return this->object_->adjust_sym_shndx(symndx, elfsym.get_st_shndx(),
-					 is_ordinary);
-}
-
-// Return the section index and offset within the section of
-// the target of the relocation for RELOC_OFFSET.
-
-template<int size, bool big_endian>
-unsigned int
-Sized_elf_reloc_mapper<size, big_endian>::do_get_reloc_target(
-    off_t reloc_offset, off_t* target_offset)
-{
-  this->track_relocs_.advance(reloc_offset);
-  if (reloc_offset != this->track_relocs_.next_offset())
-    return 0;
-  unsigned int symndx = this->track_relocs_.next_symndx();
-  typename elfcpp::Elf_types<size>::Elf_Addr value;
-  bool is_ordinary;
-  unsigned int target_shndx = this->symbol_section(symndx, &value,
-						   &is_ordinary);
-  if (!is_ordinary)
-    return 0;
-  if (this->reloc_type_ == elfcpp::SHT_RELA)
-    value += this->track_relocs_.next_addend();
-  *target_offset = value;
-  return target_shndx;
-}
-
-static inline Elf_reloc_mapper*
-make_elf_reloc_mapper(Object* object, const unsigned char* symtab,
-		      off_t symtab_size)
-{
-  switch (parameters->size_and_endianness())
-    {
-#ifdef HAVE_TARGET_32_LITTLE
-      case Parameters::TARGET_32_LITTLE:
-	return new Sized_elf_reloc_mapper<32, false>(object, symtab,
-						     symtab_size);
-#endif
-#ifdef HAVE_TARGET_32_BIG
-      case Parameters::TARGET_32_BIG:
-	return new Sized_elf_reloc_mapper<32, true>(object, symtab,
-						    symtab_size);
-#endif
-#ifdef HAVE_TARGET_64_LITTLE
-      case Parameters::TARGET_64_LITTLE:
-	return new Sized_elf_reloc_mapper<64, false>(object, symtab,
-						     symtab_size);
-#endif
-#ifdef HAVE_TARGET_64_BIG
-      case Parameters::TARGET_64_BIG:
-	return new Sized_elf_reloc_mapper<64, true>(object, symtab,
-						    symtab_size);
-#endif
-      default:
-	gold_unreachable();
-    }
-}
-
-// class Dwarf_abbrev_table
-
-void
-Dwarf_abbrev_table::clear_abbrev_codes()
-{
-  for (unsigned int code = 0; code < this->low_abbrev_code_max_; ++code)
-    {
-      if (this->low_abbrev_codes_[code] != NULL)
-	{
-	  delete this->low_abbrev_codes_[code];
-	  this->low_abbrev_codes_[code] = NULL;
-	}
-    }
-  for (Abbrev_code_table::iterator it = this->high_abbrev_codes_.begin();
-       it != this->high_abbrev_codes_.end();
-       ++it)
-    {
-      if (it->second != NULL)
-	delete it->second;
-    }
-  this->high_abbrev_codes_.clear();
-}
-
-// Read the abbrev table from an object file.
-
-bool
-Dwarf_abbrev_table::do_read_abbrevs(
-    Relobj* object,
-    unsigned int abbrev_shndx,
-    off_t abbrev_offset)
-{
-  this->clear_abbrev_codes();
-
-  // If we don't have relocations, abbrev_shndx will be 0, and
-  // we'll have to hunt for the .debug_abbrev section.
-  if (abbrev_shndx == 0 && this->abbrev_shndx_ > 0)
-    abbrev_shndx = this->abbrev_shndx_;
-  else if (abbrev_shndx == 0)
-    {
-      for (unsigned int i = 1; i < object->shnum(); ++i)
-	{
-	  std::string name = object->section_name(i);
-	  if (name == ".debug_abbrev" || name == ".zdebug_abbrev")
-	    {
-	      abbrev_shndx = i;
-	      break;
-	    }
-	}
-      if (abbrev_shndx == 0)
-	return false;
-    }
-
-  // Get the section contents and decompress if necessary.
-  if (abbrev_shndx != this->abbrev_shndx_)
-    {
-      if (this->owns_buffer_ && this->buffer_ != NULL)
-        {
-	  delete[] this->buffer_;
-	  this->owns_buffer_ = false;
-        }
-
-      section_size_type buffer_size;
-      this->buffer_ = object->section_contents(abbrev_shndx, &buffer_size,
-					       false);
-
-      section_size_type uncompressed_size = 0;
-      unsigned char* uncompressed_data = NULL;
-      if (object->section_is_compressed(abbrev_shndx, &uncompressed_size))
-	{
-	  uncompressed_data = new unsigned char[uncompressed_size];
-	  if (!decompress_input_section(this->buffer_,
-					buffer_size,
-					uncompressed_data,
-					uncompressed_size))
-	    object->error(_("could not decompress section %s"),
-			  object->section_name(abbrev_shndx).c_str());
-	  this->buffer_ = uncompressed_data;
-	  buffer_size = uncompressed_size;
-	  this->owns_buffer_ = true;
-	}
-
-      this->buffer_end_ = this->buffer_ + buffer_size;
-      this->abbrev_shndx_ = abbrev_shndx;
-    }
-
-  // Parse the abbrev table at the given offset.
-  const unsigned char* pabbrev = this->buffer_ + abbrev_offset;
-  size_t len;
-  for (;;)
-    {
-      // Read the abbrev code.  A zero here indicates the end of the
-      // abbrev table.
-      if (pabbrev >= this->buffer_end_)
-	return false;
-      uint64_t code = read_unsigned_LEB_128(pabbrev, &len);
-      if (code == 0)
-	break;
-      pabbrev += len;
-
-      // Read the tag.
-      if (pabbrev >= this->buffer_end_)
-	return false;
-      uint64_t tag = read_unsigned_LEB_128(pabbrev, &len);
-      pabbrev += len;
-
-      // Read the has_children flag.
-      if (pabbrev >= this->buffer_end_)
-	return false;
-      bool has_children = *pabbrev == elfcpp::DW_CHILDREN_yes;
-      pabbrev += 1;
-
-      // Read the list of (attribute, form) pairs.
-      Abbrev_code* entry = new Abbrev_code(tag, has_children);
-      for (;;)
-	{
-	  // Read the attribute.
-	  if (pabbrev >= this->buffer_end_)
-	    return false;
-	  uint64_t attr = read_unsigned_LEB_128(pabbrev, &len);
-	  pabbrev += len;
-
-	  // Read the form.
-	  if (pabbrev >= this->buffer_end_)
-	    return false;
-	  uint64_t form = read_unsigned_LEB_128(pabbrev, &len);
-	  pabbrev += len;
-
-	  // A (0,0) pair terminates the list.
-	  if (attr == 0 && form == 0)
-	    break;
-
-	  if (attr == elfcpp::DW_AT_sibling)
-	    entry->has_sibling_attribute = true;
-
-	  entry->add_attribute(attr, form);
-	}
-
-      this->store_abbrev(code, entry);
-    }
-
-  return true;
-}
-
-// class Dwarf_ranges_table
-
-// Read the ranges table from an object file.
-
-bool
-Dwarf_ranges_table::read_ranges_table(
-    Relobj* object,
-    const unsigned char* symtab,
-    off_t symtab_size,
-    unsigned int ranges_shndx)
-{
-  // If we've already read this abbrev table, return immediately.
-  if (this->ranges_shndx_ > 0
-      && this->ranges_shndx_ == ranges_shndx)
-    return true;
-
-  // If we don't have relocations, ranges_shndx will be 0, and
-  // we'll have to hunt for the .debug_ranges section.
-  if (ranges_shndx == 0 && this->ranges_shndx_ > 0)
-    ranges_shndx = this->ranges_shndx_;
-  else if (ranges_shndx == 0)
-    {
-      for (unsigned int i = 1; i < object->shnum(); ++i)
-	{
-	  std::string name = object->section_name(i);
-	  if (name == ".debug_ranges" || name == ".zdebug_ranges")
-	    {
-	      ranges_shndx = i;
-	      break;
-	    }
-	}
-      if (ranges_shndx == 0)
-	return false;
-    }
-
-  // Get the section contents and decompress if necessary.
-  if (ranges_shndx != this->ranges_shndx_)
-    {
-      if (this->owns_ranges_buffer_ && this->ranges_buffer_ != NULL)
-        {
-	  delete[] this->ranges_buffer_;
-	  this->owns_ranges_buffer_ = false;
-        }
-
-      section_size_type buffer_size;
-      this->ranges_buffer_ = object->section_contents(ranges_shndx,
-						      &buffer_size, false);
-
-      section_size_type uncompressed_size = 0;
-      unsigned char* uncompressed_data = NULL;
-      if (object->section_is_compressed(ranges_shndx, &uncompressed_size))
-	{
-	  uncompressed_data = new unsigned char[uncompressed_size];
-	  if (!decompress_input_section(this->ranges_buffer_,
-					buffer_size,
-					uncompressed_data,
-					uncompressed_size))
-	    object->error(_("could not decompress section %s"),
-			  object->section_name(ranges_shndx).c_str());
-	  this->ranges_buffer_ = uncompressed_data;
-	  buffer_size = uncompressed_size;
-	  this->owns_ranges_buffer_ = true;
-	}
-
-      this->ranges_buffer_end_ = this->ranges_buffer_ + buffer_size;
-      this->ranges_shndx_ = ranges_shndx;
-    }
-
-  if (this->ranges_reloc_mapper_ != NULL)
-    delete this->ranges_reloc_mapper_;
-
-  // Find the relocation section for ".debug_ranges".
-  unsigned int reloc_shndx = 0;
-  unsigned int reloc_type = 0;
-  for (unsigned int i = 0; i < object->shnum(); ++i)
-    {
-      reloc_type = object->section_type(i);
-      if ((reloc_type == elfcpp::SHT_REL
-	   || reloc_type == elfcpp::SHT_RELA)
-	  && object->section_info(i) == ranges_shndx)
-	{
-	  reloc_shndx = i;
-	  break;
-	}
-    }
-
-  if (reloc_shndx > 0)
-    {
-      this->ranges_reloc_mapper_ = make_elf_reloc_mapper(object, symtab,
-							 symtab_size);
-      this->ranges_reloc_mapper_->initialize(reloc_shndx, reloc_type);
-    }
-
-  return true;
-}
-
-// Read a range list from section RANGES_SHNDX at offset RANGES_OFFSET.
-
-Dwarf_range_list*
-Dwarf_ranges_table::read_range_list(
-    Relobj* object,
-    const unsigned char* symtab,
-    off_t symtab_size,
-    unsigned int addr_size,
-    unsigned int ranges_shndx,
-    off_t offset)
-{
-  Dwarf_range_list* ranges;
-
-  if (!this->read_ranges_table(object, symtab, symtab_size, ranges_shndx))
-    return NULL;
-
-  // Read the range list at RANGES_OFFSET.
-  ranges = new Dwarf_range_list();
-  off_t base = 0;
-  for (;
-       this->ranges_buffer_ + offset < this->ranges_buffer_end_;
-       offset += 2 * addr_size)
-    {
-      off_t start;
-      off_t end;
-
-      // Read the raw contents of the section.
-      if (addr_size == 4)
-	{
-	  start = read_from_pointer<32>(this->ranges_buffer_ + offset);
-	  end = read_from_pointer<32>(this->ranges_buffer_ + offset + 4);
-	}
-      else
-	{
-	  start = read_from_pointer<64>(this->ranges_buffer_ + offset);
-	  end = read_from_pointer<64>(this->ranges_buffer_ + offset + 8);
-	}
-
-      // Check for relocations and adjust the values.
-      unsigned int shndx1 =
-	  this->ranges_reloc_mapper_->get_reloc_target(offset, &start);
-      unsigned int shndx2 =
-	  this->ranges_reloc_mapper_->get_reloc_target(offset + addr_size,
-						       &end);
-
-      // End of list is marked by a pair of zeroes.
-      if (shndx1 == 0 && start == 0 && end == 0)
-        break;
-
-      // A "base address selection entry" is identified by
-      // 0xffffffff for the first value of the pair.  The second
-      // value is used as a base for subsequent range list entries.
-      if (shndx1 == 0 && start == -1)
-	base = end;
-      else if (shndx1 == shndx2)
-	{
-	  if (shndx1 == 0 || object->is_section_included(shndx1))
-	    ranges->add(shndx1, base + start, base + end);
-	}
-      else
-	gold_warning(_("%s: DWARF info may be corrupt; offsets in a "
-		       "range list entry are in different sections"),
-		     object->name().c_str());
-    }
-
-  return ranges;
-}
-
-// class Dwarf_pubnames_table
-
-// Read the pubnames section SHNDX from the object file.
-bool
-Dwarf_pubnames_table::read_section(Relobj* object,
-				   const unsigned char* symtab,
-				   off_t symtab_size,
-				   unsigned int shndx)
-{
-  section_size_type buffer_size;
-
-  this->buffer_ = object->section_contents(shndx, &buffer_size, false);
-  if (this->buffer_ == NULL)
-    return false;
-
-  // Decompress the section if necessary.
-  section_size_type uncompressed_size = 0;
-  unsigned char* uncompressed_data = NULL;
-  if (object->section_is_compressed(shndx, &uncompressed_size))
-    {
-      uncompressed_data = new unsigned char[uncompressed_size];
-      if (!decompress_input_section(this->buffer_,
-				    buffer_size,
-				    uncompressed_data,
-				    uncompressed_size))
-	object->error(_("could not decompress section %s"),
-		      object->section_name(shndx).c_str());
-      this->buffer_ = uncompressed_data;
-      buffer_size = uncompressed_size;
-      this->owns_buffer_ = true;
-    }
-  this->buffer_end_ = this->buffer_ + buffer_size;
-
-  // Find the relocation section.
-  unsigned int reloc_shndx = 0;
-  unsigned int reloc_type = 0;
-  for (unsigned int i = 0; i < object->shnum(); ++i)
-    {
-      reloc_type = object->section_type(i);
-      if ((reloc_type == elfcpp::SHT_REL
-	   || reloc_type == elfcpp::SHT_RELA)
-	  && object->section_info(i) == shndx)
-	{
-	  reloc_shndx = i;
-	  break;
-	}
-    }
-  if (reloc_shndx > 0)
-    {
-      this->reloc_mapper_ = make_elf_reloc_mapper(object, symtab,
-						  symtab_size);
-      this->reloc_mapper_->initialize(reloc_shndx, reloc_type);
-    }
-
-  return true;
-}
-
-// Read the header for the set at OFFSET.
-
-bool
-Dwarf_pubnames_table::read_header(off_t offset)
-{
-  if (offset < 0 || offset + 14 >= this->buffer_end_ - this->buffer_)
-    return false;
-
-  const unsigned char* pinfo = this->buffer_ + offset;
-
-  // Read the unit_length field.
-  uint32_t unit_length = read_from_pointer<32>(pinfo);
-  pinfo += 4;
-  if (unit_length == 0xffffffff)
-    {
-      unit_length = read_from_pointer<64>(pinfo);
-      pinfo += 8;
-      this->offset_size_ = 8;
-    }
-  else
-    this->offset_size_ = 4;
-
-  // Check the version.
-  unsigned int version = read_from_pointer<16>(pinfo);
-  pinfo += 2;
-  if (version != 2)
-    return false;
-  
-  // Skip the debug_info_offset and debug_info_size fields.
-  pinfo += 2 * this->offset_size_;
-
-  if (pinfo >= this->buffer_end_)
-    return false;
-
-  this->pinfo_ = pinfo;
-  return true;
-}
-
-// Read the next name from the set.
-
-const char*
-Dwarf_pubnames_table::next_name()
-{
-  const unsigned char* pinfo = this->pinfo_;
-
-  // Read the offset within the CU.  If this is zero, we have reached
-  // the end of the list.
-  uint32_t offset;
-  if (this->offset_size_ == 4)
-    offset = read_from_pointer<32>(&pinfo);
-  else
-    offset = read_from_pointer<64>(&pinfo);
-  if (offset == 0)
-    return NULL;
-
-  // Return a pointer to the string at the current location,
-  // and advance the pointer to the next entry.
-  const char* ret = reinterpret_cast<const char*>(pinfo);
-  while (pinfo < this->buffer_end_ && *pinfo != '\0')
-    ++pinfo;
-  if (pinfo < this->buffer_end_)
-    ++pinfo;
-
-  this->pinfo_ = pinfo;
-  return ret;
-}
-
-// class Dwarf_die
-
-Dwarf_die::Dwarf_die(
-    Dwarf_info_reader* dwinfo,
-    off_t die_offset,
-    Dwarf_die* parent)
-  : dwinfo_(dwinfo), parent_(parent), die_offset_(die_offset),
-    child_offset_(0), sibling_offset_(0), abbrev_code_(NULL), attributes_(),
-    attributes_read_(false), name_(NULL), name_off_(-1), linkage_name_(NULL),
-    linkage_name_off_(-1), string_shndx_(0), specification_(0),
-    abstract_origin_(0)
-{
-  size_t len;
-  const unsigned char* pdie = dwinfo->buffer_at_offset(die_offset);
-  if (pdie == NULL)
-    return;
-  unsigned int code = read_unsigned_LEB_128(pdie, &len);
-  if (code == 0)
-    {
-      if (parent != NULL)
-	parent->set_sibling_offset(die_offset + len);
-      return;
-    }
-  this->attr_offset_ = len;
-
-  // Lookup the abbrev code in the abbrev table.
-  this->abbrev_code_ = dwinfo->get_abbrev(code);
-}
-
-// Read all the attributes of the DIE.
-
-bool
-Dwarf_die::read_attributes()
-{
-  if (this->attributes_read_)
-    return true;
-
-  gold_assert(this->abbrev_code_ != NULL);
-
-  const unsigned char* pdie =
-      this->dwinfo_->buffer_at_offset(this->die_offset_);
-  if (pdie == NULL)
-    return false;
-  const unsigned char* pattr = pdie + this->attr_offset_;
-
-  unsigned int nattr = this->abbrev_code_->attributes.size();
-  this->attributes_.reserve(nattr);
-  for (unsigned int i = 0; i < nattr; ++i)
-    {
-      size_t len;
-      unsigned int attr = this->abbrev_code_->attributes[i].attr;
-      unsigned int form = this->abbrev_code_->attributes[i].form;
-      if (form == elfcpp::DW_FORM_indirect)
-        {
-          form = read_unsigned_LEB_128(pattr, &len);
-          pattr += len;
-        }
-      off_t attr_off = this->die_offset_ + (pattr - pdie);
-      bool ref_form = false;
-      Attribute_value attr_value;
-      attr_value.attr = attr;
-      attr_value.form = form;
-      attr_value.aux.shndx = 0;
-      switch(form)
-	{
-	  case elfcpp::DW_FORM_null:
-	    attr_value.val.intval = 0;
-	    break;
-	  case elfcpp::DW_FORM_flag_present:
-	    attr_value.val.intval = 1;
-	    break;
-	  case elfcpp::DW_FORM_strp:
-	    {
-	      off_t str_off;
-	      if (this->dwinfo_->offset_size() == 4)
-		str_off = read_from_pointer<32>(&pattr);
-	      else
-		str_off = read_from_pointer<64>(&pattr);
-	      unsigned int shndx =
-		  this->dwinfo_->lookup_reloc(attr_off, &str_off);
-	      attr_value.aux.shndx = shndx;
-	      attr_value.val.refval = str_off;
-	      break;
-	    }
-	  case elfcpp::DW_FORM_sec_offset:
-	    {
-	      off_t sec_off;
-	      if (this->dwinfo_->offset_size() == 4)
-		sec_off = read_from_pointer<32>(&pattr);
-	      else
-		sec_off = read_from_pointer<64>(&pattr);
-	      unsigned int shndx =
-		  this->dwinfo_->lookup_reloc(attr_off, &sec_off);
-	      attr_value.aux.shndx = shndx;
-	      attr_value.val.refval = sec_off;
-	      ref_form = true;
-	      break;
-	    }
-	  case elfcpp::DW_FORM_addr:
-	  case elfcpp::DW_FORM_ref_addr:
-	    {
-	      off_t sec_off;
-	      if (this->dwinfo_->address_size() == 4)
-		sec_off = read_from_pointer<32>(&pattr);
-	      else
-		sec_off = read_from_pointer<64>(&pattr);
-	      unsigned int shndx =
-		  this->dwinfo_->lookup_reloc(attr_off, &sec_off);
-	      attr_value.aux.shndx = shndx;
-	      attr_value.val.refval = sec_off;
-	      ref_form = true;
-	      break;
-	    }
-	  case elfcpp::DW_FORM_block1:
-	    attr_value.aux.blocklen = *pattr++;
-	    attr_value.val.blockval = pattr;
-	    pattr += attr_value.aux.blocklen;
-	    break;
-	  case elfcpp::DW_FORM_block2:
-	    attr_value.aux.blocklen = read_from_pointer<16>(&pattr);
-	    attr_value.val.blockval = pattr;
-	    pattr += attr_value.aux.blocklen;
-	    break;
-	  case elfcpp::DW_FORM_block4:
-	    attr_value.aux.blocklen = read_from_pointer<32>(&pattr);
-	    attr_value.val.blockval = pattr;
-	    pattr += attr_value.aux.blocklen;
-	    break;
-	  case elfcpp::DW_FORM_block:
-	  case elfcpp::DW_FORM_exprloc:
-	    attr_value.aux.blocklen = read_unsigned_LEB_128(pattr, &len);
-	    attr_value.val.blockval = pattr + len;
-	    pattr += len + attr_value.aux.blocklen;
-	    break;
-	  case elfcpp::DW_FORM_data1:
-	  case elfcpp::DW_FORM_flag:
-	    attr_value.val.intval = *pattr++;
-	    break;
-	  case elfcpp::DW_FORM_ref1:
-	    attr_value.val.refval = *pattr++;
-	    ref_form = true;
-	    break;
-	  case elfcpp::DW_FORM_data2:
-	    attr_value.val.intval = read_from_pointer<16>(&pattr);
-	    break;
-	  case elfcpp::DW_FORM_ref2:
-	    attr_value.val.refval = read_from_pointer<16>(&pattr);
-	    ref_form = true;
-	    break;
-	  case elfcpp::DW_FORM_data4:
-	    {
-	      off_t sec_off;
-	      sec_off = read_from_pointer<32>(&pattr);
-	      unsigned int shndx =
-		  this->dwinfo_->lookup_reloc(attr_off, &sec_off);
-	      attr_value.aux.shndx = shndx;
-	      attr_value.val.intval = sec_off;
-	      break;
-	    }
-	  case elfcpp::DW_FORM_ref4:
-	    {
-	      off_t sec_off;
-	      sec_off = read_from_pointer<32>(&pattr);
-	      unsigned int shndx =
-		  this->dwinfo_->lookup_reloc(attr_off, &sec_off);
-	      attr_value.aux.shndx = shndx;
-	      attr_value.val.refval = sec_off;
-	      ref_form = true;
-	      break;
-	    }
-	  case elfcpp::DW_FORM_data8:
-	    {
-	      off_t sec_off;
-	      sec_off = read_from_pointer<64>(&pattr);
-	      unsigned int shndx =
-		  this->dwinfo_->lookup_reloc(attr_off, &sec_off);
-	      attr_value.aux.shndx = shndx;
-	      attr_value.val.intval = sec_off;
-	      break;
-	    }
-	  case elfcpp::DW_FORM_ref_sig8:
-	    attr_value.val.uintval = read_from_pointer<64>(&pattr);
-	    break;
-	  case elfcpp::DW_FORM_ref8:
-	    {
-	      off_t sec_off;
-	      sec_off = read_from_pointer<64>(&pattr);
-	      unsigned int shndx =
-		  this->dwinfo_->lookup_reloc(attr_off, &sec_off);
-	      attr_value.aux.shndx = shndx;
-	      attr_value.val.refval = sec_off;
-	      ref_form = true;
-	      break;
-	    }
-	  case elfcpp::DW_FORM_ref_udata:
-	    attr_value.val.refval = read_unsigned_LEB_128(pattr, &len);
-	    ref_form = true;
-	    pattr += len;
-	    break;
-	  case elfcpp::DW_FORM_udata:
-	    attr_value.val.uintval = read_unsigned_LEB_128(pattr, &len);
-	    pattr += len;
-	    break;
-	  case elfcpp::DW_FORM_sdata:
-	    attr_value.val.intval = read_signed_LEB_128(pattr, &len);
-	    pattr += len;
-	    break;
-	  case elfcpp::DW_FORM_string:
-	    attr_value.val.stringval = reinterpret_cast<const char*>(pattr);
-	    len = strlen(attr_value.val.stringval);
-	    pattr += len + 1;
-	    break;
-	  default:
-	    return false;
-	}
-
-      // Cache the most frequently-requested attributes.
-      switch (attr)
-	{
-	  case elfcpp::DW_AT_name:
-	    if (form == elfcpp::DW_FORM_string)
-	      this->name_ = attr_value.val.stringval;
-	    else if (form == elfcpp::DW_FORM_strp)
-	      {
-		// All indirect strings should refer to the same
-		// string section, so we just save the last one seen.
-		this->string_shndx_ = attr_value.aux.shndx;
-		this->name_off_ = attr_value.val.refval;
-	      }
-	    break;
-	  case elfcpp::DW_AT_linkage_name:
-	  case elfcpp::DW_AT_MIPS_linkage_name:
-	    if (form == elfcpp::DW_FORM_string)
-	      this->linkage_name_ = attr_value.val.stringval;
-	    else if (form == elfcpp::DW_FORM_strp)
-	      {
-		// All indirect strings should refer to the same
-		// string section, so we just save the last one seen.
-		this->string_shndx_ = attr_value.aux.shndx;
-		this->linkage_name_off_ = attr_value.val.refval;
-	      }
-	    break;
-	  case elfcpp::DW_AT_specification:
-	    if (ref_form)
-	      this->specification_ = attr_value.val.refval;
-	    break;
-	  case elfcpp::DW_AT_abstract_origin:
-	    if (ref_form)
-	      this->abstract_origin_ = attr_value.val.refval;
-	    break;
-	  case elfcpp::DW_AT_sibling:
-	    if (ref_form && attr_value.aux.shndx == 0)
-	      this->sibling_offset_ = attr_value.val.refval;
-	  default:
-	    break;
-	}
-
-      this->attributes_.push_back(attr_value);
-    }
-
-  // Now that we know where the next DIE begins, record the offset
-  // to avoid later recalculation.
-  if (this->has_children())
-    this->child_offset_ = this->die_offset_ + (pattr - pdie);
-  else
-    this->sibling_offset_ = this->die_offset_ + (pattr - pdie);
-
-  this->attributes_read_ = true;
-  return true;
-}
-
-// Skip all the attributes of the DIE and return the offset of the next DIE.
-
-off_t
-Dwarf_die::skip_attributes()
-{
-  typedef Dwarf_abbrev_table::Attribute Attribute;
-
-  gold_assert(this->abbrev_code_ != NULL);
-
-  const unsigned char* pdie =
-      this->dwinfo_->buffer_at_offset(this->die_offset_);
-  if (pdie == NULL)
-    return 0;
-  const unsigned char* pattr = pdie + this->attr_offset_;
-
-  for (unsigned int i = 0; i < this->abbrev_code_->attributes.size(); ++i)
-    {
-      size_t len;
-      unsigned int form = this->abbrev_code_->attributes[i].form;
-      if (form == elfcpp::DW_FORM_indirect)
-        {
-          form = read_unsigned_LEB_128(pattr, &len);
-          pattr += len;
-        }
-      switch(form)
-	{
-	  case elfcpp::DW_FORM_null:
-	  case elfcpp::DW_FORM_flag_present:
-	    break;
-	  case elfcpp::DW_FORM_strp:
-	  case elfcpp::DW_FORM_sec_offset:
-	    pattr += this->dwinfo_->offset_size();
-	    break;
-	  case elfcpp::DW_FORM_addr:
-	  case elfcpp::DW_FORM_ref_addr:
-	    pattr += this->dwinfo_->address_size();
-	    break;
-	  case elfcpp::DW_FORM_block1:
-	    pattr += 1 + *pattr;
-	    break;
-	  case elfcpp::DW_FORM_block2:
-	    {
-	      uint16_t block_size;
-	      block_size = read_from_pointer<16>(&pattr);
-	      pattr += block_size;
-	      break;
-	    }
-	  case elfcpp::DW_FORM_block4:
-	    {
-	      uint32_t block_size;
-	      block_size = read_from_pointer<32>(&pattr);
-	      pattr += block_size;
-	      break;
-	    }
-	  case elfcpp::DW_FORM_block:
-	  case elfcpp::DW_FORM_exprloc:
-	    {
-	      uint64_t block_size;
-	      block_size = read_unsigned_LEB_128(pattr, &len);
-	      pattr += len + block_size;
-	      break;
-	    }
-	  case elfcpp::DW_FORM_data1:
-	  case elfcpp::DW_FORM_ref1:
-	  case elfcpp::DW_FORM_flag:
-	    pattr += 1;
-	    break;
-	  case elfcpp::DW_FORM_data2:
-	  case elfcpp::DW_FORM_ref2:
-	    pattr += 2;
-	    break;
-	  case elfcpp::DW_FORM_data4:
-	  case elfcpp::DW_FORM_ref4:
-	    pattr += 4;
-	    break;
-	  case elfcpp::DW_FORM_data8:
-	  case elfcpp::DW_FORM_ref8:
-	  case elfcpp::DW_FORM_ref_sig8:
-	    pattr += 8;
-	    break;
-	  case elfcpp::DW_FORM_ref_udata:
-	  case elfcpp::DW_FORM_udata:
-	    read_unsigned_LEB_128(pattr, &len);
-	    pattr += len;
-	    break;
-	  case elfcpp::DW_FORM_sdata:
-	    read_signed_LEB_128(pattr, &len);
-	    pattr += len;
-	    break;
-	  case elfcpp::DW_FORM_string:
-	    len = strlen(reinterpret_cast<const char*>(pattr));
-	    pattr += len + 1;
-	    break;
-	  default:
-	    return 0;
-	}
-    }
-
-  return this->die_offset_ + (pattr - pdie);
-}
-
-// Get the name of the DIE and cache it.
-
-void
-Dwarf_die::set_name()
-{
-  if (this->name_ != NULL || !this->read_attributes())
-    return;
-  if (this->name_off_ != -1)
-    this->name_ = this->dwinfo_->get_string(this->name_off_,
-					    this->string_shndx_);
-}
-
-// Get the linkage name of the DIE and cache it.
-
-void
-Dwarf_die::set_linkage_name()
-{
-  if (this->linkage_name_ != NULL || !this->read_attributes())
-    return;
-  if (this->linkage_name_off_ != -1)
-    this->linkage_name_ = this->dwinfo_->get_string(this->linkage_name_off_,
-						    this->string_shndx_);
-}
-
-// Return the value of attribute ATTR.
-
-const Dwarf_die::Attribute_value*
-Dwarf_die::attribute(unsigned int attr)
-{
-  if (!this->read_attributes())
-    return NULL;
-  for (unsigned int i = 0; i < this->attributes_.size(); ++i)
-    {
-      if (this->attributes_[i].attr == attr)
-        return &this->attributes_[i];
-    }
-  return NULL;
-}
-
-const char*
-Dwarf_die::string_attribute(unsigned int attr)
-{
-  const Attribute_value* attr_val = this->attribute(attr);
-  if (attr_val == NULL)
-    return NULL;
-  switch (attr_val->form)
-    {
-      case elfcpp::DW_FORM_string:
-        return attr_val->val.stringval;
-      case elfcpp::DW_FORM_strp:
-	return this->dwinfo_->get_string(attr_val->val.refval,
-					 attr_val->aux.shndx);
-      default:
-        return NULL;
-    }
-}
-
-int64_t
-Dwarf_die::int_attribute(unsigned int attr)
-{
-  const Attribute_value* attr_val = this->attribute(attr);
-  if (attr_val == NULL)
-    return 0;
-  switch (attr_val->form)
-    {
-      case elfcpp::DW_FORM_null:
-      case elfcpp::DW_FORM_flag_present:
-      case elfcpp::DW_FORM_data1:
-      case elfcpp::DW_FORM_flag:
-      case elfcpp::DW_FORM_data2:
-      case elfcpp::DW_FORM_data4:
-      case elfcpp::DW_FORM_data8:
-      case elfcpp::DW_FORM_sdata:
-        return attr_val->val.intval;
-      default:
-        return 0;
-    }
-}
-
-uint64_t
-Dwarf_die::uint_attribute(unsigned int attr)
-{
-  const Attribute_value* attr_val = this->attribute(attr);
-  if (attr_val == NULL)
-    return 0;
-  switch (attr_val->form)
-    {
-      case elfcpp::DW_FORM_null:
-      case elfcpp::DW_FORM_flag_present:
-      case elfcpp::DW_FORM_data1:
-      case elfcpp::DW_FORM_flag:
-      case elfcpp::DW_FORM_data4:
-      case elfcpp::DW_FORM_data8:
-      case elfcpp::DW_FORM_ref_sig8:
-      case elfcpp::DW_FORM_udata:
-        return attr_val->val.uintval;
-      default:
-        return 0;
-    }
-}
-
-off_t
-Dwarf_die::ref_attribute(unsigned int attr, unsigned int* shndx)
-{
-  const Attribute_value* attr_val = this->attribute(attr);
-  if (attr_val == NULL)
-    return -1;
-  switch (attr_val->form)
-    {
-      case elfcpp::DW_FORM_sec_offset:
-      case elfcpp::DW_FORM_addr:
-      case elfcpp::DW_FORM_ref_addr:
-      case elfcpp::DW_FORM_ref1:
-      case elfcpp::DW_FORM_ref2:
-      case elfcpp::DW_FORM_ref4:
-      case elfcpp::DW_FORM_ref8:
-      case elfcpp::DW_FORM_ref_udata:
-        *shndx = attr_val->aux.shndx;
-        return attr_val->val.refval;
-      case elfcpp::DW_FORM_ref_sig8:
-        *shndx = attr_val->aux.shndx;
-        return attr_val->val.uintval;
-      case elfcpp::DW_FORM_data4:
-      case elfcpp::DW_FORM_data8:
-        *shndx = attr_val->aux.shndx;
-        return attr_val->val.intval;
-      default:
-        return -1;
-    }
-}
-
-// Return the offset of this DIE's first child.
-
-off_t
-Dwarf_die::child_offset()
-{
-  gold_assert(this->abbrev_code_ != NULL);
-  if (!this->has_children())
-    return 0;
-  if (this->child_offset_ == 0)
-    this->child_offset_ = this->skip_attributes();
-  return this->child_offset_;
-}
-
-// Return the offset of this DIE's next sibling.
-
-off_t
-Dwarf_die::sibling_offset()
-{
-  gold_assert(this->abbrev_code_ != NULL);
-
-  if (this->sibling_offset_ != 0)
-    return this->sibling_offset_;
-
-  if (!this->has_children())
-    {
-      this->sibling_offset_ = this->skip_attributes();
-      return this->sibling_offset_;
-    }
-
-  if (this->has_sibling_attribute())
-    {
-      if (!this->read_attributes())
-	return 0;
-      if (this->sibling_offset_ != 0)
-	return this->sibling_offset_;
-    }
-
-  // Skip over the children.
-  off_t child_offset = this->child_offset();
-  while (child_offset > 0)
-    {
-      Dwarf_die die(this->dwinfo_, child_offset, this);
-      // The Dwarf_die ctor will set this DIE's sibling offset
-      // when it reads a zero abbrev code.
-      if (die.tag() == 0)
-	break;
-      child_offset = die.sibling_offset();
-    }
-
-  // This should be set by now.  If not, there was a problem reading
-  // the DWARF info, and we return 0.
-  return this->sibling_offset_;
-}
-
-// class Dwarf_info_reader
-
-// Check that the pointer P is within the current compilation unit.
-
-inline bool
-Dwarf_info_reader::check_buffer(const unsigned char* p) const
-{
-  if (p > this->buffer_ + this->cu_offset_ + this->cu_length_)
-    {
-      gold_warning(_("%s: corrupt debug info in %s"),
-		   this->object_->name().c_str(),
-		   this->object_->section_name(this->shndx_).c_str());
-      return false;
-    }
-  return true;
-}
-
-// Begin parsing the debug info.  This calls visit_compilation_unit()
-// or visit_type_unit() for each compilation or type unit found in the
-// section, and visit_die() for each top-level DIE.
-
-void
-Dwarf_info_reader::parse()
-{
-  switch (parameters->size_and_endianness())
-    {
-#ifdef HAVE_TARGET_32_LITTLE
-      case Parameters::TARGET_32_LITTLE:
-        this->do_parse<false>();
-        break;
-#endif
-#ifdef HAVE_TARGET_32_BIG
-      case Parameters::TARGET_32_BIG:
-        this->do_parse<true>();
-        break;
-#endif
-#ifdef HAVE_TARGET_64_LITTLE
-      case Parameters::TARGET_64_LITTLE:
-        this->do_parse<false>();
-        break;
-#endif
-#ifdef HAVE_TARGET_64_BIG
-      case Parameters::TARGET_64_BIG:
-        this->do_parse<true>();
-        break;
-#endif
-      default:
-	gold_unreachable();
-    }
-}
-
-template<bool big_endian>
-void
-Dwarf_info_reader::do_parse()
-{
-  bool buffer_is_allocated = false;
-
-  // Get the section contents and decompress if necessary.
-  section_size_type buffer_size;
-  this->buffer_ = this->object_->section_contents(this->shndx_, &buffer_size,
-						  false);
-  if (this->buffer_ == NULL || buffer_size == 0)
-    return;
-  this->buffer_end_ = this->buffer_ + buffer_size;
-
-  section_size_type uncompressed_size = 0;
-  unsigned char* uncompressed_data = NULL;
-  if (this->object_->section_is_compressed(this->shndx_, &uncompressed_size))
-    {
-      uncompressed_data = new unsigned char[uncompressed_size];
-      if (!decompress_input_section(this->buffer_,
-				    buffer_size,
-				    uncompressed_data,
-				    uncompressed_size))
-	this->object_->error(_("could not decompress section %s"),
-			     this->object_->section_name(this->shndx_).c_str());
-      this->buffer_ = uncompressed_data;
-      this->buffer_end_ = this->buffer_ + uncompressed_size;
-      buffer_is_allocated = true;
-    }
-
-  // The offset of this input section in the output section.
-  off_t section_offset = this->object_->output_section_offset(this->shndx_);
-
-  // Start tracking relocations for this section.
-  this->reloc_mapper_ = make_elf_reloc_mapper(this->object_, this->symtab_,
-					      this->symtab_size_);
-  bool have_relocs = this->reloc_mapper_->initialize(this->reloc_shndx_,
-						     this->reloc_type_);
-
-  // Loop over compilation units (or type units).
-  unsigned int abbrev_shndx = 0;
-  off_t abbrev_offset = 0;
-  const unsigned char* pinfo = this->buffer_;
-  while (pinfo < this->buffer_end_)
-    {
-      // Read the compilation (or type) unit header.
-      const unsigned char* cu_start = pinfo;
-      this->cu_offset_ = cu_start - this->buffer_;
-      this->cu_length_ = this->buffer_end_ - cu_start;
-
-      // Read unit_length (4 or 12 bytes).
-      if (!this->check_buffer(pinfo + 4))
-	break;
-      uint32_t unit_length =
-          elfcpp::Swap_unaligned<32, big_endian>::readval(pinfo);
-      pinfo += 4;
-      if (unit_length == 0xffffffff)
-	{
-	  if (!this->check_buffer(pinfo + 8))
-	    break;
-	  unit_length = elfcpp::Swap_unaligned<64, big_endian>::readval(pinfo);
-	  pinfo += 8;
-	  this->offset_size_ = 8;
-	}
-      else
-	this->offset_size_ = 4;
-      if (!this->check_buffer(pinfo + unit_length))
-	break;
-      const unsigned char* cu_end = pinfo + unit_length;
-      this->cu_length_ = cu_end - cu_start;
-      if (!this->check_buffer(pinfo + 2 + this->offset_size_ + 1))
-	break;
-
-      // Read version (2 bytes).
-      this->cu_version_ =
-	  elfcpp::Swap_unaligned<16, big_endian>::readval(pinfo);
-      pinfo += 2;
-
-      // Read debug_abbrev_offset (4 or 8 bytes).
-      if (this->offset_size_ == 4)
-	abbrev_offset = elfcpp::Swap_unaligned<32, big_endian>::readval(pinfo);
-      else
-	abbrev_offset = elfcpp::Swap_unaligned<64, big_endian>::readval(pinfo);
-      if (have_relocs)
-	{
-	  off_t reloc_offset = pinfo - this->buffer_;
-	  off_t value;
-	  abbrev_shndx =
-	      this->reloc_mapper_->get_reloc_target(reloc_offset, &value);
-	  if (abbrev_shndx == 0)
-	    return;
-	  if (this->reloc_type_ == elfcpp::SHT_REL)
-	    abbrev_offset += value;
-	  else
-	    abbrev_offset = value;
-	}
-      pinfo += this->offset_size_;
-
-      // Read address_size (1 byte).
-      this->address_size_ = *pinfo++;
-
-      // For type units, read the two extra fields.
-      uint64_t signature = 0;
-      off_t type_offset = 0;
-      if (this->is_type_unit_)
-        {
-	  if (!this->check_buffer(pinfo + 8 + this->offset_size_))
-	    break;
-
-	  // Read type_signature (8 bytes).
-	  signature = elfcpp::Swap_unaligned<64, big_endian>::readval(pinfo);
-	  pinfo += 8;
-
-	  // Read type_offset (4 or 8 bytes).
-	  if (this->offset_size_ == 4)
-	    type_offset =
-		elfcpp::Swap_unaligned<32, big_endian>::readval(pinfo);
-	  else
-	    type_offset =
-		elfcpp::Swap_unaligned<64, big_endian>::readval(pinfo);
-	  pinfo += this->offset_size_;
-	}
-
-      // Read the .debug_abbrev table.
-      this->abbrev_table_.read_abbrevs(this->object_, abbrev_shndx,
-				       abbrev_offset);
-
-      // Visit the root DIE.
-      Dwarf_die root_die(this,
-			 pinfo - (this->buffer_ + this->cu_offset_),
-			 NULL);
-      if (root_die.tag() != 0)
-	{
-	  // Visit the CU or TU.
-	  if (this->is_type_unit_)
-	    this->visit_type_unit(section_offset + this->cu_offset_,
-				  type_offset, signature, &root_die);
-	  else
-	    this->visit_compilation_unit(section_offset + this->cu_offset_,
-					 cu_end - cu_start, &root_die);
-	}
-
-      // Advance to the next CU.
-      pinfo = cu_end;
-    }
-
-  if (buffer_is_allocated)
-    {
-      delete[] this->buffer_;
-      this->buffer_ = NULL;
-    }
-}
-
-// Read the DWARF string table.
-
-bool
-Dwarf_info_reader::do_read_string_table(unsigned int string_shndx)
-{
-  Relobj* object = this->object_;
-
-  // If we don't have relocations, string_shndx will be 0, and
-  // we'll have to hunt for the .debug_str section.
-  if (string_shndx == 0)
-    {
-      for (unsigned int i = 1; i < this->object_->shnum(); ++i)
-	{
-	  std::string name = object->section_name(i);
-	  if (name == ".debug_str" || name == ".zdebug_str")
-	    {
-	      string_shndx = i;
-	      break;
-	    }
-	}
-      if (string_shndx == 0)
-	return false;
-    }
-
-  if (this->owns_string_buffer_ && this->string_buffer_ != NULL)
-    {
-      delete[] this->string_buffer_;
-      this->owns_string_buffer_ = false;
-    }
-
-  // Get the secton contents and decompress if necessary.
-  section_size_type buffer_size;
-  const unsigned char* buffer = object->section_contents(string_shndx,
-							 &buffer_size, false);
-
-  section_size_type uncompressed_size = 0;
-  unsigned char* uncompressed_data = NULL;
-  if (object->section_is_compressed(string_shndx, &uncompressed_size))
-    {
-      uncompressed_data = new unsigned char[uncompressed_size];
-      if (!decompress_input_section(buffer,
-				    buffer_size,
-				    uncompressed_data,
-				    uncompressed_size))
-	object->error(_("could not decompress section %s"),
-		      object->section_name(string_shndx).c_str());
-      buffer = uncompressed_data;
-      buffer_size = uncompressed_size;
-      this->owns_string_buffer_ = true;
-    }
-
-  this->string_buffer_ = reinterpret_cast<const char*>(buffer);
-  this->string_buffer_end_ = this->string_buffer_ + buffer_size;
-  this->string_shndx_ = string_shndx;
-  return true;
-}
-
-// Look for a relocation at offset ATTR_OFF in the dwarf info,
-// and return the section index and offset of the target.
-
-unsigned int
-Dwarf_info_reader::lookup_reloc(off_t attr_off, off_t* target_off)
-{
-  off_t value;
-  attr_off += this->cu_offset_;
-  unsigned int shndx = this->reloc_mapper_->get_reloc_target(attr_off, &value);
-  if (shndx == 0)
-    return 0;
-  if (this->reloc_type_ == elfcpp::SHT_REL)
-    *target_off += value;
-  else
-    *target_off = value;
-  return shndx;
-}
-
-// Return a string from the DWARF string table.
-
-const char*
-Dwarf_info_reader::get_string(off_t str_off, unsigned int string_shndx)
-{
-  if (!this->read_string_table(string_shndx))
-    return NULL;
-
-  const char* p = this->string_buffer_ + str_off;
-
-  if (p < this->string_buffer_ || p >= this->string_buffer_end_)
-    return NULL;
-
-  return p;
-}
-
-// The following are default, do-nothing, implementations of the
-// hook methods normally provided by a derived class.  We provide
-// default implementations rather than no implementation so that
-// a derived class needs to implement only the hooks that it needs
-// to use.
-
-// Process a compilation unit and parse its child DIE.
-
-void
-Dwarf_info_reader::visit_compilation_unit(off_t, off_t, Dwarf_die*)
-{
-}
-
-// Process a type unit and parse its child DIE.
-
-void
-Dwarf_info_reader::visit_type_unit(off_t, off_t, uint64_t, Dwarf_die*)
-{
-}
-
-// class Sized_dwarf_line_info
-
 struct LineStateMachine
 {
   int file_num;
@@ -1453,8 +64,8 @@
 template<int size, bool big_endian>
 Sized_dwarf_line_info<size, big_endian>::Sized_dwarf_line_info(Object* object,
                                                                unsigned int read_shndx)
-  : data_valid_(false), buffer_(NULL), reloc_mapper_(NULL),
-    symtab_buffer_(NULL), directories_(), files_(), current_header_index_(-1)
+  : data_valid_(false), buffer_(NULL), symtab_buffer_(NULL),
+    directories_(), files_(), current_header_index_(-1)
 {
   unsigned int debug_shndx;
   for (debug_shndx = 1; debug_shndx < object->shnum(); ++debug_shndx)
@@ -1490,46 +101,42 @@
 
   // Find the relocation section for ".debug_line".
   // We expect these for relobjs (.o's) but not dynobjs (.so's).
-  unsigned int reloc_shndx = 0;
-  for (unsigned int i = 0; i < object->shnum(); ++i)
+  bool got_relocs = false;
+  for (unsigned int reloc_shndx = 0;
+       reloc_shndx < object->shnum();
+       ++reloc_shndx)
     {
-      unsigned int reloc_sh_type = object->section_type(i);
+      unsigned int reloc_sh_type = object->section_type(reloc_shndx);
       if ((reloc_sh_type == elfcpp::SHT_REL
 	   || reloc_sh_type == elfcpp::SHT_RELA)
-	  && object->section_info(i) == debug_shndx)
+	  && object->section_info(reloc_shndx) == debug_shndx)
 	{
-	  reloc_shndx = i;
+	  got_relocs = this->track_relocs_.initialize(object, reloc_shndx,
+                                                      reloc_sh_type);
 	  this->track_relocs_type_ = reloc_sh_type;
 	  break;
 	}
     }
 
   // Finally, we need the symtab section to interpret the relocs.
-  if (reloc_shndx != 0)
+  if (got_relocs)
     {
       unsigned int symtab_shndx;
       for (symtab_shndx = 0; symtab_shndx < object->shnum(); ++symtab_shndx)
         if (object->section_type(symtab_shndx) == elfcpp::SHT_SYMTAB)
           {
-	    this->symtab_buffer_ = object->section_contents(
-		symtab_shndx, &this->symtab_buffer_size_, false);
+            this->symtab_buffer_ = object->section_contents(
+                symtab_shndx, &this->symtab_buffer_size_, false);
             break;
           }
       if (this->symtab_buffer_ == NULL)
         return;
     }
 
-  this->reloc_mapper_ =
-      new Sized_elf_reloc_mapper<size, big_endian>(object,
-						   this->symtab_buffer_,
-						   this->symtab_buffer_size_);
-  if (!this->reloc_mapper_->initialize(reloc_shndx, this->track_relocs_type_))
-    return;
-
   // Now that we have successfully read all the data, parse the debug
   // info.
   this->data_valid_ = true;
-  this->read_line_mappings(read_shndx);
+  this->read_line_mappings(object, read_shndx);
 }
 
 // Read the DWARF header.
@@ -1888,10 +495,8 @@
               && (shndx == -1U || lsm.shndx == -1U || shndx == lsm.shndx))
             {
               Offset_to_lineno_entry entry
-                  = { static_cast<off_t>(lsm.address),
-		      this->current_header_index_,
-		      static_cast<unsigned int>(lsm.file_num),
-		      true, lsm.line_num };
+                  = { lsm.address, this->current_header_index_,
+                      lsm.file_num, true, lsm.line_num };
 	      std::vector<Offset_to_lineno_entry>&
 		map(this->line_number_map_[lsm.shndx]);
 	      // If we see two consecutive entries with the same
@@ -1911,28 +516,51 @@
   return lengthstart + header_.total_length;
 }
 
+// Looks in the symtab to see what section a symbol is in.
+
+template<int size, bool big_endian>
+unsigned int
+Sized_dwarf_line_info<size, big_endian>::symbol_section(
+    Object* object,
+    unsigned int sym,
+    typename elfcpp::Elf_types<size>::Elf_Addr* value,
+    bool* is_ordinary)
+{
+  const int symsize = elfcpp::Elf_sizes<size>::sym_size;
+  gold_assert(sym * symsize < this->symtab_buffer_size_);
+  elfcpp::Sym<size, big_endian> elfsym(this->symtab_buffer_ + sym * symsize);
+  *value = elfsym.get_st_value();
+  return object->adjust_sym_shndx(sym, elfsym.get_st_shndx(), is_ordinary);
+}
+
 // Read the relocations into a Reloc_map.
 
 template<int size, bool big_endian>
 void
-Sized_dwarf_line_info<size, big_endian>::read_relocs()
+Sized_dwarf_line_info<size, big_endian>::read_relocs(Object* object)
 {
   if (this->symtab_buffer_ == NULL)
     return;
 
-  off_t value;
+  typename elfcpp::Elf_types<size>::Elf_Addr value;
   off_t reloc_offset;
-  while ((reloc_offset = this->reloc_mapper_->next_offset()) != -1)
+  while ((reloc_offset = this->track_relocs_.next_offset()) != -1)
     {
-      const unsigned int shndx =
-          this->reloc_mapper_->get_reloc_target(reloc_offset, &value);
+      const unsigned int sym = this->track_relocs_.next_symndx();
+
+      bool is_ordinary;
+      const unsigned int shndx = this->symbol_section(object, sym, &value,
+						      &is_ordinary);
 
       // There is no reason to record non-ordinary section indexes, or
       // SHN_UNDEF, because they will never match the real section.
-      if (shndx != 0)
-	this->reloc_map_[reloc_offset] = std::make_pair(shndx, value);
+      if (is_ordinary && shndx != elfcpp::SHN_UNDEF)
+	{
+	  value += this->track_relocs_.next_addend();
+	  this->reloc_map_[reloc_offset] = std::make_pair(shndx, value);
+	}
 
-      this->reloc_mapper_->advance(reloc_offset + 1);
+      this->track_relocs_.advance(reloc_offset + 1);
     }
 }
 
@@ -1940,11 +568,12 @@
 
 template<int size, bool big_endian>
 void
-Sized_dwarf_line_info<size, big_endian>::read_line_mappings(unsigned int shndx)
+Sized_dwarf_line_info<size, big_endian>::read_line_mappings(Object* object,
+							    unsigned int shndx)
 {
   gold_assert(this->data_valid_ == true);
 
-  this->read_relocs();
+  this->read_relocs(object);
   while (this->buffer_ < this->buffer_end_)
     {
       const unsigned char* lineptr = this->buffer_;
@@ -2148,7 +777,7 @@
 
   gold_assert(loc.header_num < static_cast<int>(this->files_.size()));
   gold_assert(loc.file_num
-	      < static_cast<unsigned int>(this->files_[loc.header_num].size()));
+	      < static_cast<int>(this->files_[loc.header_num].size()));
   const std::pair<int, std::string>& filename_pair
       = this->files_[loc.header_num][loc.file_num];
   const std::string& filename = filename_pair.second;
diff --git a/binutils/binutils-2.21/gold/dwarf_reader.h b/binutils/binutils-2.21/gold/dwarf_reader.h
index d4320e3..3f92dd3 100644
--- a/binutils/binutils-2.21/gold/dwarf_reader.h
+++ b/binutils/binutils-2.21/gold/dwarf_reader.h
@@ -1,6 +1,6 @@
 // dwarf_reader.h -- parse dwarf2/3 debug information for gold  -*- C++ -*-
 
-// Copyright 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+// Copyright 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 // Written by Ian Lance Taylor <iant@google.com>.
 
 // This file is part of gold.
@@ -26,7 +26,6 @@
 #include <vector>
 #include <map>
 #include <limits.h>
-#include <sys/types.h>
 
 #include "elfcpp.h"
 #include "elfcpp_swap.h"
@@ -36,758 +35,9 @@
 namespace gold
 {
 
-class Dwarf_info_reader;
-struct LineStateMachine;
-
-// This class is used to extract the section index and offset of
-// the target of a relocation for a given offset within the section.
-
-class Elf_reloc_mapper
-{
- public:
-  Elf_reloc_mapper()
-  { }
-
-  virtual
-  ~Elf_reloc_mapper()
-  { }
-
-  // Initialize the relocation tracker for section RELOC_SHNDX.
-  bool
-  initialize(unsigned int reloc_shndx, unsigned int reloc_type)
-  { return this->do_initialize(reloc_shndx, reloc_type); }
-
-  // Return the next reloc_offset.
-  off_t
-  next_offset()
-  { return this->do_next_offset(); }
-
-  // Advance to the next relocation past OFFSET.
-  void
-  advance(off_t offset)
-  { this->do_advance(offset); }
-
-  // Return the section index and offset within the section of the target
-  // of the relocation for RELOC_OFFSET in the referring section.
-  unsigned int
-  get_reloc_target(off_t reloc_offset, off_t* target_offset)
-  { return do_get_reloc_target(reloc_offset, target_offset); }
-
- protected:
-  virtual bool
-  do_initialize(unsigned int, unsigned int) = 0;
-
-  // Return the next reloc_offset.
-  virtual off_t
-  do_next_offset() = 0;
-
-  // Advance to the next relocation past OFFSET.
-  virtual void
-  do_advance(off_t offset) = 0;
-
-  virtual unsigned int
-  do_get_reloc_target(off_t reloc_offset, off_t* target_offset) = 0;
-};
-
 template<int size, bool big_endian>
-class Sized_elf_reloc_mapper : public Elf_reloc_mapper
-{
- public:
-  Sized_elf_reloc_mapper(Object* object, const unsigned char* symtab,
-			 off_t symtab_size)
-    : object_(object), symtab_(symtab), symtab_size_(symtab_size),
-      reloc_type_(0), track_relocs_()
-  { }
-
- protected:
-  bool
-  do_initialize(unsigned int reloc_shndx, unsigned int reloc_type);
-
-  // Return the next reloc_offset.
-  virtual off_t
-  do_next_offset()
-  { return this->track_relocs_.next_offset(); }
-
-  // Advance to the next relocation past OFFSET.
-  virtual void
-  do_advance(off_t offset)
-  { this->track_relocs_.advance(offset); }
-
-  unsigned int
-  do_get_reloc_target(off_t reloc_offset, off_t* target_offset);
-
- private:
-  typedef typename elfcpp::Elf_types<size>::Elf_Addr Address;
-
-  // Return the section index of symbol SYMNDX, and copy its value to *VALUE.
-  // Set *IS_ORDINARY true if the section index is an ordinary section index.
-  unsigned int
-  symbol_section(unsigned int symndx, Address* value, bool* is_ordinary);
-
-  // The object file.
-  Object* object_;
-  // The ELF symbol table.
-  const unsigned char* symtab_;
-  // The size of the ELF symbol table.
-  off_t symtab_size_;
-  // Type of the relocation section (SHT_REL or SHT_RELA).
-  unsigned int reloc_type_;
-  // Relocations for the referring section.
-  Track_relocs<size, big_endian> track_relocs_;
-};
-
-// This class is used to read the abbreviations table from the
-// .debug_abbrev section of the object file.
-
-class Dwarf_abbrev_table
-{
- public:
-  // An attribute list entry.
-  struct Attribute
-  {
-    Attribute(unsigned int a, unsigned int f)
-      : attr(a), form(f)
-    { }
-    unsigned int attr;
-    unsigned int form;
-  };
-
-  // An abbrev code entry.
-  struct Abbrev_code
-  {
-    Abbrev_code(unsigned int t, bool hc)
-      : tag(t), has_children(hc), has_sibling_attribute(false), attributes()
-    {
-      this->attributes.reserve(10);
-    }
-
-    void
-    add_attribute(unsigned int attr, unsigned int form)
-    {
-      this->attributes.push_back(Attribute(attr, form));
-    }
-
-    // The DWARF tag.
-    unsigned int tag;
-    // True if the DIE has children.
-    bool has_children : 1;
-    // True if the DIE has a sibling attribute.
-    bool has_sibling_attribute : 1;
-    // The list of attributes and forms.
-    std::vector<Attribute> attributes;
-  };
-
-  Dwarf_abbrev_table()
-    : abbrev_shndx_(0), abbrev_offset_(0), buffer_(NULL), buffer_end_(NULL),
-      owns_buffer_(false), high_abbrev_codes_()
-  {
-    memset(this->low_abbrev_codes_, 0, sizeof(this->low_abbrev_codes_));
-  }
-
-  ~Dwarf_abbrev_table()
-  {
-    if (this->owns_buffer_ && this->buffer_ != NULL)
-      delete[] this->buffer_;
-    this->clear_abbrev_codes();
-  }
-
-  // Read the abbrev table from an object file.
-  bool
-  read_abbrevs(Relobj* object,
-	       unsigned int abbrev_shndx,
-	       off_t abbrev_offset)
-  {
-    // If we've already read this abbrev table, return immediately.
-    if (this->abbrev_shndx_ > 0
-	&& this->abbrev_shndx_ == abbrev_shndx
-	&& this->abbrev_offset_ == abbrev_offset)
-      return true;
-    return this->do_read_abbrevs(object, abbrev_shndx, abbrev_offset);
-  }
-
-  // Return the abbrev code entry for CODE.
-  const Abbrev_code*
-  get_abbrev(unsigned int code) const
-  {
-    if (code < this->low_abbrev_code_max_)
-      return this->low_abbrev_codes_[code];
-    Abbrev_code_table::const_iterator it =
-	this->high_abbrev_codes_.find(code);
-    if (it != this->high_abbrev_codes_.end())
-      return it->second;
-    return NULL;
-  }
-
- private:
-  // Read the abbrev table from an object file.
-  bool
-  do_read_abbrevs(Relobj* object,
-		  unsigned int abbrev_shndx,
-		  off_t abbrev_offset);
-
-  // Store an abbrev code entry for CODE.
-  void
-  store_abbrev(unsigned int code, const Abbrev_code* entry)
-  {
-    if (code < this->low_abbrev_code_max_)
-      this->low_abbrev_codes_[code] = entry;
-    else
-      this->high_abbrev_codes_[code] = entry;
-  }
-
-  // Clear the abbrev code table and release the memory it uses.
-  void
-  clear_abbrev_codes();
-
-  typedef Unordered_map<unsigned int, const Abbrev_code*> Abbrev_code_table;
-
-  // The section index of the current abbrev table.
-  unsigned int abbrev_shndx_;
-  // The offset within the section of the current abbrev table.
-  off_t abbrev_offset_;
-  // The buffer containing the .debug_abbrev section.
-  const unsigned char* buffer_;
-  const unsigned char* buffer_end_;
-  // True if this object owns the buffer and needs to delete it.
-  bool owns_buffer_;
-  // The table of abbrev codes.
-  // We use a direct-lookup array for low abbrev codes,
-  // and store the rest in a hash table.
-  static const unsigned int low_abbrev_code_max_ = 256;
-  const Abbrev_code* low_abbrev_codes_[low_abbrev_code_max_];
-  Abbrev_code_table high_abbrev_codes_;
-};
-
-// A DWARF range list.  The start and end offsets are relative
-// to the input section SHNDX.  Each range must lie entirely
-// within a single section.
-
-class Dwarf_range_list
-{
- public:
-  struct Range
-  {
-    Range(unsigned int a_shndx, off_t a_start, off_t a_end)
-      : shndx(a_shndx), start(a_start), end(a_end)
-    { }
-
-    unsigned int shndx;
-    off_t start;
-    off_t end;
-  };
-
-  Dwarf_range_list()
-    : range_list_()
-  { }
-
-  void
-  add(unsigned int shndx, off_t start, off_t end)
-  { this->range_list_.push_back(Range(shndx, start, end)); }
-
-  size_t
-  size() const
-  { return this->range_list_.size(); }
-
-  const Range&
-  operator[](off_t i) const
-  { return this->range_list_[i]; }
-
- private:
-  std::vector<Range> range_list_;
-};
-
-// This class is used to read the ranges table from the
-// .debug_ranges section of the object file.
-
-class Dwarf_ranges_table
-{
- public:
-  Dwarf_ranges_table()
-    : ranges_shndx_(0), ranges_buffer_(NULL), ranges_buffer_end_(NULL),
-      owns_ranges_buffer_(false), ranges_reloc_mapper_(NULL)
-  { }
-
-  ~Dwarf_ranges_table()
-  {
-    if (this->owns_ranges_buffer_ && this->ranges_buffer_ != NULL)
-      delete[] this->ranges_buffer_;
-    if (this->ranges_reloc_mapper_ != NULL)
-      delete this->ranges_reloc_mapper_;
-  }
-
-  // Read the ranges table from an object file.
-  bool
-  read_ranges_table(Relobj* object,
-		    const unsigned char* symtab,
-		    off_t symtab_size,
-		    unsigned int ranges_shndx);
-
-  // Read the range table from an object file.
-  Dwarf_range_list*
-  read_range_list(Relobj* object,
-		  const unsigned char* symtab,
-		  off_t symtab_size,
-		  unsigned int address_size,
-		  unsigned int ranges_shndx,
-		  off_t ranges_offset);
-
- private:
-  // The section index of the ranges table.
-  unsigned int ranges_shndx_;
-  // The buffer containing the .debug_ranges section.
-  const unsigned char* ranges_buffer_;
-  const unsigned char* ranges_buffer_end_;
-  // True if this object owns the buffer and needs to delete it.
-  bool owns_ranges_buffer_;
-  // Relocation mapper for the .debug_ranges section.
-  Elf_reloc_mapper* ranges_reloc_mapper_;
-};
-
-// This class is used to read the pubnames and pubtypes tables from the
-// .debug_pubnames and .debug_pubtypes sections of the object file.
-
-class Dwarf_pubnames_table
-{
- public:
-  Dwarf_pubnames_table()
-    : buffer_(NULL), buffer_end_(NULL), owns_buffer_(false),
-      offset_size_(0), pinfo_(NULL), reloc_mapper_(NULL)
-  { }
-
-  ~Dwarf_pubnames_table()
-  {
-    if (this->owns_buffer_ && this->buffer_ != NULL)
-      delete[] this->buffer_;
-    if (this->reloc_mapper_ != NULL)
-      delete this->reloc_mapper_;
-  }
-
-  // Read the pubnames section SHNDX from the object file.
-  bool
-  read_section(Relobj* object,
-	       const unsigned char* symtab,
-	       off_t symtab_size,
-	       unsigned int shndx);
-
-  // Read the header for the set at OFFSET.
-  bool
-  read_header(off_t offset);
-
-  // Read the next name from the set.
-  const char*
-  next_name();
-
- private:
-  // The buffer containing the .debug_ranges section.
-  const unsigned char* buffer_;
-  const unsigned char* buffer_end_;
-  // True if this object owns the buffer and needs to delete it.
-  bool owns_buffer_;
-  // The size of a DWARF offset for the current set.
-  unsigned int offset_size_;
-  // The current position within the buffer.
-  const unsigned char* pinfo_;
-  // Relocation mapper for the .debug_ranges section.
-  Elf_reloc_mapper* reloc_mapper_;
-};
-
-// This class represents a DWARF Debug Info Entry (DIE).
-
-class Dwarf_die
-{
- public:
-  // An attribute value.
-  struct Attribute_value
-  {
-    unsigned int attr;
-    unsigned int form;
-    union
-    {
-      int64_t intval;
-      uint64_t uintval;
-      const char* stringval;
-      const unsigned char* blockval;
-      off_t refval;
-    } val;
-    union
-    {
-      // Section index for reference forms.
-      unsigned int shndx;
-      // Block length for block forms.
-      unsigned int blocklen;
-      // Attribute offset for DW_FORM_strp.
-      unsigned int attr_off;
-    } aux;
-  };
-
-  // A list of attribute values.
-  typedef std::vector<Attribute_value> Attributes;
-
-  Dwarf_die(Dwarf_info_reader* dwinfo,
-	    off_t die_offset,
-	    Dwarf_die* parent);
-
-  // Return the DWARF tag for this DIE.
-  unsigned int
-  tag() const
-  {
-    if (this->abbrev_code_ == NULL)
-      return 0;
-    return this->abbrev_code_->tag;
-  }
-
-  // Return true if this DIE has children.
-  bool
-  has_children() const
-  {
-    gold_assert(this->abbrev_code_ != NULL);
-    return this->abbrev_code_->has_children;
-  }
-
-  // Return true if this DIE has a sibling attribute.
-  bool
-  has_sibling_attribute() const
-  {
-    gold_assert(this->abbrev_code_ != NULL);
-    return this->abbrev_code_->has_sibling_attribute;
-  }
-
-  // Return the value of attribute ATTR.
-  const Attribute_value*
-  attribute(unsigned int attr);
-
-  // Return the value of the DW_AT_name attribute.
-  const char*
-  name()
-  {
-    if (this->name_ == NULL)
-      this->set_name();
-    return this->name_;
-  }
-
-  // Return the value of the DW_AT_linkage_name
-  // or DW_AT_MIPS_linkage_name attribute.
-  const char*
-  linkage_name()
-  {
-    if (this->linkage_name_ == NULL)
-      this->set_linkage_name();
-    return this->linkage_name_;
-  }
-
-  // Return the value of the DW_AT_specification attribute.
-  off_t
-  specification()
-  {
-    if (!this->attributes_read_)
-      this->read_attributes();
-    return this->specification_;
-  }
-
-  // Return the value of the DW_AT_abstract_origin attribute.
-  off_t
-  abstract_origin()
-  {
-    if (!this->attributes_read_)
-      this->read_attributes();
-    return this->abstract_origin_;
-  }
-
-  // Return the value of attribute ATTR as a string.
-  const char*
-  string_attribute(unsigned int attr);
-
-  // Return the value of attribute ATTR as an integer.
-  int64_t
-  int_attribute(unsigned int attr);
-
-  // Return the value of attribute ATTR as an unsigned integer.
-  uint64_t
-  uint_attribute(unsigned int attr);
-
-  // Return the value of attribute ATTR as a reference.
-  off_t
-  ref_attribute(unsigned int attr,
-		unsigned int* shndx);
-
-  // Return the value of attribute ATTR as a flag.
-  bool
-  flag_attribute(unsigned int attr)
-  { return this->int_attribute(attr) != 0; }
-
-  // Return true if this DIE is a declaration.
-  bool
-  is_declaration()
-  { return this->flag_attribute(elfcpp::DW_AT_declaration); }
-
-  // Return the parent of this DIE.
-  Dwarf_die*
-  parent() const
-  { return this->parent_; }
-
-  // Return the offset of this DIE.
-  off_t
-  offset() const
-  { return this->die_offset_; }
-
-  // Return the offset of this DIE's first child.
-  off_t
-  child_offset();
-
-  // Set the offset of this DIE's next sibling.
-  void
-  set_sibling_offset(off_t sibling_offset)
-  { this->sibling_offset_ = sibling_offset; }
-
-  // Return the offset of this DIE's next sibling.
-  off_t
-  sibling_offset();
-
- private:
-  typedef Dwarf_abbrev_table::Abbrev_code Abbrev_code;
-
-  // Read all the attributes of the DIE.
-  bool
-  read_attributes();
-
-  // Set the name of the DIE if present.
-  void
-  set_name();
-
-  // Set the linkage name if present.
-  void
-  set_linkage_name();
-
-  // Skip all the attributes of the DIE and return the offset
-  // of the next DIE.
-  off_t
-  skip_attributes();
-
-  // The Dwarf_info_reader, for reading attributes.
-  Dwarf_info_reader* dwinfo_;
-  // The parent of this DIE.
-  Dwarf_die* parent_;
-  // Offset of this DIE within its compilation unit.
-  off_t die_offset_;
-  // Offset of the first attribute, relative to the beginning of the DIE.
-  off_t attr_offset_;
-  // Offset of the first child, relative to the compilation unit.
-  off_t child_offset_;
-  // Offset of the next sibling, relative to the compilation unit.
-  off_t sibling_offset_;
-  // The abbreviation table entry.
-  const Abbrev_code* abbrev_code_;
-  // The list of attributes.
-  Attributes attributes_;
-  // True if the attributes have been read.
-  bool attributes_read_;
-  // The following fields hold common attributes to avoid a linear
-  // search through the attribute list.
-  // The DIE name (DW_AT_name).
-  const char* name_;
-  // Offset of the name in the string table (for DW_FORM_strp).
-  off_t name_off_;
-  // The linkage name (DW_AT_linkage_name or DW_AT_MIPS_linkage_name).
-  const char* linkage_name_;
-  // Offset of the linkage name in the string table (for DW_FORM_strp).
-  off_t linkage_name_off_;
-  // Section index of the string table (for DW_FORM_strp).
-  unsigned int string_shndx_;
-  // The value of a DW_AT_specification attribute.
-  off_t specification_;
-  // The value of a DW_AT_abstract_origin attribute.
-  off_t abstract_origin_;
-};
-
-// This class is used to read the debug info from the .debug_info
-// or .debug_types sections.  This is a base class that implements
-// the generic parsing of the compilation unit header and DIE
-// structure.  The parse() method parses the entire section, and
-// calls the various visit_xxx() methods for each header.  Clients
-// should derive a new class from this one and implement the
-// visit_compilation_unit() and visit_type_unit() functions.
-
-class Dwarf_info_reader
-{
- public:
-  Dwarf_info_reader(bool is_type_unit,
-		    Relobj* object,
-		    const unsigned char* symtab,
-		    off_t symtab_size,
-		    unsigned int shndx,
-		    unsigned int reloc_shndx,
-		    unsigned int reloc_type)
-    : is_type_unit_(is_type_unit), object_(object), symtab_(symtab),
-      symtab_size_(symtab_size), shndx_(shndx), reloc_shndx_(reloc_shndx),
-      reloc_type_(reloc_type), string_shndx_(0), buffer_(NULL),
-      buffer_end_(NULL), cu_offset_(0), cu_length_(0), offset_size_(0),
-      address_size_(0), cu_version_(0), type_signature_(0), type_offset_(0),
-      abbrev_table_(), reloc_mapper_(NULL), string_buffer_(NULL),
-      string_buffer_end_(NULL), owns_string_buffer_(false)
-  { }
-
-  virtual
-  ~Dwarf_info_reader()
-  {
-    if (this->reloc_mapper_ != NULL)
-      delete this->reloc_mapper_;
-    if (this->owns_string_buffer_ && this->string_buffer_ != NULL)
-      delete[] this->string_buffer_;
-  }
-
-  // Begin parsing the debug info.  This calls visit_compilation_unit()
-  // or visit_type_unit() for each compilation or type unit found in the
-  // section, and visit_die() for each top-level DIE.
-  void
-  parse();
-
-  // Return the abbrev code entry for a CODE.
-  const Dwarf_abbrev_table::Abbrev_code*
-  get_abbrev(unsigned int code) const
-  { return this->abbrev_table_.get_abbrev(code); }
-
-  // Return a pointer to the DWARF info buffer at OFFSET.
-  const unsigned char*
-  buffer_at_offset(off_t offset) const
-  {
-    const unsigned char* p = this->buffer_ + this->cu_offset_ + offset;
-    if (this->check_buffer(p + 1))
-      return p;
-    return NULL;
-  }
-
-  // Look for a relocation at offset ATTR_OFF in the dwarf info,
-  // and return the section index and offset of the target.
-  unsigned int
-  lookup_reloc(off_t attr_off, off_t* target_off);
-
-  // Return a string from the DWARF string table.
-  const char*
-  get_string(off_t str_off, unsigned int string_shndx);
-
-  // Return the size of a DWARF offset.
-  unsigned int
-  offset_size() const
-  { return this->offset_size_; }
-
-  // Return the size of an address.
-  unsigned int
-  address_size() const
-  { return this->address_size_; }
-
- protected:
-  // Begin parsing the debug info.  This calls visit_compilation_unit()
-  // or visit_type_unit() for each compilation or type unit found in the
-  // section, and visit_die() for each top-level DIE.
-  template<bool big_endian>
-  void
-  do_parse();
-
-  // The following methods are hooks that are meant to be implemented
-  // by a derived class.  A default, do-nothing, implementation of
-  // each is provided for this base class.
-
-  // Visit a compilation unit.
-  virtual void
-  visit_compilation_unit(off_t cu_offset, off_t cu_length, Dwarf_die* root_die);
-
-  // Visit a type unit.
-  virtual void
-  visit_type_unit(off_t tu_offset, off_t type_offset, uint64_t signature,
-		  Dwarf_die* root_die);
-
-  // Read the range table.
-  Dwarf_range_list*
-  read_range_list(unsigned int ranges_shndx, off_t ranges_offset)
-  {
-    return this->ranges_table_.read_range_list(this->object_,
-					       this->symtab_,
-					       this->symtab_size_,
-					       this->address_size_,
-					       ranges_shndx,
-					       ranges_offset);
-  }
-
-  // Return the object.
-  Relobj*
-  object() const
-  { return this->object_; }
-
-  // Return a pointer to the object file's ELF symbol table.
-  const unsigned char*
-  symtab() const
-  { return this->symtab_; }
-
-  // Return the size of the object file's ELF symbol table.
-  off_t
-  symtab_size() const
-  { return this->symtab_size_; }
-
- private:
-  // Check that P is within the bounds of the current section.
-  bool
-  check_buffer(const unsigned char* p) const;
-
-  // Read the DWARF string table.
-  bool
-  read_string_table(unsigned int string_shndx)
-  {
-    // If we've already read this string table, return immediately.
-    if (this->string_shndx_ > 0 && this->string_shndx_ == string_shndx)
-      return true;
-    if (string_shndx == 0 && this->string_shndx_ > 0)
-      return true;
-    return this->do_read_string_table(string_shndx);
-  }
-
-  bool
-  do_read_string_table(unsigned int string_shndx);
-
-  // True if this is a type unit; false for a compilation unit.
-  bool is_type_unit_;
-  // The object containing the .debug_info or .debug_types input section.
-  Relobj* object_;
-  // The ELF symbol table.
-  const unsigned char* symtab_;
-  // The size of the ELF symbol table.
-  off_t symtab_size_;
-  // Index of the .debug_info or .debug_types section.
-  unsigned int shndx_;
-  // Index of the relocation section.
-  unsigned int reloc_shndx_;
-  // Type of the relocation section (SHT_REL or SHT_RELA).
-  unsigned int reloc_type_;
-  // Index of the .debug_str section.
-  unsigned int string_shndx_;
-  // The buffer for the debug info.
-  const unsigned char* buffer_;
-  const unsigned char* buffer_end_;
-  // Offset of the current compilation unit.
-  off_t cu_offset_;
-  // Length of the current compilation unit.
-  off_t cu_length_;
-  // Size of a DWARF offset for the current compilation unit.
-  unsigned int offset_size_;
-  // Size of an address for the target architecture.
-  unsigned int address_size_;
-  // Compilation unit version number.
-  unsigned int cu_version_;
-  // Type signature (for a type unit).
-  uint64_t type_signature_;
-  // Offset from the type unit header to the type DIE (for a type unit).
-  off_t type_offset_;
-  // Abbreviations table for current compilation unit.
-  Dwarf_abbrev_table abbrev_table_;
-  // Ranges table for the current compilation unit.
-  Dwarf_ranges_table ranges_table_;
-  // Relocation mapper for the section.
-  Elf_reloc_mapper* reloc_mapper_;
-  // The buffer for the debug string table.
-  const char* string_buffer_;
-  const char* string_buffer_end_;
-  // True if this object owns the buffer and needs to delete it.
-  bool owns_string_buffer_;
-};
+class Track_relocs;
+struct LineStateMachine;
 
 // We can't do better than to keep the offsets in a sorted vector.
 // Here, offset is the key, and file_num/line_num is the value.
@@ -883,12 +133,18 @@
   // If SHNDX is non-negative, only store debug information that
   // pertains to the specified section.
   void
-  read_line_mappings(unsigned int shndx);
+  read_line_mappings(Object*, unsigned int shndx);
 
   // Reads the relocation section associated with .debug_line and
   // stores relocation information in reloc_map_.
   void
-  read_relocs();
+  read_relocs(Object*);
+
+  // Looks in the symtab to see what section a symbol is in.
+  unsigned int
+  symbol_section(Object*, unsigned int sym,
+                 typename elfcpp::Elf_types<size>::Elf_Addr* value,
+		 bool* is_ordinary);
 
   // Reads the DWARF2/3 header for this line info.  Each takes as input
   // a starting buffer position, and returns the ending position.
@@ -945,7 +201,7 @@
   const unsigned char* buffer_end_;
 
   // This has relocations that point into buffer.
-  Sized_elf_reloc_mapper<size, big_endian>* reloc_mapper_;
+  Track_relocs<size, big_endian> track_relocs_;
   // The type of the reloc section in track_relocs_--SHT_REL or SHT_RELA.
   unsigned int track_relocs_type_;
 
@@ -965,7 +221,9 @@
 
   // A sorted map from offset of the relocation target to the shndx
   // and addend for the relocation.
-  typedef std::map<off_t, std::pair<unsigned int, off_t> >
+  typedef std::map<typename elfcpp::Elf_types<size>::Elf_Addr,
+                   std::pair<unsigned int,
+                             typename elfcpp::Elf_types<size>::Elf_Swxword> >
   Reloc_map;
   Reloc_map reloc_map_;
 
diff --git a/binutils/binutils-2.21/gold/fileread.cc b/binutils/binutils-2.21/gold/fileread.cc
index 68a6550..691d47f 100644
--- a/binutils/binutils-2.21/gold/fileread.cc
+++ b/binutils/binutils-2.21/gold/fileread.cc
@@ -284,10 +284,6 @@
 File_read::find_view(off_t start, section_size_type size,
 		     unsigned int byteshift, File_read::View** vshifted) const
 {
-  gold_assert(start <= this->size_
-	      && (static_cast<unsigned long long>(size)
-		  <= static_cast<unsigned long long>(this->size_ - start)));
-
   if (vshifted != NULL)
     *vshifted = NULL;
 
@@ -415,9 +411,16 @@
 		     unsigned int byteshift, bool cache)
 {
   gold_assert(size > 0);
-  gold_assert(start <= this->size_
-	      && (static_cast<unsigned long long>(size)
-		  <= static_cast<unsigned long long>(this->size_ - start)));
+
+  // Check that start and end of the view are within the file.
+  if (start > this->size_
+      || (static_cast<unsigned long long>(size)
+          > static_cast<unsigned long long>(this->size_ - start)))
+    gold_fatal(_("%s: attempt to map %lld bytes at offset %lld exceeds "
+                 "size of file; the file may be corrupt"),
+		   this->filename().c_str(),
+		   static_cast<long long>(size),
+		   static_cast<long long>(start));
 
   off_t poff = File_read::page_offset(start);
 
@@ -469,16 +472,6 @@
 File_read::find_or_make_view(off_t offset, off_t start,
 			     section_size_type size, bool aligned, bool cache)
 {
-  // Check that start and end of the view are within the file.
-  if (start > this->size_
-      || (static_cast<unsigned long long>(size)
-          > static_cast<unsigned long long>(this->size_ - start)))
-    gold_fatal(_("%s: attempt to map %lld bytes at offset %lld exceeds "
-                 "size of file; the file may be corrupt"),
-		   this->filename().c_str(),
-		   static_cast<long long>(size),
-		   static_cast<long long>(start));
-
   unsigned int byteshift;
   if (offset == 0)
     byteshift = 0;
diff --git a/binutils/binutils-2.21/gold/gdb-index.cc b/binutils/binutils-2.21/gold/gdb-index.cc
deleted file mode 100644
index 8e47e48..0000000
--- a/binutils/binutils-2.21/gold/gdb-index.cc
+++ /dev/null
@@ -1,1169 +0,0 @@
-// gdb-index.cc -- generate .gdb_index section for fast debug lookup
-
-// Copyright 2011 Free Software Foundation, Inc.
-// Written by Cary Coutant <ccoutant@google.com>.
-
-// This file is part of gold.
-
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 of the License, or
-// (at your option) any later version.
-
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
-// MA 02110-1301, USA.
-
-#include "gold.h"
-
-#include "gdb-index.h"
-#include "dwarf_reader.h"
-#include "dwarf.h"
-#include "object.h"
-#include "output.h"
-#include "demangle.h"
-
-namespace gold
-{
-
-// FIXME: Change to version 5.
-// The gdb in use at google currently supports version 4.
-const int gdb_index_version = 4;
-
-// Sizes of various records in the .gdb_index section.
-const int gdb_index_offset_size = 4;
-const int gdb_index_hdr_size = 6 * gdb_index_offset_size;
-const int gdb_index_cu_size = 16;
-const int gdb_index_tu_size = 24;
-const int gdb_index_addr_size = 16 + gdb_index_offset_size;
-const int gdb_index_sym_size = 2 * gdb_index_offset_size;
-
-// This class manages the hashed symbol table for the .gdb_index section.
-// It is essentially equivalent to the hashtab implementation in libiberty,
-// but is copied into gdb sources and here for compatibility because its
-// data structure is exposed on disk.
-
-template <typename T>
-class Gdb_hashtab
-{
- public:
-  Gdb_hashtab()
-    : size_(0), capacity_(0), hashtab_(NULL)
-  { }
-
-  ~Gdb_hashtab()
-  {
-    for (size_t i = 0; i < this->capacity_; ++i)
-      if (this->hashtab_[i] != NULL)
-	delete this->hashtab_[i];
-    delete[] this->hashtab_;
-  }
-
-  // Add a symbol.
-  T*
-  add(T* symbol)
-  {
-    // Resize the hash table if necessary.
-    if (4 * this->size_ / 3 >= this->capacity_)
-      this->expand();
-
-    T** slot = this->find_slot(symbol);
-    if (*slot == NULL)
-      {
-	++this->size_;
-	*slot = symbol;
-      }
-
-    return *slot;
-  }
-
-  // Return the current size.
-  size_t
-  size() const
-  { return this->size_; }
-
-  // Return the current capacity.
-  size_t
-  capacity() const
-  { return this->capacity_; }
-
-  // Return the contents of slot N.
-  T*
-  operator[](size_t n)
-  { return this->hashtab_[n]; }
-
- private:
-  // Find a symbol in the hash table, or return an empty slot if
-  // the symbol is not in the table.
-  T**
-  find_slot(T* symbol)
-  {
-    unsigned int index = symbol->hash() & (this->capacity_ - 1);
-    unsigned int step = ((symbol->hash() * 17) & (this->capacity_ - 1)) | 1;
-
-    for (;;)
-      {
-	if (this->hashtab_[index] == NULL
-	    || this->hashtab_[index]->equal(symbol))
-	  return &this->hashtab_[index];
-	index = (index + step) & (this->capacity_ - 1);
-      }
-  }
-
-  // Expand the hash table.
-  void
-  expand()
-  {
-    if (this->capacity_ == 0)
-      {
-	// Allocate the hash table for the first time.
-	this->capacity_ = Gdb_hashtab::initial_size;
-	this->hashtab_ = new T*[this->capacity_];
-	memset(this->hashtab_, 0, this->capacity_ * sizeof(T*));
-      }
-    else
-      {
-	// Expand and rehash.
-	unsigned int old_cap = this->capacity_;
-	T** old_hashtab = this->hashtab_;
-	this->capacity_ *= 2;
-	this->hashtab_ = new T*[this->capacity_];
-	memset(this->hashtab_, 0, this->capacity_ * sizeof(T*));
-	for (size_t i = 0; i < old_cap; ++i)
-	  {
-	    if (old_hashtab[i] != NULL)
-	      {
-		T** slot = this->find_slot(old_hashtab[i]);
-		*slot = old_hashtab[i];
-	      }
-	  }
-	delete[] old_hashtab;
-      }
-  }
-
-  // Initial size of the hash table; must be a power of 2.
-  static const int initial_size = 1024;
-  size_t size_;
-  size_t capacity_;
-  T** hashtab_;
-};
-
-// The hash function for strings in the mapped index.  This is copied
-// directly from gdb/dwarf2read.c.
-
-static unsigned int
-mapped_index_string_hash(const unsigned char* str)
-{
-  unsigned int r = 0;
-  unsigned char c;
-
-  while ((c = *str++) != 0)
-    {
-      if (gdb_index_version >= 5)
-	c = tolower (c);
-      r = r * 67 + c - 113;
-    }
-
-  return r;
-}
-
-// A specialization of Dwarf_info_reader, for building the .gdb_index.
-
-class Gdb_index_info_reader : public Dwarf_info_reader
-{
- public:
-  Gdb_index_info_reader(bool is_type_unit,
-			Relobj* object,
-			const unsigned char* symbols,
-			off_t symbols_size,
-			unsigned int shndx,
-			unsigned int reloc_shndx,
-			unsigned int reloc_type,
-			Gdb_index* gdb_index)
-    : Dwarf_info_reader(is_type_unit, object, symbols, symbols_size, shndx,
-			reloc_shndx, reloc_type),
-      gdb_index_(gdb_index), cu_index_(0), cu_language_(0)
-  { }
-
-  ~Gdb_index_info_reader()
-  { this->clear_declarations(); }
-
- protected:
-  // Visit a compilation unit.
-  virtual void
-  visit_compilation_unit(off_t cu_offset, off_t cu_length, Dwarf_die*);
-
-  // Visit a type unit.
-  virtual void
-  visit_type_unit(off_t tu_offset, off_t type_offset, uint64_t signature,
-		  Dwarf_die*);
-
- private:
-  // A map for recording DIEs we've seen that may be referred to be
-  // later DIEs (via DW_AT_specification or DW_AT_abstract_origin).
-  // The map is indexed by a DIE offset within the compile unit.
-  // PARENT_OFFSET_ is the offset of the DIE that represents the
-  // outer context, and NAME_ is a pointer to a component of the
-  // fully-qualified name.
-  // Normally, the names we point to are in a string table, so we don't
-  // have to manage them, but when we have a fully-qualified name
-  // computed, we put it in the table, and set PARENT_OFFSET_ to -1
-  // indicate a string that we are managing.
-  struct Declaration_pair
-  {
-    Declaration_pair(off_t parent_offset, const char* name)
-      : parent_offset_(parent_offset), name_(name)
-    { }
-
-    off_t parent_offset_;
-    const char* name_; 
-  };
-  typedef Unordered_map<off_t, Declaration_pair> Declaration_map;
-
-  // Visit a top-level DIE.
-  void
-  visit_top_die(Dwarf_die* die);
-
-  // Visit the children of a DIE.
-  void
-  visit_children(Dwarf_die* die, Dwarf_die* context);
-
-  // Visit a DIE.
-  void
-  visit_die(Dwarf_die* die, Dwarf_die* context);
-
-  // Visit the children of a DIE.
-  void
-  visit_children_for_decls(Dwarf_die* die);
-
-  // Visit a DIE.
-  void
-  visit_die_for_decls(Dwarf_die* die, Dwarf_die* context);
-
-  // Guess a fully-qualified name for a class type, based on member function
-  // linkage names.
-  std::string
-  guess_full_class_name(Dwarf_die* die);
-
-  // Add a declaration DIE to the table of declarations.
-  void
-  add_declaration(Dwarf_die* die, Dwarf_die* context);
-
-  // Add a declaration whose fully-qualified name is already known.
-  void
-  add_declaration_with_full_name(Dwarf_die* die, const char* full_name);
-
-  // Return the context for a DIE whose parent is at DIE_OFFSET.
-  std::string
-  get_context(off_t die_offset);
-
-  // Construct a fully-qualified name for DIE.
-  std::string
-  get_qualified_name(Dwarf_die* die, Dwarf_die* context);
-
-  // Record the address ranges for a compilation unit.
-  void
-  record_cu_ranges(Dwarf_die* die);
-
-  // Read the .debug_pubnames and .debug_pubtypes tables.
-  bool
-  read_pubnames_and_pubtypes(Dwarf_die* die);
-
-  // Clear the declarations map.
-  void
-  clear_declarations();
-
-  // The Gdb_index section.
-  Gdb_index* gdb_index_;
-  // The current CU index (negative for a TU).
-  int cu_index_;
-  // The language of the current CU or TU.
-  unsigned int cu_language_;
-  // Map from DIE offset to (parent offset, name) pair,
-  // for DW_AT_specification.
-  Declaration_map declarations_;
-};
-
-// Process a compilation unit and parse its child DIE.
-
-void
-Gdb_index_info_reader::visit_compilation_unit(off_t cu_offset, off_t cu_length,
-					      Dwarf_die* root_die)
-{
-  this->cu_index_ = this->gdb_index_->add_comp_unit(cu_offset, cu_length);
-  this->visit_top_die(root_die);
-}
-
-// Process a type unit and parse its child DIE.
-
-void
-Gdb_index_info_reader::visit_type_unit(off_t tu_offset, off_t type_offset,
-				       uint64_t signature, Dwarf_die* root_die)
-{
-  // Use a negative index to flag this as a TU instead of a CU.
-  this->cu_index_ = -1 - this->gdb_index_->add_type_unit(tu_offset, type_offset,
-							 signature);
-  this->visit_top_die(root_die);
-}
-
-// Process a top-level DIE.
-// For compile_unit DIEs, record the address ranges.  For all
-// interesting tags, add qualified names to the symbol table
-// and process interesting children.  We may need to process
-// certain children just for saving declarations that might be
-// referenced by later DIEs with a DW_AT_specification attribute.
-
-void
-Gdb_index_info_reader::visit_top_die(Dwarf_die* die)
-{
-  this->clear_declarations();
-
-  switch (die->tag())
-    {
-      case elfcpp::DW_TAG_compile_unit:
-      case elfcpp::DW_TAG_type_unit:
-	this->cu_language_ = die->int_attribute(elfcpp::DW_AT_language);
-	// Check for languages that require specialized knowledge to
-	// construct fully-qualified names, that we don't yet support.
-	if (this->cu_language_ == elfcpp::DW_LANG_Ada83
-	    || this->cu_language_ == elfcpp::DW_LANG_Fortran77
-	    || this->cu_language_ == elfcpp::DW_LANG_Fortran90
-	    || this->cu_language_ == elfcpp::DW_LANG_Java
-	    || this->cu_language_ == elfcpp::DW_LANG_Ada95
-	    || this->cu_language_ == elfcpp::DW_LANG_Fortran95)
-	  {
-	    gold_warning(_("%s: --gdb-index currently supports "
-			   "only C and C++ languages"),
-			 this->object()->name().c_str());
-	    return;
-	  }
-	if (die->tag() == elfcpp::DW_TAG_compile_unit)
-	  this->record_cu_ranges(die);
-	// If there is a pubnames and/or pubtypes section for this
-	// compilation unit, use those; otherwise, parse the DWARF
-	// info to extract the names.
-	if (!this->read_pubnames_and_pubtypes(die))
-	  this->visit_children(die, NULL);
-	break;
-      default:
-	// The top level DIE should be one of the above.
-	gold_warning(_("%s: top level DIE is not DW_TAG_compile_unit "
-		       "or DW_TAG_type_unit"),
-		     this->object()->name().c_str());
-	return;
-    }
-
-}
-
-// Visit the children of PARENT, looking for symbols to add to the index.
-// CONTEXT points to the DIE to use for constructing the qualified name --
-// NULL if PARENT is the top-level DIE; otherwise it is the same as PARENT.
-
-void
-Gdb_index_info_reader::visit_children(Dwarf_die* parent, Dwarf_die* context)
-{
-  off_t next_offset = 0;
-  for (off_t die_offset = parent->child_offset();
-       die_offset != 0;
-       die_offset = next_offset)
-    {
-      Dwarf_die die(this, die_offset, parent);
-      if (die.tag() == 0)
-	break;
-      this->visit_die(&die, context);
-      next_offset = die.sibling_offset();
-    }
-}
-
-// Visit a child DIE, looking for symbols to add to the index.
-// CONTEXT is the parent DIE, used for constructing the qualified name;
-// it is NULL if the parent DIE is the top-level DIE.
-
-void
-Gdb_index_info_reader::visit_die(Dwarf_die* die, Dwarf_die* context)
-{
-  switch (die->tag())
-    {
-      case elfcpp::DW_TAG_subprogram:
-      case elfcpp::DW_TAG_constant:
-      case elfcpp::DW_TAG_variable:
-      case elfcpp::DW_TAG_enumerator:
-      case elfcpp::DW_TAG_base_type:
-	if (die->is_declaration())
-	  this->add_declaration(die, context);
-	else
-	  {
-	    // If the DIE is not a declaration, add it to the index.
-	    std::string full_name = this->get_qualified_name(die, context);
-	    if (!full_name.empty())
-	      this->gdb_index_->add_symbol(this->cu_index_, full_name.c_str());
-	  }
-	break;
-      case elfcpp::DW_TAG_typedef:
-      case elfcpp::DW_TAG_union_type:
-      case elfcpp::DW_TAG_class_type:
-      case elfcpp::DW_TAG_interface_type:
-      case elfcpp::DW_TAG_structure_type:
-      case elfcpp::DW_TAG_enumeration_type:
-      case elfcpp::DW_TAG_subrange_type:
-      case elfcpp::DW_TAG_namespace:
-	{
-	  std::string full_name;
-	  
-	  // For classes at the top level, we need to look for a
-	  // member function with a linkage name in order to get
-	  // the properly-canonicalized name.
-	  if (context == NULL
-	      && (die->tag() == elfcpp::DW_TAG_class_type
-		  || die->tag() == elfcpp::DW_TAG_structure_type
-		  || die->tag() == elfcpp::DW_TAG_union_type))
-	    full_name.assign(this->guess_full_class_name(die));
-
-	  // Because we will visit the children, we need to add this DIE
-	  // to the declarations table.
-	  if (full_name.empty())
-	    this->add_declaration(die, context);
-	  else
-	    this->add_declaration_with_full_name(die, full_name.c_str());
-
-	  // If the DIE is not a declaration, add it to the index.
-	  // Gdb stores a namespace in the index even when it is
-	  // a declaration.
-	  if (die->tag() == elfcpp::DW_TAG_namespace
-	      || !die->is_declaration())
-	    {
-	      if (full_name.empty())
-		full_name = this->get_qualified_name(die, context);
-	      if (!full_name.empty())
-		this->gdb_index_->add_symbol(this->cu_index_,
-					     full_name.c_str());
-	    }
-
-	  // We're interested in the children only for namespaces and
-	  // enumeration types.  For enumeration types, we do not include
-	  // the enumeration tag as part of the full name.  For other tags,
-	  // visit the children only to collect declarations.
-	  if (die->tag() == elfcpp::DW_TAG_namespace
-	      || die->tag() == elfcpp::DW_TAG_enumeration_type)
-	    this->visit_children(die, die);
-	  else
-	    this->visit_children_for_decls(die);
-	}
-	break;
-      default:
-	break;
-    }
-}
-
-// Visit the children of PARENT, looking only for declarations that
-// may be referenced by later specification DIEs.
-
-void
-Gdb_index_info_reader::visit_children_for_decls(Dwarf_die* parent)
-{
-  off_t next_offset = 0;
-  for (off_t die_offset = parent->child_offset();
-       die_offset != 0;
-       die_offset = next_offset)
-    {
-      Dwarf_die die(this, die_offset, parent);
-      if (die.tag() == 0)
-	break;
-      this->visit_die_for_decls(&die, parent);
-      next_offset = die.sibling_offset();
-    }
-}
-
-// Visit a child DIE, looking only for declarations that
-// may be referenced by later specification DIEs.
-
-void
-Gdb_index_info_reader::visit_die_for_decls(Dwarf_die* die, Dwarf_die* context)
-{
-  switch (die->tag())
-    {
-      case elfcpp::DW_TAG_subprogram:
-      case elfcpp::DW_TAG_constant:
-      case elfcpp::DW_TAG_variable:
-      case elfcpp::DW_TAG_enumerator:
-      case elfcpp::DW_TAG_base_type:
-	{
-	  if (die->is_declaration())
-	    this->add_declaration(die, context);
-	}
-	break;
-      case elfcpp::DW_TAG_typedef:
-      case elfcpp::DW_TAG_union_type:
-      case elfcpp::DW_TAG_class_type:
-      case elfcpp::DW_TAG_interface_type:
-      case elfcpp::DW_TAG_structure_type:
-      case elfcpp::DW_TAG_enumeration_type:
-      case elfcpp::DW_TAG_subrange_type:
-      case elfcpp::DW_TAG_namespace:
-	{
-	  if (die->is_declaration())
-	    this->add_declaration(die, context);
-	  this->visit_children_for_decls(die);
-	}
-	break;
-      default:
-	break;
-    }
-}
-
-// Extract the class name from the linkage name of a member function.
-// This code is adapted from ../gdb/cp-support.c.
-
-#define d_left(dc) (dc)->u.s_binary.left
-#define d_right(dc) (dc)->u.s_binary.right
-
-static char*
-class_name_from_linkage_name(const char* linkage_name)
-{
-  void* storage;
-  struct demangle_component* tree =
-      cplus_demangle_v3_components(linkage_name, DMGL_NO_OPTS, &storage);
-  if (tree == NULL)
-    return NULL;
-
-  int done = 0;
-
-  // First strip off any qualifiers, if we have a function or
-  // method.
-  while (!done)
-    switch (tree->type)
-      {
-	case DEMANGLE_COMPONENT_CONST:
-	case DEMANGLE_COMPONENT_RESTRICT:
-	case DEMANGLE_COMPONENT_VOLATILE:
-	case DEMANGLE_COMPONENT_CONST_THIS:
-	case DEMANGLE_COMPONENT_RESTRICT_THIS:
-	case DEMANGLE_COMPONENT_VOLATILE_THIS:
-	case DEMANGLE_COMPONENT_VENDOR_TYPE_QUAL:
-	  tree = d_left(tree);
-	  break;
-	default:
-	  done = 1;
-	  break;
-      }
-
-  // If what we have now is a function, discard the argument list.
-  if (tree->type == DEMANGLE_COMPONENT_TYPED_NAME)
-    tree = d_left(tree);
-
-  // If what we have now is a template, strip off the template
-  // arguments.  The left subtree may be a qualified name.
-  if (tree->type == DEMANGLE_COMPONENT_TEMPLATE)
-    tree = d_left(tree);
-
-  // What we have now should be a name, possibly qualified.
-  // Additional qualifiers could live in the left subtree or the right
-  // subtree.  Find the last piece.
-  done = 0;
-  struct demangle_component* prev_comp = NULL;
-  struct demangle_component* cur_comp = tree;
-  while (!done)
-    switch (cur_comp->type)
-      {
-	case DEMANGLE_COMPONENT_QUAL_NAME:
-	case DEMANGLE_COMPONENT_LOCAL_NAME:
-	  prev_comp = cur_comp;
-	  cur_comp = d_right(cur_comp);
-	  break;
-	case DEMANGLE_COMPONENT_TEMPLATE:
-	case DEMANGLE_COMPONENT_NAME:
-	case DEMANGLE_COMPONENT_CTOR:
-	case DEMANGLE_COMPONENT_DTOR:
-	case DEMANGLE_COMPONENT_OPERATOR:
-	case DEMANGLE_COMPONENT_EXTENDED_OPERATOR:
-	  done = 1;
-	  break;
-	default:
-	  done = 1;
-	  cur_comp = NULL;
-	  break;
-      }
-
-  char* ret = NULL;
-  if (cur_comp != NULL && prev_comp != NULL)
-    {
-      // We want to discard the rightmost child of PREV_COMP.
-      *prev_comp = *d_left(prev_comp);
-      size_t allocated_size;
-      ret = cplus_demangle_print(DMGL_NO_OPTS, tree, 30, &allocated_size);
-    }
-
-  free(storage);
-  return ret;
-}
-
-// Guess a fully-qualified name for a class type, based on member function
-// linkage names.  This is needed for class/struct/union types at the
-// top level, because GCC does not always properly embed them within
-// the namespace.  As in gdb, we look for a member function with a linkage
-// name and extract the qualified name from the demangled name.
-
-std::string
-Gdb_index_info_reader::guess_full_class_name(Dwarf_die* die)
-{
-  std::string full_name;
-  off_t next_offset = 0;
-  for (off_t child_offset = die->child_offset();
-       child_offset != 0;
-       child_offset = next_offset)
-    {
-      Dwarf_die child(this, child_offset, die);
-      if (child.tag() == 0)
-	break;
-      if (child.tag() == elfcpp::DW_TAG_subprogram)
-        {
-          const char* linkage_name = child.linkage_name();
-	  if (linkage_name != NULL)
-	    {
-	      char* guess = class_name_from_linkage_name(linkage_name);
-	      if (guess != NULL)
-	        {
-		  full_name.assign(guess);
-		  free(guess);
-		  break;
-	        }
-	    }
-        }
-      next_offset = child.sibling_offset();
-    }
-  return full_name;
-}
-
-// Add a declaration DIE to the table of declarations.
-
-void
-Gdb_index_info_reader::add_declaration(Dwarf_die* die, Dwarf_die* context)
-{
-  const char* name = die->name();
-
-  off_t parent_offset = context != NULL ? context->offset() : 0;
-
-  // If this DIE has a DW_AT_specification or DW_AT_abstract_origin
-  // attribute, use the parent and name from the earlier declaration.
-  off_t spec = die->specification();
-  if (spec == 0)
-    spec = die->abstract_origin();
-  if (spec > 0)
-    {
-      Declaration_map::iterator it = this->declarations_.find(spec);
-      if (it != this->declarations_.end())
-        {
-	  parent_offset = it->second.parent_offset_;
-	  name = it->second.name_;
-        }
-    }
-
-  if (name == NULL)
-    {
-      if (die->tag() == elfcpp::DW_TAG_namespace)
-        name = "(anonymous namespace)";
-      else if (die->tag() == elfcpp::DW_TAG_union_type)
-        name = "(anonymous union)";
-      else
-        name = "(unknown)";
-    }
-
-  Declaration_pair decl(parent_offset, name);
-  this->declarations_.insert(std::make_pair(die->offset(), decl));
-}
-
-// Add a declaration whose fully-qualified name is already known.
-// In the case where we had to get the canonical name by demangling
-// a linkage name, this ensures we use that name instead of the one
-// provided in DW_AT_name.
-
-void
-Gdb_index_info_reader::add_declaration_with_full_name(
-    Dwarf_die* die,
-    const char* full_name)
-{
-  // We need to copy the name.
-  int len = strlen(full_name);
-  char* copy = new char[len + 1];
-  memcpy(copy, full_name, len + 1);
-
-  // Flag that we now manage the memory this points to.
-  Declaration_pair decl(-1, copy);
-  this->declarations_.insert(std::make_pair(die->offset(), decl));
-}
-
-// Return the context for a DIE whose parent is at DIE_OFFSET.
-
-std::string
-Gdb_index_info_reader::get_context(off_t die_offset)
-{
-  std::string context;
-  Declaration_map::iterator it = this->declarations_.find(die_offset);
-  if (it != this->declarations_.end())
-    {
-      off_t parent_offset = it->second.parent_offset_;
-      if (parent_offset > 0)
-	{
-	  context = get_context(parent_offset);
-	  context.append("::");
-	}
-      if (it->second.name_ != NULL)
-        context.append(it->second.name_);
-    }
-  return context;
-}
-
-// Construct the fully-qualified name for DIE.
-
-std::string
-Gdb_index_info_reader::get_qualified_name(Dwarf_die* die, Dwarf_die* context)
-{
-  std::string full_name;
-  const char* name = die->name();
-
-  off_t parent_offset = context != NULL ? context->offset() : 0;
-
-  // If this DIE has a DW_AT_specification or DW_AT_abstract_origin
-  // attribute, use the parent and name from the earlier declaration.
-  off_t spec = die->specification();
-  if (spec == 0)
-    spec = die->abstract_origin();
-  if (spec > 0)
-    {
-      Declaration_map::iterator it = this->declarations_.find(spec);
-      if (it != this->declarations_.end())
-        {
-	  parent_offset = it->second.parent_offset_;
-	  name = it->second.name_;
-        }
-    }
-
-  if (name == NULL && die->tag() == elfcpp::DW_TAG_namespace)
-    name = "(anonymous namespace)";
-  else if (name == NULL)
-    return full_name;
-
-  // If this is an enumerator constant, skip the immediate parent,
-  // which is the enumeration tag.
-  if (die->tag() == elfcpp::DW_TAG_enumerator)
-    {
-      Declaration_map::iterator it = this->declarations_.find(parent_offset);
-      if (it != this->declarations_.end())
-	parent_offset = it->second.parent_offset_;
-    }
-
-  if (parent_offset > 0)
-    {
-      full_name.assign(this->get_context(parent_offset));
-      full_name.append("::");
-    }
-  full_name.append(name);
-
-  return full_name;
-}
-
-// Record the address ranges for a compilation unit.
-
-void
-Gdb_index_info_reader::record_cu_ranges(Dwarf_die* die)
-{
-  unsigned int shndx;
-  unsigned int shndx2;
-
-  off_t ranges_offset = die->ref_attribute(elfcpp::DW_AT_ranges, &shndx);
-  if (ranges_offset != -1)
-    {
-      Dwarf_range_list* ranges = this->read_range_list(shndx, ranges_offset);
-      if (ranges != NULL)
-	this->gdb_index_->add_address_range_list(this->object(),
-						 this->cu_index_, ranges);
-      return;
-    }
-
-  off_t low_pc = die->ref_attribute(elfcpp::DW_AT_low_pc, &shndx);
-  off_t high_pc = die->ref_attribute(elfcpp::DW_AT_high_pc, &shndx2);
-  if (low_pc != 0 && high_pc != 0 && low_pc != -1 && high_pc != -1)
-    {
-      if (shndx != shndx2)
-        {
-	  gold_warning(_("%s: DWARF info may be corrupt; low_pc and high_pc "
-			 "are in different sections"),
-		       this->object()->name().c_str());
-	  return;
-	}
-      if (shndx == 0 || this->object()->is_section_included(shndx))
-        {
-	  Dwarf_range_list* ranges = new Dwarf_range_list();
-	  ranges->add(shndx, low_pc, high_pc);
-	  this->gdb_index_->add_address_range_list(this->object(),
-						   this->cu_index_, ranges);
-        }
-    }
-}
-
-// Read the .debug_pubnames and .debug_pubtypes tables for the CU or TU.
-// Returns TRUE if either a pubnames or pubtypes section was found.
-
-bool
-Gdb_index_info_reader::read_pubnames_and_pubtypes(Dwarf_die* die)
-{
-  bool ret = false;
-
-  // If we find a DW_AT_GNU_pubnames attribute, read the pubnames table.
-  unsigned int pubnames_shndx;
-  off_t pubnames_offset = die->ref_attribute(elfcpp::DW_AT_GNU_pubnames,
-					     &pubnames_shndx);
-  if (pubnames_offset != -1 && pubnames_shndx > 0)
-    {
-      if (this->gdb_index_->pubnames_read(pubnames_shndx, pubnames_offset))
-	ret = true;
-      else
-	{
-	  Dwarf_pubnames_table pubnames;
-	  if (!pubnames.read_section(this->object(), this->symtab(),
-				     this->symtab_size(), pubnames_shndx))
-	    return false;
-	  if (!pubnames.read_header(pubnames_offset))
-	    return false;
-	  while (true)
-	    {
-	      const char* name = pubnames.next_name();
-	      if (name == NULL)
-		break;
-	      this->gdb_index_->add_symbol(this->cu_index_, name);
-	    }
-	  ret = true;
-	}
-    }
-
-  // If we find a DW_AT_GNU_pubtypes attribute, read the pubtypes table.
-  unsigned int pubtypes_shndx;
-  off_t pubtypes_offset = die->ref_attribute(elfcpp::DW_AT_GNU_pubtypes,
-					     &pubtypes_shndx);
-  if (pubtypes_offset != -1 && pubnames_shndx > 0)
-    {
-      if (this->gdb_index_->pubtypes_read(pubtypes_shndx, pubtypes_offset))
-	ret = true;
-      else
-	{
-	  Dwarf_pubnames_table pubtypes;
-	  if (!pubtypes.read_section(this->object(), this->symtab(),
-				     this->symtab_size(), pubtypes_shndx))
-	    return false;
-	  if (!pubtypes.read_header(pubtypes_offset))
-	    return false;
-	  while (true)
-	    {
-	      const char* name = pubtypes.next_name();
-	      if (name == NULL)
-		break;
-	      this->gdb_index_->add_symbol(this->cu_index_, name);
-	    }
-	  ret = true;
-	}
-    }
-
-  return ret;
-}
-
-// Clear the declarations map.
-
-void
-Gdb_index_info_reader::clear_declarations()
-{
-  // Free strings in memory we manage.
-  for (Declaration_map::iterator it = this->declarations_.begin();
-       it != this->declarations_.end();
-       ++it)
-    {
-      if (it->second.parent_offset_ == -1)
-	delete[] it->second.name_;
-    }
-
-  this->declarations_.clear();
-}
-
-// Construct the .gdb_index section.
-
-Gdb_index::Gdb_index(Output_section* gdb_index_section)
-  : Output_section_data(4),
-    gdb_index_section_(gdb_index_section),
-    comp_units_(),
-    type_units_(),
-    ranges_(),
-    cu_vector_list_(),
-    cu_vector_offsets_(NULL),
-    stringpool_(),
-    tu_offset_(0),
-    addr_offset_(0),
-    symtab_offset_(0),
-    cu_pool_offset_(0),
-    stringpool_offset_(0),
-    pubnames_shndx_(0),
-    pubnames_offset_(0),
-    pubtypes_shndx_(0),
-    pubtypes_offset_(0)
-{
-  this->gdb_symtab_ = new Gdb_hashtab<Gdb_symbol>();
-}
-
-Gdb_index::~Gdb_index()
-{
-  // Free the memory used by the symbol table.
-  delete this->gdb_symtab_;
-  // Free the memory used by the CU vectors.
-  for (unsigned int i = 0; i < this->cu_vector_list_.size(); ++i)
-    delete this->cu_vector_list_[i];
-}
-
-// Scan a .debug_info or .debug_types input section.
-
-void
-Gdb_index::scan_debug_info(bool is_type_unit,
-			   Relobj* object,
-			   const unsigned char* symbols,
-			   off_t symbols_size,
-			   unsigned int shndx,
-			   unsigned int reloc_shndx,
-			   unsigned int reloc_type)
-{
-  Gdb_index_info_reader dwinfo(is_type_unit, object,
-			       symbols, symbols_size,
-			       shndx, reloc_shndx,
-			       reloc_type, this);
-  dwinfo.parse();
-}
-
-// Add a symbol.
-
-void
-Gdb_index::add_symbol(int cu_index, const char* sym_name)
-{
-  unsigned int hash = mapped_index_string_hash(
-      reinterpret_cast<const unsigned char*>(sym_name));
-  Gdb_symbol* sym = new Gdb_symbol();
-  this->stringpool_.add(sym_name, true, &sym->name_key);
-  sym->hashval = hash;
-  sym->cu_vector_index = 0;
-
-  Gdb_symbol* found = this->gdb_symtab_->add(sym);
-  if (found == sym)
-    {
-      // New symbol -- allocate a new CU index vector.
-      found->cu_vector_index = this->cu_vector_list_.size();
-      this->cu_vector_list_.push_back(new Cu_vector());
-    }
-  else
-    {
-      // Found an existing symbol -- append to the existing
-      // CU index vector.
-      delete sym;
-    }
-
-  // Add the CU index to the vector list for this symbol,
-  // if it's not already on the list.  We only need to
-  // check the last added entry.
-  Cu_vector* cu_vec = this->cu_vector_list_[found->cu_vector_index];
-  if (cu_vec->size() == 0 || cu_vec->back() != cu_index)
-    cu_vec->push_back(cu_index);
-}
-
-// Return TRUE if we have already processed the pubnames set at
-// OFFSET in section SHNDX
-
-bool
-Gdb_index::pubnames_read(unsigned int shndx, off_t offset)
-{
-  bool ret = (this->pubnames_shndx_ == shndx
-	      && this->pubnames_offset_ == offset);
-  this->pubnames_shndx_ = shndx;
-  this->pubnames_offset_ = offset;
-  return ret;
-}
-
-// Return TRUE if we have already processed the pubtypes set at
-// OFFSET in section SHNDX
-
-bool
-Gdb_index::pubtypes_read(unsigned int shndx, off_t offset)
-{
-  bool ret = (this->pubtypes_shndx_ == shndx
-	      && this->pubtypes_offset_ == offset);
-  this->pubtypes_shndx_ = shndx;
-  this->pubtypes_offset_ = offset;
-  return ret;
-}
-
-// Set the size of the .gdb_index section.
-
-void
-Gdb_index::set_final_data_size()
-{
-  // Finalize the string pool.
-  this->stringpool_.set_string_offsets();
-
-  // Compute the total size of the CU vectors.
-  // For each CU vector, include one entry for the count at the
-  // beginning of the vector.
-  unsigned int cu_vector_count = this->cu_vector_list_.size();
-  unsigned int cu_vector_size = 0;
-  this->cu_vector_offsets_ = new off_t[cu_vector_count];
-  for (unsigned int i = 0; i < cu_vector_count; ++i)
-    {
-      Cu_vector* cu_vec = this->cu_vector_list_[i];
-      cu_vector_offsets_[i] = cu_vector_size;
-      cu_vector_size += gdb_index_offset_size * (cu_vec->size() + 1);
-    }
-
-  // Assign relative offsets to each portion of the index,
-  // and find the total size of the section.
-  section_size_type data_size = gdb_index_hdr_size;
-  data_size += this->comp_units_.size() * gdb_index_cu_size;
-  this->tu_offset_ = data_size;
-  data_size += this->type_units_.size() * gdb_index_tu_size;
-  this->addr_offset_ = data_size;
-  for (unsigned int i = 0; i < this->ranges_.size(); ++i)
-    data_size += this->ranges_[i].ranges->size() * gdb_index_addr_size;
-  this->symtab_offset_ = data_size;
-  data_size += this->gdb_symtab_->capacity() * gdb_index_sym_size;
-  this->cu_pool_offset_ = data_size;
-  data_size += cu_vector_size;
-  this->stringpool_offset_ = data_size;
-  data_size += this->stringpool_.get_strtab_size();
-
-  this->set_data_size(data_size);
-}
-
-// Write the data to the file.
-
-void
-Gdb_index::do_write(Output_file* of)
-{
-  const off_t off = this->offset();
-  const off_t oview_size = this->data_size();
-  unsigned char* const oview = of->get_output_view(off, oview_size);
-  unsigned char* pov = oview;
-
-  // Write the file header.
-  // (1) Version number.
-  elfcpp::Swap<32, false>::writeval(pov, gdb_index_version);
-  pov += 4;
-  // (2) Offset of the CU list.
-  elfcpp::Swap<32, false>::writeval(pov, gdb_index_hdr_size);
-  pov += 4;
-  // (3) Offset of the types CU list.
-  elfcpp::Swap<32, false>::writeval(pov, this->tu_offset_);
-  pov += 4;
-  // (4) Offset of the address area.
-  elfcpp::Swap<32, false>::writeval(pov, this->addr_offset_);
-  pov += 4;
-  // (5) Offset of the symbol table.
-  elfcpp::Swap<32, false>::writeval(pov, this->symtab_offset_);
-  pov += 4;
-  // (6) Offset of the constant pool.
-  elfcpp::Swap<32, false>::writeval(pov, this->cu_pool_offset_);
-  pov += 4;
-
-  gold_assert(pov - oview == gdb_index_hdr_size);
-
-  // Sort, then write the CU list.
-  // FIXME: Sort the CU list.
-  unsigned int comp_units_count = this->comp_units_.size();
-  for (unsigned int i = 0; i < comp_units_count; ++i)
-    {
-      const Comp_unit& cu = this->comp_units_[i];
-      elfcpp::Swap<64, false>::writeval(pov, cu.cu_offset);
-      elfcpp::Swap<64, false>::writeval(pov + 8, cu.cu_length);
-      pov += 16;
-    }
-
-  gold_assert(pov - oview == this->tu_offset_);
-
-  // Write the types CU list.
-  for (unsigned int i = 0; i < this->type_units_.size(); ++i)
-    {
-      const Type_unit& tu = this->type_units_[i];
-      elfcpp::Swap<64, false>::writeval(pov, tu.tu_offset);
-      elfcpp::Swap<64, false>::writeval(pov + 8, tu.type_offset);
-      elfcpp::Swap<64, false>::writeval(pov + 16, tu.type_signature);
-      pov += 24;
-    }
-
-  gold_assert(pov - oview == this->addr_offset_);
-
-  // Write the address area.
-  // FIXME: Do we need to sort the address list?
-  for (unsigned int i = 0; i < this->ranges_.size(); ++i)
-    {
-      int cu_index = this->ranges_[i].cu_index;
-      // Translate negative indexes, which refer to a TU, to a
-      // logical index into a concatenated CU/TU list.
-      if (cu_index < 0)
-        cu_index = comp_units_count + (-1 - cu_index);
-      Relobj* object = this->ranges_[i].object;
-      const Dwarf_range_list& ranges = *this->ranges_[i].ranges;
-      for (unsigned int j = 0; j < ranges.size(); ++j)
-        {
-	  const Dwarf_range_list::Range& range = ranges[j];
-	  const Output_section* os = object->output_section(range.shndx);
-	  uint64_t base = (os->address()
-			   + object->output_section_offset(range.shndx));
-	  elfcpp::Swap<64, false>::writeval(pov, base + range.start);
-	  elfcpp::Swap<64, false>::writeval(pov + 8, base + range.end);
-	  elfcpp::Swap<32, false>::writeval(pov + 16, cu_index);
-	  pov += 20;
-	}
-    }
-
-  gold_assert(pov - oview == this->symtab_offset_);
-
-  // Write the symbol table.
-  for (unsigned int i = 0; i < this->gdb_symtab_->capacity(); ++i)
-    {
-      const Gdb_symbol* sym = (*this->gdb_symtab_)[i];
-      section_offset_type name_offset = 0;
-      unsigned int cu_vector_offset = 0;
-      if (sym != NULL)
-	{
-	  name_offset = (this->stringpool_.get_offset_from_key(sym->name_key)
-			 + this->stringpool_offset_ - this->cu_pool_offset_);
-	  cu_vector_offset = this->cu_vector_offsets_[sym->cu_vector_index];
-	}
-      elfcpp::Swap<32, false>::writeval(pov, name_offset);
-      elfcpp::Swap<32, false>::writeval(pov + 4, cu_vector_offset);
-      pov += 8;
-    }
-
-  gold_assert(pov - oview == this->cu_pool_offset_);
-
-  // Write the CU vectors into the constant pool.
-  for (unsigned int i = 0; i < this->cu_vector_list_.size(); ++i)
-    {
-      Cu_vector* cu_vec = this->cu_vector_list_[i];
-      elfcpp::Swap<32, false>::writeval(pov, cu_vec->size());
-      pov += 4;
-      for (unsigned int j = 0; j < cu_vec->size(); ++j)
-	{
-	  int cu_index = (*cu_vec)[j];
-	  if (cu_index < 0)
-	    cu_index = comp_units_count + (-1 - cu_index);
-	  elfcpp::Swap<32, false>::writeval(pov, cu_index);
-	  pov += 4;
-	}
-    }
-
-  gold_assert(pov - oview == this->stringpool_offset_);
-
-  // Write the strings into the constant pool.
-  this->stringpool_.write_to_buffer(pov, oview_size - this->stringpool_offset_);
-
-  of->write_output_view(off, oview_size, oview);
-}
-
-} // End namespace gold.
diff --git a/binutils/binutils-2.21/gold/gdb-index.h b/binutils/binutils-2.21/gold/gdb-index.h
deleted file mode 100644
index f12ec3e..0000000
--- a/binutils/binutils-2.21/gold/gdb-index.h
+++ /dev/null
@@ -1,203 +0,0 @@
-// gdb-index.h -- generate .gdb_index section for fast debug lookup  -*- C++ -*-
-
-// Copyright 2011 Free Software Foundation, Inc.
-// Written by Cary Coutant <ccoutant@google.com>.
-
-// This file is part of gold.
-
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 of the License, or
-// (at your option) any later version.
-
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
-// MA 02110-1301, USA.
-
-#include <sys/types.h>
-#include <vector>
-
-#include "gold.h"
-#include "output.h"
-#include "mapfile.h"
-#include "stringpool.h"
-
-#ifndef GOLD_GDB_INDEX_H
-#define GOLD_GDB_INDEX_H
-
-namespace gold
-{
-
-class Output_section;
-class Output_file;
-class Mapfile;
-template<int size, bool big_endian>
-class Sized_relobj;
-class Dwarf_range_list;
-template <typename T>
-class Gdb_hashtab;
-
-// This class manages the .gdb_index section, which is a fast
-// lookup table for DWARF information used by the gdb debugger.
-// The format of this section is described in gdb/doc/gdb.texinfo.
-
-class Gdb_index : public Output_section_data
-{
- public:
-  Gdb_index(Output_section* gdb_index_section);
-
-  ~Gdb_index();
-
-  // Scan a .debug_info or .debug_types input section.
-  void scan_debug_info(bool is_type_unit,
-		       Relobj* object,
-		       const unsigned char* symbols,
-		       off_t symbols_size,
-		       unsigned int shndx,
-		       unsigned int reloc_shndx,
-		       unsigned int reloc_type);
-
-  // Add a compilation unit.
-  int
-  add_comp_unit(off_t cu_offset, off_t cu_length)
-  {
-    this->comp_units_.push_back(Comp_unit(cu_offset, cu_length));
-    return this->comp_units_.size() - 1;
-  }
-
-  // Add a type unit.
-  int
-  add_type_unit(off_t tu_offset, off_t type_offset, uint64_t signature)
-  {
-    this->type_units_.push_back(Type_unit(tu_offset, type_offset, signature));
-    return this->type_units_.size() - 1;
-  }
-
-  // Add an address range.
-  void
-  add_address_range_list(Relobj* object, unsigned int cu_index,
-			 Dwarf_range_list* ranges)
-  {
-    this->ranges_.push_back(Per_cu_range_list(object, cu_index, ranges));
-  }
-
-  // Add a symbol.
-  void
-  add_symbol(int cu_index, const char* sym_name);
-
-  // Return TRUE if we have already processed the pubnames set at
-  // OFFSET in section SHNDX
-  bool
-  pubnames_read(unsigned int shndx, off_t offset);
-
-  // Return TRUE if we have already processed the pubtypes set at
-  // OFFSET in section SHNDX
-  bool
-  pubtypes_read(unsigned int shndx, off_t offset);
-
- protected:
-  // Set the final data size.
-  void
-  set_final_data_size();
-
-  // Write the data to the file.
-  void
-  do_write(Output_file*);
-
-  // Write to a map file.
-  void
-  do_print_to_mapfile(Mapfile* mapfile) const
-  { mapfile->print_output_data(this, _("** gdb_index")); }
-
- private:
-  // An entry in the compilation unit list.
-  struct Comp_unit
-  {
-    Comp_unit(off_t off, off_t len)
-      : cu_offset(off), cu_length(len)
-    { }
-    uint64_t cu_offset;
-    uint64_t cu_length;
-  };
-
-  // An entry in the type unit list.
-  struct Type_unit
-  {
-    Type_unit(off_t off, off_t toff, uint64_t sig)
-      : tu_offset(off), type_offset(toff), type_signature(sig)
-    { }
-    uint64_t tu_offset;
-    uint64_t type_offset;
-    uint64_t type_signature;
-  };
-
-  // An entry in the address range list.
-  struct Per_cu_range_list
-  {
-    Per_cu_range_list(Relobj* obj, uint32_t index, Dwarf_range_list* r)
-      : object(obj), cu_index(index), ranges(r)
-    { }
-    Relobj* object;
-    uint32_t cu_index;
-    Dwarf_range_list* ranges;
-  };
-
-  // A symbol table entry.
-  struct Gdb_symbol
-  {
-    Stringpool::Key name_key;
-    unsigned int hashval;
-    unsigned int cu_vector_index;
-
-    // Return the hash value.
-    unsigned int
-    hash()
-    { return this->hashval; }
-
-    // Return true if this symbol is the same as SYMBOL.
-    bool
-    equal(Gdb_symbol* symbol)
-    { return this->name_key == symbol->name_key; }
-  };
-
-  typedef std::vector<int> Cu_vector;
-
-  // The .gdb_index section.
-  Output_section* gdb_index_section_;
-  // The list of DWARF compilation units.
-  std::vector<Comp_unit> comp_units_;
-  // The list of DWARF type units.
-  std::vector<Type_unit> type_units_;
-  // The list of address ranges.
-  std::vector<Per_cu_range_list> ranges_;
-  // The symbol table.
-  Gdb_hashtab<Gdb_symbol>* gdb_symtab_;
-  // The CU vector portion of the constant pool.
-  std::vector<Cu_vector*> cu_vector_list_;
-  // An array to map from a CU vector index to an offset to the constant pool.
-  off_t* cu_vector_offsets_;
-  // The string portion of the constant pool.
-  Stringpool stringpool_;
-  // Offsets of the various pieces of the .gdb_index section.
-  off_t tu_offset_;
-  off_t addr_offset_;
-  off_t symtab_offset_;
-  off_t cu_pool_offset_;
-  off_t stringpool_offset_;
-  // Section index and offset of last read pubnames section.
-  unsigned int pubnames_shndx_;
-  off_t pubnames_offset_;
-  // Section index and offset of last read pubtypes section.
-  unsigned int pubtypes_shndx_;
-  off_t pubtypes_offset_;
-};
-
-} // End namespace gold.
-
-#endif // !defined(GOLD_GDB_INDEX_H)
diff --git a/binutils/binutils-2.21/gold/gold.cc b/binutils/binutils-2.21/gold/gold.cc
index e259aad..bf650b7 100644
--- a/binutils/binutils-2.21/gold/gold.cc
+++ b/binutils/binutils-2.21/gold/gold.cc
@@ -188,28 +188,45 @@
   // For incremental links, the base output file.
   Incremental_binary* ibase = NULL;
 
-  if (parameters->incremental_update())
+  if (parameters->incremental())
     {
-      Output_file* of = new Output_file(options.output_file_name());
-      if (of->open_base_file(options.incremental_base(), true))
+      if (options.relocatable())
+	gold_error(_("incremental linking is incompatible with -r"));
+      if (options.emit_relocs())
+	gold_error(_("incremental linking is incompatible with --emit-relocs"));
+      if (options.gc_sections())
+	gold_error(_("incremental linking is incompatible with --gc-sections"));
+      if (options.icf_enabled())
+	gold_error(_("incremental linking is incompatible with --icf"));
+      if (options.has_plugins())
+	gold_error(_("incremental linking is incompatible with --plugin"));
+      if (strcmp(options.compress_debug_sections(), "none") != 0)
+	gold_error(_("incremental linking is incompatible with "
+		     "--compress-debug-sections"));
+
+      if (parameters->incremental_update())
 	{
-	  ibase = open_incremental_binary(of);
-	  if (ibase != NULL
-	      && ibase->check_inputs(cmdline, layout->incremental_inputs()))
-	    ibase->init_layout(layout);
-	  else
+	  Output_file* of = new Output_file(options.output_file_name());
+	  if (of->open_base_file(options.incremental_base(), true))
 	    {
-	      delete ibase;
-	      ibase = NULL;
-	      of->close();
+	      ibase = open_incremental_binary(of);
+	      if (ibase != NULL
+		  && ibase->check_inputs(cmdline, layout->incremental_inputs()))
+		ibase->init_layout(layout);
+	      else
+		{
+		  delete ibase;
+		  ibase = NULL;
+		  of->close();
+		}
 	    }
-	}
-      if (ibase == NULL)
-	{
-	  if (set_parameters_incremental_full())
-	    gold_info(_("linking with --incremental-full"));
-	  else
-	    gold_fallback(_("restart link with --incremental-full"));
+	  if (ibase == NULL)
+	    {
+	      if (set_parameters_incremental_full())
+		gold_info(_("linking with --incremental-full"));
+	      else
+		gold_fallback(_("restart link with --incremental-full"));
+	    }
 	}
     }
 
@@ -534,20 +551,6 @@
         }
     }
 
-  /* If plugins have specified a section order, re-arrange input sections
-     according to a specified section order.  If --section-ordering-file is
-     also specified, do not do anything here.  */
-  if (parameters->options().has_plugins()
-      && layout->is_section_ordering_specified()
-      && !parameters->options().section_ordering_file ())
-    {
-      for (Layout::Section_list::const_iterator p
-	     = layout->section_list().begin();
-           p != layout->section_list().end();
-           ++p)
-        (*p)->update_section_layout(layout->get_section_order_map());
-    }
-
   // Layout deferred objects due to plugins.
   if (parameters->options().has_plugins())
     {
diff --git a/binutils/binutils-2.21/gold/i386.cc b/binutils/binutils-2.21/gold/i386.cc
index 68ec5aa..8615fbb 100644
--- a/binutils/binutils-2.21/gold/i386.cc
+++ b/binutils/binutils-2.21/gold/i386.cc
@@ -52,16 +52,15 @@
  public:
   typedef Output_data_reloc<elfcpp::SHT_REL, true, 32, false> Reloc_section;
 
-  Output_data_plt_i386(Layout*, Output_data_space*, Output_data_space*);
+  Output_data_plt_i386(Symbol_table*, Layout*, Output_data_space*);
 
   // Add an entry to the PLT.
   void
-  add_entry(Symbol_table*, Layout*, Symbol* gsym);
+  add_entry(Symbol* gsym);
 
   // Add an entry to the PLT for a local STT_GNU_IFUNC symbol.
   unsigned int
-  add_local_ifunc_entry(Symbol_table*, Layout*,
-			Sized_relobj_file<32, false>* relobj,
+  add_local_ifunc_entry(Sized_relobj_file<32, false>* relobj,
 			unsigned int local_sym_index);
 
   // Return the .rel.plt section data.
@@ -73,19 +72,10 @@
   Reloc_section*
   rel_tls_desc(Layout*);
 
-  // Return where the IRELATIVE relocations should go.
-  Reloc_section*
-  rel_irelative(Symbol_table*, Layout*);
-
-  // Return whether we created a section for IRELATIVE relocations.
-  bool
-  has_irelative_section() const
-  { return this->irelative_rel_ != NULL; }
-
   // Return the number of PLT entries.
   unsigned int
   entry_count() const
-  { return this->count_ + this->irelative_count_; }
+  { return this->count_; }
 
   // Return the offset of the first non-reserved PLT entry.
   static unsigned int
@@ -97,14 +87,6 @@
   get_plt_entry_size()
   { return plt_entry_size; }
 
-  // Return the PLT address to use for a global symbol.
-  uint64_t
-  address_for_global(const Symbol*);
-
-  // Return the PLT address to use for a local symbol.
-  uint64_t
-  address_for_local(const Relobj*, unsigned int symndx);
-
  protected:
   void
   do_adjust_output_section(Output_section* os);
@@ -133,10 +115,7 @@
   // Set the final size.
   void
   set_final_data_size()
-  {
-    this->set_data_size((this->count_ + this->irelative_count_ + 1)
-			* plt_entry_size);
-  }
+  { this->set_data_size((this->count_ + 1) * plt_entry_size); }
 
   // Write out the PLT data.
   void
@@ -164,18 +143,10 @@
   // The TLS_DESC relocations, if necessary.  These must follow the
   // regular PLT relocs.
   Reloc_section* tls_desc_rel_;
-  // The IRELATIVE relocations, if necessary.  These must follow the
-  // regular relocatoins and the TLS_DESC relocations.
-  Reloc_section* irelative_rel_;
   // The .got.plt section.
   Output_data_space* got_plt_;
-  // The part of the .got.plt section used for IRELATIVE relocs.
-  Output_data_space* got_irelative_;
   // The number of PLT entries.
   unsigned int count_;
-  // Number of PLT entries with R_386_IRELATIVE relocs.  These follow
-  // the regular PLT entries.
-  unsigned int irelative_count_;
   // Global STT_GNU_IFUNC symbols.
   std::vector<Global_ifunc> global_ifuncs_;
   // Local STT_GNU_IFUNC symbols.
@@ -194,9 +165,9 @@
 
   Target_i386()
     : Target_freebsd<32, false>(&i386_info),
-      got_(NULL), plt_(NULL), got_plt_(NULL), got_irelative_(NULL),
-      got_tlsdesc_(NULL), global_offset_table_(NULL), rel_dyn_(NULL),
-      rel_irelative_(NULL), copy_relocs_(elfcpp::R_386_COPY), dynbss_(NULL),
+      got_(NULL), plt_(NULL), got_plt_(NULL), got_tlsdesc_(NULL),
+      global_offset_table_(NULL), rel_dyn_(NULL),
+      copy_relocs_(elfcpp::R_386_COPY), dynbss_(NULL),
       got_mod_index_offset_(-1U), tls_base_symbol_defined_(false)
   { }
 
@@ -311,14 +282,14 @@
     return Target::do_is_local_label_name(name);
   }
 
-  // Return the PLT address to use for a global symbol.
-  uint64_t
-  do_plt_address_for_global(const Symbol* gsym) const
-  { return this->plt_section()->address_for_global(gsym); }
+  // Return the PLT section.
+  Output_data*
+  do_plt_section_for_global(const Symbol*) const
+  { return this->plt_section(); }
 
-  uint64_t
-  do_plt_address_for_local(const Relobj* relobj, unsigned int symndx) const
-  { return this->plt_section()->address_for_local(relobj, symndx); }
+  Output_data*
+  do_plt_section_for_local(const Relobj*, unsigned int) const
+  { return this->plt_section(); }
 
   // Return whether SYM is call to a non-split function.
   bool
@@ -610,10 +581,6 @@
   Reloc_section*
   rel_tls_desc_section(Layout*) const;
 
-  // Get the section to use for IRELATIVE relocations.
-  Reloc_section*
-  rel_irelative_section(Layout*);
-
   // Add a potential copy relocation.
   void
   copy_reloc(Symbol_table* symtab, Layout* layout,
@@ -650,16 +617,12 @@
   Output_data_plt_i386* plt_;
   // The GOT PLT section.
   Output_data_space* got_plt_;
-  // The GOT section for IRELATIVE relocations.
-  Output_data_space* got_irelative_;
   // The GOT section for TLSDESC relocations.
   Output_data_got<32, false>* got_tlsdesc_;
   // The _GLOBAL_OFFSET_TABLE_ symbol.
   Symbol* global_offset_table_;
   // The dynamic reloc section.
   Reloc_section* rel_dyn_;
-  // The section to use for IRELATIVE relocs.
-  Reloc_section* rel_irelative_;
   // Relocs saved to avoid a COPY reloc.
   Copy_relocs<elfcpp::SHT_REL, 32, false> copy_relocs_;
   // Space for variables copied with a COPY reloc.
@@ -731,15 +694,6 @@
 				      elfcpp::STV_HIDDEN, 0,
 				      false, false);
 
-      // If there are any IRELATIVE relocations, they get GOT entries
-      // in .got.plt after the jump slot relocations.
-      this->got_irelative_ = new Output_data_space(4, "** GOT IRELATIVE PLT");
-      layout->add_output_section_data(".got.plt", elfcpp::SHT_PROGBITS,
-				      (elfcpp::SHF_ALLOC
-				       | elfcpp::SHF_WRITE),
-				      this->got_irelative_,
-				      ORDER_NON_RELRO_FIRST, false);
-
       // If there are any TLSDESC relocations, they get GOT entries in
       // .got.plt after the jump slot entries.
       this->got_tlsdesc_ = new Output_data_got<32, false>();
@@ -769,44 +723,38 @@
   return this->rel_dyn_;
 }
 
-// Get the section to use for IRELATIVE relocs, creating it if
-// necessary.  These go in .rel.dyn, but only after all other dynamic
-// relocations.  They need to follow the other dynamic relocations so
-// that they can refer to global variables initialized by those
-// relocs.
-
-Target_i386::Reloc_section*
-Target_i386::rel_irelative_section(Layout* layout)
-{
-  if (this->rel_irelative_ == NULL)
-    {
-      // Make sure we have already create the dynamic reloc section.
-      this->rel_dyn_section(layout);
-      this->rel_irelative_ = new Reloc_section(false);
-      layout->add_output_section_data(".rel.dyn", elfcpp::SHT_REL,
-				      elfcpp::SHF_ALLOC, this->rel_irelative_,
-				      ORDER_DYNAMIC_RELOCS, false);
-      gold_assert(this->rel_dyn_->output_section()
-		  == this->rel_irelative_->output_section());
-    }
-  return this->rel_irelative_;
-}
-
 // Create the PLT section.  The ordinary .got section is an argument,
 // since we need to refer to the start.  We also create our own .got
 // section just for PLT entries.
 
-Output_data_plt_i386::Output_data_plt_i386(Layout* layout,
-					   Output_data_space* got_plt,
-					   Output_data_space* got_irelative)
-  : Output_section_data(16), tls_desc_rel_(NULL), irelative_rel_(NULL),
-    got_plt_(got_plt), got_irelative_(got_irelative), count_(0),
-    irelative_count_(0), global_ifuncs_(), local_ifuncs_()
+Output_data_plt_i386::Output_data_plt_i386(Symbol_table* symtab,
+					   Layout* layout,
+					   Output_data_space* got_plt)
+  : Output_section_data(4), tls_desc_rel_(NULL), got_plt_(got_plt), count_(0),
+    global_ifuncs_(), local_ifuncs_()
 {
   this->rel_ = new Reloc_section(false);
   layout->add_output_section_data(".rel.plt", elfcpp::SHT_REL,
 				  elfcpp::SHF_ALLOC, this->rel_,
 				  ORDER_DYNAMIC_PLT_RELOCS, false);
+
+  if (parameters->doing_static_link())
+    {
+      // A statically linked executable will only have a .rel.plt
+      // section to hold R_386_IRELATIVE relocs for STT_GNU_IFUNC
+      // symbols.  The library will use these symbols to locate the
+      // IRELATIVE relocs at program startup time.
+      symtab->define_in_output_data("__rel_iplt_start", NULL,
+				    Symbol_table::PREDEFINED,
+				    this->rel_, 0, 0, elfcpp::STT_NOTYPE,
+				    elfcpp::STB_GLOBAL, elfcpp::STV_HIDDEN,
+				    0, false, true);
+      symtab->define_in_output_data("__rel_iplt_end", NULL,
+				    Symbol_table::PREDEFINED,
+				    this->rel_, 0, 0, elfcpp::STT_NOTYPE,
+				    elfcpp::STB_GLOBAL, elfcpp::STV_HIDDEN,
+				    0, true, true);
+    }
 }
 
 void
@@ -820,23 +768,29 @@
 // Add an entry to the PLT.
 
 void
-Output_data_plt_i386::add_entry(Symbol_table* symtab, Layout* layout,
-				Symbol* gsym)
+Output_data_plt_i386::add_entry(Symbol* gsym)
 {
   gold_assert(!gsym->has_plt_offset());
 
+  // Note that when setting the PLT offset we skip the initial
+  // reserved PLT entry.
+  gsym->set_plt_offset((this->count_ + 1) * plt_entry_size);
+
+  ++this->count_;
+
+  section_offset_type got_offset = this->got_plt_->current_data_size();
+
+  // Every PLT entry needs a GOT entry which points back to the PLT
+  // entry (this will be changed by the dynamic linker, normally
+  // lazily when the function is called).
+  this->got_plt_->set_current_data_size(got_offset + 4);
+
   // Every PLT entry needs a reloc.
   if (gsym->type() == elfcpp::STT_GNU_IFUNC
       && gsym->can_use_relative_reloc(false))
     {
-      gsym->set_plt_offset(this->irelative_count_ * plt_entry_size);
-      ++this->irelative_count_;
-      section_offset_type got_offset =
-	this->got_irelative_->current_data_size();
-      this->got_irelative_->set_current_data_size(got_offset + 4);
-      Reloc_section* rel = this->rel_irelative(symtab, layout);
-      rel->add_symbolless_global_addend(gsym, elfcpp::R_386_IRELATIVE,
-					this->got_irelative_, got_offset);
+      this->rel_->add_symbolless_global_addend(gsym, elfcpp::R_386_IRELATIVE,
+					       this->got_plt_, got_offset);
       struct Global_ifunc gi;
       gi.sym = gsym;
       gi.got_offset = got_offset;
@@ -844,19 +798,6 @@
     }
   else
     {
-      // When setting the PLT offset we skip the initial reserved PLT
-      // entry.
-      gsym->set_plt_offset((this->count_ + 1) * plt_entry_size);
-
-      ++this->count_;
-
-      section_offset_type got_offset = this->got_plt_->current_data_size();
-
-      // Every PLT entry needs a GOT entry which points back to the
-      // PLT entry (this will be changed by the dynamic linker,
-      // normally lazily when the function is called).
-      this->got_plt_->set_current_data_size(got_offset + 4);
-
       gsym->set_needs_dynsym_entry();
       this->rel_->add_global(gsym, elfcpp::R_386_JUMP_SLOT, this->got_plt_,
 			     got_offset);
@@ -872,25 +813,22 @@
 
 unsigned int
 Output_data_plt_i386::add_local_ifunc_entry(
-    Symbol_table* symtab,
-    Layout* layout,
     Sized_relobj_file<32, false>* relobj,
     unsigned int local_sym_index)
 {
-  unsigned int plt_offset = this->irelative_count_ * plt_entry_size;
-  ++this->irelative_count_;
+  unsigned int plt_offset = (this->count_ + 1) * plt_entry_size;
+  ++this->count_;
 
-  section_offset_type got_offset = this->got_irelative_->current_data_size();
+  section_offset_type got_offset = this->got_plt_->current_data_size();
 
   // Every PLT entry needs a GOT entry which points back to the PLT
   // entry.
-  this->got_irelative_->set_current_data_size(got_offset + 4);
+  this->got_plt_->set_current_data_size(got_offset + 4);
 
   // Every PLT entry needs a reloc.
-  Reloc_section* rel = this->rel_irelative(symtab, layout);
-  rel->add_symbolless_local_addend(relobj, local_sym_index,
-				   elfcpp::R_386_IRELATIVE,
-				   this->got_irelative_, got_offset);
+  this->rel_->add_symbolless_local_addend(relobj, local_sym_index,
+					  elfcpp::R_386_IRELATIVE,
+					  this->got_plt_, got_offset);
 
   struct Local_ifunc li;
   li.object = relobj;
@@ -913,72 +851,12 @@
       layout->add_output_section_data(".rel.plt", elfcpp::SHT_REL,
 				      elfcpp::SHF_ALLOC, this->tls_desc_rel_,
 				      ORDER_DYNAMIC_PLT_RELOCS, false);
-      gold_assert(this->tls_desc_rel_->output_section()
-		  == this->rel_->output_section());
+      gold_assert(this->tls_desc_rel_->output_section() ==
+		  this->rel_->output_section());
     }
   return this->tls_desc_rel_;
 }
 
-// Return where the IRELATIVE relocations should go in the PLT.  These
-// follow the JUMP_SLOT and TLS_DESC relocations.
-
-Output_data_plt_i386::Reloc_section*
-Output_data_plt_i386::rel_irelative(Symbol_table* symtab, Layout* layout)
-{
-  if (this->irelative_rel_ == NULL)
-    {
-      // Make sure we have a place for the TLS_DESC relocations, in
-      // case we see any later on.
-      this->rel_tls_desc(layout);
-      this->irelative_rel_ = new Reloc_section(false);
-      layout->add_output_section_data(".rel.plt", elfcpp::SHT_REL,
-				      elfcpp::SHF_ALLOC, this->irelative_rel_,
-				      ORDER_DYNAMIC_PLT_RELOCS, false);
-      gold_assert(this->irelative_rel_->output_section()
-		  == this->rel_->output_section());
-
-      if (parameters->doing_static_link())
-	{
-	  // A statically linked executable will only have a .rel.plt
-	  // section to hold R_386_IRELATIVE relocs for STT_GNU_IFUNC
-	  // symbols.  The library will use these symbols to locate
-	  // the IRELATIVE relocs at program startup time.
-	  symtab->define_in_output_data("__rel_iplt_start", NULL,
-					Symbol_table::PREDEFINED,
-					this->irelative_rel_, 0, 0,
-					elfcpp::STT_NOTYPE, elfcpp::STB_GLOBAL,
-					elfcpp::STV_HIDDEN, 0, false, true);
-	  symtab->define_in_output_data("__rel_iplt_end", NULL,
-					Symbol_table::PREDEFINED,
-					this->irelative_rel_, 0, 0,
-					elfcpp::STT_NOTYPE, elfcpp::STB_GLOBAL,
-					elfcpp::STV_HIDDEN, 0, true, true);
-	}
-    }
-  return this->irelative_rel_;
-}
-
-// Return the PLT address to use for a global symbol.
-
-uint64_t
-Output_data_plt_i386::address_for_global(const Symbol* gsym)
-{
-  uint64_t offset = 0;
-  if (gsym->type() == elfcpp::STT_GNU_IFUNC
-      && gsym->can_use_relative_reloc(false))
-    offset = (this->count_ + 1) * plt_entry_size;
-  return this->address() + offset;
-}
-
-// Return the PLT address to use for a local symbol.  These are always
-// IRELATIVE relocs.
-
-uint64_t
-Output_data_plt_i386::address_for_local(const Relobj*, unsigned int)
-{
-  return this->address() + (this->count_ + 1) * plt_entry_size;
-}
-
 // The first entry in the PLT for an executable.
 
 unsigned char Output_data_plt_i386::exec_first_plt_entry[plt_entry_size] =
@@ -1036,12 +914,8 @@
   unsigned char* const oview = of->get_output_view(offset, oview_size);
 
   const off_t got_file_offset = this->got_plt_->offset();
-  gold_assert(parameters->incremental_update()
-	      || (got_file_offset + this->got_plt_->data_size()
-		  == this->got_irelative_->offset()));
   const section_size_type got_size =
-    convert_to_section_size_type(this->got_plt_->data_size()
-				 + this->got_irelative_->data_size());
+    convert_to_section_size_type(this->got_plt_->data_size());
   unsigned char* const got_view = of->get_output_view(got_file_offset,
 						      got_size);
 
@@ -1070,7 +944,7 @@
   unsigned int plt_offset = plt_entry_size;
   unsigned int plt_rel_offset = 0;
   unsigned int got_offset = 12;
-  const unsigned int count = this->count_ + this->irelative_count_;
+  const unsigned int count = this->count_;
   for (unsigned int i = 0;
        i < count;
        ++i,
@@ -1107,7 +981,6 @@
   // the GOT to point to the actual symbol value, rather than point to
   // the PLT entry.  That will let the dynamic linker call the right
   // function when resolving IRELATIVE relocations.
-  unsigned char* got_irelative_view = got_view + this->got_plt_->data_size();
   for (std::vector<Global_ifunc>::const_iterator p =
 	 this->global_ifuncs_.begin();
        p != this->global_ifuncs_.end();
@@ -1115,7 +988,7 @@
     {
       const Sized_symbol<32>* ssym =
 	static_cast<const Sized_symbol<32>*>(p->sym);
-      elfcpp::Swap<32, false>::writeval(got_irelative_view + p->got_offset,
+      elfcpp::Swap<32, false>::writeval(got_view + p->got_offset,
 					ssym->value());
     }
 
@@ -1126,7 +999,7 @@
     {
       const Symbol_value<32>* psymval =
 	p->object->local_symbol(p->local_sym_index);
-      elfcpp::Swap<32, false>::writeval(got_irelative_view + p->got_offset,
+      elfcpp::Swap<32, false>::writeval(got_view + p->got_offset,
 					psymval->value(p->object, 0));
     }
 
@@ -1147,8 +1020,7 @@
       // Create the GOT sections first.
       this->got_section(symtab, layout);
 
-      this->plt_ = new Output_data_plt_i386(layout, this->got_plt_,
-					    this->got_irelative_);
+      this->plt_ = new Output_data_plt_i386(symtab, layout, this->got_plt_);
       layout->add_output_section_data(".plt", elfcpp::SHT_PROGBITS,
 				      (elfcpp::SHF_ALLOC
 				       | elfcpp::SHF_EXECINSTR),
@@ -1169,7 +1041,7 @@
     return;
   if (this->plt_ == NULL)
     this->make_plt_section(symtab, layout);
-  this->plt_->add_entry(symtab, layout, gsym);
+  this->plt_->add_entry(gsym);
 }
 
 // Make a PLT entry for a local STT_GNU_IFUNC symbol.
@@ -1183,8 +1055,7 @@
     return;
   if (this->plt_ == NULL)
     this->make_plt_section(symtab, layout);
-  unsigned int plt_offset = this->plt_->add_local_ifunc_entry(symtab, layout,
-							      relobj,
+  unsigned int plt_offset = this->plt_->add_local_ifunc_entry(relobj,
 							      local_sym_index);
   relobj->set_local_plt_offset(local_sym_index, plt_offset);
 }
@@ -1846,7 +1717,7 @@
 		// STT_GNU_IFUNC symbol.  This makes a function
 		// address in a PIE executable match the address in a
 		// shared library that it links against.
-		Reloc_section* rel_dyn = target->rel_irelative_section(layout);
+		Reloc_section* rel_dyn = target->rel_dyn_section(layout);
 		rel_dyn->add_symbolless_global_addend(gsym,
 						      elfcpp::R_386_IRELATIVE,
 						      output_section,
@@ -2339,7 +2210,7 @@
   else if (gsym != NULL
 	   && gsym->use_plt_offset(Scan::get_reference_flags(r_type)))
     {
-      symval.set_output_value(target->plt_address_for_global(gsym)
+      symval.set_output_value(target->plt_section()->address()
 			      + gsym->plt_offset());
       psymval = &symval;
     }
@@ -2348,7 +2219,7 @@
       unsigned int r_sym = elfcpp::elf_r_sym<32>(rel.get_r_info());
       if (object->local_has_plt_offset(r_sym))
 	{
-	  symval.set_output_value(target->plt_address_for_local(object, r_sym)
+	  symval.set_output_value(target->plt_section()->address()
 				  + object->local_plt_offset(r_sym));
 	  psymval = &symval;
 	}
@@ -2561,6 +2432,7 @@
             }
           if (optimized_type == tls::TLSOPT_TO_IE)
 	    {
+              gold_assert(tls_segment != NULL);
 	      this->tls_gd_to_ie(relinfo, relnum, tls_segment, rel, r_type,
                                  got_offset, view, view_size);
               break;
@@ -3271,7 +3143,7 @@
 Target_i386::do_dynsym_value(const Symbol* gsym) const
 {
   gold_assert(gsym->is_from_dynobj() && gsym->has_plt_offset());
-  return this->plt_address_for_global(gsym) + gsym->plt_offset();
+  return this->plt_section()->address() + gsym->plt_offset();
 }
 
 // Return a string used to fill a code section with nops to take up
@@ -3291,51 +3163,42 @@
     }
 
   // Nop sequences of various lengths.
-  const char nop1[1] = { '\x90' };                   // nop
-  const char nop2[2] = { '\x66', '\x90' };           // xchg %ax %ax
-  const char nop3[3] = { '\x8d', '\x76', '\x00' };   // leal 0(%esi),%esi
-  const char nop4[4] = { '\x8d', '\x74', '\x26',     // leal 0(%esi,1),%esi
-			 '\x00'};
-  const char nop5[5] = { '\x90', '\x8d', '\x74',     // nop
-  			 '\x26', '\x00' };           // leal 0(%esi,1),%esi
-  const char nop6[6] = { '\x8d', '\xb6', '\x00',     // leal 0L(%esi),%esi
-  			 '\x00', '\x00', '\x00' };
-  const char nop7[7] = { '\x8d', '\xb4', '\x26',     // leal 0L(%esi,1),%esi
-  			 '\x00', '\x00', '\x00',
-			 '\x00' };
-  const char nop8[8] = { '\x90', '\x8d', '\xb4',     // nop
-  			 '\x26', '\x00', '\x00',     // leal 0L(%esi,1),%esi
-			 '\x00', '\x00' };
-  const char nop9[9] = { '\x89', '\xf6', '\x8d',     // movl %esi,%esi
-  			 '\xbc', '\x27', '\x00',     // leal 0L(%edi,1),%edi
-			 '\x00', '\x00', '\x00' };
-  const char nop10[10] = { '\x8d', '\x76', '\x00',   // leal 0(%esi),%esi
-  			   '\x8d', '\xbc', '\x27',   // leal 0L(%edi,1),%edi
-			   '\x00', '\x00', '\x00',
-			   '\x00' };
-  const char nop11[11] = { '\x8d', '\x74', '\x26',   // leal 0(%esi,1),%esi
-  			   '\x00', '\x8d', '\xbc',   // leal 0L(%edi,1),%edi
-			   '\x27', '\x00', '\x00',
-			   '\x00', '\x00' };
-  const char nop12[12] = { '\x8d', '\xb6', '\x00',   // leal 0L(%esi),%esi
-  			   '\x00', '\x00', '\x00',   // leal 0L(%edi),%edi
-			   '\x8d', '\xbf', '\x00',
-			   '\x00', '\x00', '\x00' };
-  const char nop13[13] = { '\x8d', '\xb6', '\x00',   // leal 0L(%esi),%esi
-  			   '\x00', '\x00', '\x00',   // leal 0L(%edi,1),%edi
-			   '\x8d', '\xbc', '\x27',
-			   '\x00', '\x00', '\x00',
-                           '\x00' };
-  const char nop14[14] = { '\x8d', '\xb4', '\x26',   // leal 0L(%esi,1),%esi
-  			   '\x00', '\x00', '\x00',   // leal 0L(%edi,1),%edi
-			   '\x00', '\x8d', '\xbc',
-			   '\x27', '\x00', '\x00',
-                           '\x00', '\x00' };
-  const char nop15[15] = { '\xeb', '\x0d', '\x90',   // jmp .+15
-  			   '\x90', '\x90', '\x90',   // nop,nop,nop,...
-			   '\x90', '\x90', '\x90',
-			   '\x90', '\x90', '\x90',
-                           '\x90', '\x90', '\x90' };
+  const char nop1[1] = { 0x90 };                   // nop
+  const char nop2[2] = { 0x66, 0x90 };             // xchg %ax %ax
+  const char nop3[3] = { 0x8d, 0x76, 0x00 };       // leal 0(%esi),%esi
+  const char nop4[4] = { 0x8d, 0x74, 0x26, 0x00};  // leal 0(%esi,1),%esi
+  const char nop5[5] = { 0x90, 0x8d, 0x74, 0x26,   // nop
+                         0x00 };                   // leal 0(%esi,1),%esi
+  const char nop6[6] = { 0x8d, 0xb6, 0x00, 0x00,   // leal 0L(%esi),%esi
+                         0x00, 0x00 };
+  const char nop7[7] = { 0x8d, 0xb4, 0x26, 0x00,   // leal 0L(%esi,1),%esi
+                         0x00, 0x00, 0x00 };
+  const char nop8[8] = { 0x90, 0x8d, 0xb4, 0x26,   // nop
+                         0x00, 0x00, 0x00, 0x00 }; // leal 0L(%esi,1),%esi
+  const char nop9[9] = { 0x89, 0xf6, 0x8d, 0xbc,   // movl %esi,%esi
+                         0x27, 0x00, 0x00, 0x00,   // leal 0L(%edi,1),%edi
+                         0x00 };
+  const char nop10[10] = { 0x8d, 0x76, 0x00, 0x8d, // leal 0(%esi),%esi
+                           0xbc, 0x27, 0x00, 0x00, // leal 0L(%edi,1),%edi
+                           0x00, 0x00 };
+  const char nop11[11] = { 0x8d, 0x74, 0x26, 0x00, // leal 0(%esi,1),%esi
+                           0x8d, 0xbc, 0x27, 0x00, // leal 0L(%edi,1),%edi
+                           0x00, 0x00, 0x00 };
+  const char nop12[12] = { 0x8d, 0xb6, 0x00, 0x00, // leal 0L(%esi),%esi
+                           0x00, 0x00, 0x8d, 0xbf, // leal 0L(%edi),%edi
+                           0x00, 0x00, 0x00, 0x00 };
+  const char nop13[13] = { 0x8d, 0xb6, 0x00, 0x00, // leal 0L(%esi),%esi
+                           0x00, 0x00, 0x8d, 0xbc, // leal 0L(%edi,1),%edi
+                           0x27, 0x00, 0x00, 0x00,
+                           0x00 };
+  const char nop14[14] = { 0x8d, 0xb4, 0x26, 0x00, // leal 0L(%esi,1),%esi
+                           0x00, 0x00, 0x00, 0x8d, // leal 0L(%edi,1),%edi
+                           0xbc, 0x27, 0x00, 0x00,
+                           0x00, 0x00 };
+  const char nop15[15] = { 0xeb, 0x0d, 0x90, 0x90, // jmp .+15
+                           0x90, 0x90, 0x90, 0x90, // nop,nop,nop,...
+                           0x90, 0x90, 0x90, 0x90,
+                           0x90, 0x90, 0x90 };
 
   const char* nops[16] = {
     NULL,
diff --git a/binutils/binutils-2.21/gold/incremental.cc b/binutils/binutils-2.21/gold/incremental.cc
index 75e44c5..cb97044 100644
--- a/binutils/binutils-2.21/gold/incremental.cc
+++ b/binutils/binutils-2.21/gold/incremental.cc
@@ -1,6 +1,6 @@
 // inremental.cc -- incremental linking support for gold
 
-// Copyright 2009, 2010, 2011 Free Software Foundation, Inc.
+// Copyright 2009, 2010 Free Software Foundation, Inc.
 // Written by Mikolaj Zalewski <mikolajz@google.com>.
 
 // This file is part of gold.
@@ -161,22 +161,6 @@
   va_end(args);
 }
 
-// Return TRUE if a section of type SH_TYPE can be updated in place
-// during an incremental update.  We can update sections of type PROGBITS,
-// NOBITS, INIT_ARRAY, FINI_ARRAY, PREINIT_ARRAY, and NOTE.  All others
-// will be regenerated.
-
-bool
-can_incremental_update(unsigned int sh_type)
-{
-  return (sh_type == elfcpp::SHT_PROGBITS
-	  || sh_type == elfcpp::SHT_NOBITS
-	  || sh_type == elfcpp::SHT_INIT_ARRAY
-	  || sh_type == elfcpp::SHT_FINI_ARRAY
-	  || sh_type == elfcpp::SHT_PREINIT_ARRAY
-	  || sh_type == elfcpp::SHT_NOTE);
-}
-
 // Find the .gnu_incremental_inputs section and related sections.
 
 template<int size, bool big_endian>
@@ -685,12 +669,12 @@
       gold_assert(plt_desc >= first_global && plt_desc < symtab_count);
       Symbol* sym = this->global_symbol(plt_desc - first_global);
       // Add the PLT entry only if the symbol is still referenced.
-      if (sym != NULL && sym->in_reg())
+      if (sym->in_reg())
 	{
 	  gold_debug(DEBUG_INCREMENTAL,
 		     "PLT entry %d: %s",
 		     i, sym->name());
-	  target->register_global_plt_entry(symtab, layout, i, sym);
+	  target->register_global_plt_entry(i, sym);
 	}
     }
 }
@@ -1966,9 +1950,8 @@
     input_reader_(ibase->inputs_reader().input_file(input_file_index)),
     local_symbol_count_(0), output_local_dynsym_count_(0),
     local_symbol_index_(0), local_symbol_offset_(0), local_dynsym_offset_(0),
-    symbols_(), defined_count_(0), incr_reloc_offset_(-1U),
-    incr_reloc_count_(0), incr_reloc_output_index_(0), incr_relocs_(NULL),
-    local_symbols_()
+    symbols_(), incr_reloc_offset_(-1U), incr_reloc_count_(0),
+    incr_reloc_output_index_(0), incr_relocs_(NULL), local_symbols_()
 {
   if (this->input_reader_.is_in_system_directory())
     this->set_is_in_system_directory();
@@ -2025,9 +2008,7 @@
         this->error(_("COMDAT group has no signature"));
       bool keep = layout->find_or_add_kept_section(signature, this, i, true,
 						   true, NULL);
-      if (keep)
-	incremental_inputs->report_comdat_group(this, signature);
-      else
+      if (!keep)
         this->error(_("COMDAT group %s included twice in incremental link"),
 		    signature);
     }
@@ -2121,9 +2102,6 @@
 
       Symbol* res = symtab->add_from_incrobj(this, name, NULL, &sym);
 
-      if (shndx != elfcpp::SHN_UNDEF)
-        ++this->defined_count_;
-
       // If this is a linker-defined symbol that hasn't yet been defined,
       // define it now.
       if (input_shndx == -1U && !res->is_defined())
@@ -2287,21 +2265,9 @@
 template<int size, bool big_endian>
 void
 Sized_relobj_incr<size, big_endian>::do_get_global_symbol_counts(
-    const Symbol_table*,
-    size_t* defined,
-    size_t* used) const
+    const Symbol_table*, size_t*, size_t*) const
 {
-  *defined = this->defined_count_;
-  size_t count = 0;
-  for (typename Symbols::const_iterator p = this->symbols_.begin();
-       p != this->symbols_.end();
-       ++p)
-    if (*p != NULL
-	&& (*p)->source() == Symbol::FROM_OBJECT
-	&& (*p)->object() == this
-	&& (*p)->is_defined())
-      ++count;
-  *used = count;
+  gold_unreachable();
 }
 
 // Read the relocs.
@@ -2595,7 +2561,7 @@
   : Dynobj(name, NULL), ibase_(ibase),
     input_file_index_(input_file_index),
     input_reader_(ibase->inputs_reader().input_file(input_file_index)),
-    symbols_(), defined_count_(0)
+    symbols_()
 {
   if (this->input_reader_.is_in_system_directory())
     this->set_is_in_system_directory();
@@ -2693,7 +2659,6 @@
 	  // is meaningless, as long as it's not SHN_UNDEF.
 	  shndx = 1;
 	  v = gsym.get_st_value();
-	  ++this->defined_count_;
 	}
 
       osym.put_st_name(0);
@@ -2862,22 +2827,9 @@
 template<int size, bool big_endian>
 void
 Sized_incr_dynobj<size, big_endian>::do_get_global_symbol_counts(
-    const Symbol_table*,
-    size_t* defined,
-    size_t* used) const
+    const Symbol_table*, size_t*, size_t*) const
 {
-  *defined = this->defined_count_;
-  size_t count = 0;
-  for (typename Symbols::const_iterator p = this->symbols_.begin();
-       p != this->symbols_.end();
-       ++p)
-    if (*p != NULL
-	&& (*p)->source() == Symbol::FROM_OBJECT
-	&& (*p)->object() == this
-	&& (*p)->is_defined()
-	&& (*p)->dynsym_index() != -1U)
-      ++count;
-  *used = count;
+  gold_unreachable();
 }
 
 // Allocate an incremental object of the appropriate size and endianness.
diff --git a/binutils/binutils-2.21/gold/incremental.h b/binutils/binutils-2.21/gold/incremental.h
index 56fc52b..1e4d9f5 100644
--- a/binutils/binutils-2.21/gold/incremental.h
+++ b/binutils/binutils-2.21/gold/incremental.h
@@ -81,11 +81,6 @@
 
 static const int INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT = 30;
 
-// Return TRUE if a section of type SH_TYPE can be updated in place
-// during an incremental update.
-bool
-can_incremental_update(unsigned int sh_type);
-
 // Create an Incremental_binary object for FILE. Returns NULL is this is not
 // possible, e.g. FILE is not an ELF file or has an unsupported target.
 
@@ -1996,8 +1991,6 @@
   unsigned int local_dynsym_offset_;
   // The entries in the symbol table for the external symbols.
   Symbols symbols_;
-  // Number of symbols defined in object file itself.
-  size_t defined_count_;
   // The offset of the first incremental relocation for this object.
   unsigned int incr_reloc_offset_;
   // The number of incremental relocations for this object.
@@ -2129,8 +2122,6 @@
   Input_entry_reader input_reader_;
   // The entries in the symbol table for the external symbols.
   Symbols symbols_;
-  // Number of symbols defined in object file itself.
-  size_t defined_count_;
 };
 
 // Allocate an incremental object of the appropriate size and endianness.
diff --git a/binutils/binutils-2.21/gold/int_encoding.cc b/binutils/binutils-2.21/gold/int_encoding.cc
index 7063add..ef58749 100644
--- a/binutils/binutils-2.21/gold/int_encoding.cc
+++ b/binutils/binutils-2.21/gold/int_encoding.cc
@@ -44,7 +44,7 @@
 
   do
     {
-      if (num_read > 64 / 7 + 1) 
+      if (num_read >= 64 / 7) 
         {
           gold_warning(_("Unusually large LEB128 decoded, "
 			 "debug information may be corrupted"));
@@ -75,7 +75,7 @@
 
   do
     {
-      if (num_read > 64 / 7 + 1) 
+      if (num_read >= 64 / 7) 
         {
           gold_warning(_("Unusually large LEB128 decoded, "
 			 "debug information may be corrupted"));
diff --git a/binutils/binutils-2.21/gold/layout.cc b/binutils/binutils-2.21/gold/layout.cc
index cc994ba..d2dd25f 100644
--- a/binutils/binutils-2.21/gold/layout.cc
+++ b/binutils/binutils-2.21/gold/layout.cc
@@ -44,7 +44,6 @@
 #include "symtab.h"
 #include "dynobj.h"
 #include "ehframe.h"
-#include "gdb-index.h"
 #include "compressed_output.h"
 #include "reduced_debug_output.h"
 #include "reloc.h"
@@ -162,11 +161,6 @@
 
   ++Free_list::num_allocates;
 
-  // We usually want to drop free chunks smaller than 4 bytes.
-  // If we need to guarantee a minimum hole size, though, we need
-  // to keep track of all free chunks.
-  const int fuzz = this->min_hole_ > 0 ? 0 : 3;
-
   for (Iterator p = this->list_.begin(); p != this->list_.end(); ++p)
     {
       ++Free_list::num_allocate_visits;
@@ -178,13 +172,13 @@
 	  this->length_ = end;
 	  p->end_ = end;
 	}
-      if (end == p->end_ || (end <= p->end_ - this->min_hole_))
+      if (end <= p->end_)
 	{
-	  if (p->start_ + fuzz >= start && p->end_ <= end + fuzz)
+	  if (p->start_ + 3 >= start && p->end_ <= end + 3)
 	    this->list_.erase(p);
-	  else if (p->start_ + fuzz >= start)
+	  else if (p->start_ + 3 >= start)
 	    p->start_ = end;
-	  else if (p->end_ <= end + fuzz)
+	  else if (p->end_ <= end + 3)
 	    p->end_ = start;
 	  else
 	    {
@@ -389,7 +383,6 @@
     eh_frame_data_(NULL),
     added_eh_frame_data_(false),
     eh_frame_hdr_section_(NULL),
-    gdb_index_data_(NULL),
     build_id_note_(NULL),
     debug_abbrev_(NULL),
     debug_info_(NULL),
@@ -410,7 +403,6 @@
     script_output_section_data_list_(),
     segment_states_(NULL),
     relaxation_debug_check_(NULL),
-    section_order_map_(),
     input_section_position_(),
     input_section_glob_(),
     incremental_base_(NULL),
@@ -865,10 +857,11 @@
 {
   unsigned int sh_type = shdr.get_sh_type();
 
-  // We preserve the layout of PROGBITS, NOBITS, INIT_ARRAY, FINI_ARRAY,
-  // PRE_INIT_ARRAY, and NOTE sections.
+  // We preserve the layout of PROGBITS, NOBITS, and NOTE sections.
   // All others will be created from scratch and reallocated.
-  if (!can_incremental_update(sh_type))
+  if (sh_type != elfcpp::SHT_PROGBITS
+      && sh_type != elfcpp::SHT_NOBITS
+      && sh_type != elfcpp::SHT_NOTE)
     return NULL;
 
   typename elfcpp::Elf_types<size>::Elf_Addr sh_addr = shdr.get_sh_addr();
@@ -1194,38 +1187,6 @@
   return os;
 }
 
-// Scan a .debug_info or .debug_types section, and add summary
-// information to the .gdb_index section.
-
-template<int size, bool big_endian>
-void
-Layout::add_to_gdb_index(bool is_type_unit,
-			 Sized_relobj<size, big_endian>* object,
-			 const unsigned char* symbols,
-			 off_t symbols_size,
-			 unsigned int shndx,
-			 unsigned int reloc_shndx,
-			 unsigned int reloc_type)
-{
-  if (this->gdb_index_data_ == NULL)
-    {
-      Output_section* os = this->choose_output_section(NULL, ".gdb_index",
-						       elfcpp::SHT_PROGBITS, 0,
-						       false, ORDER_INVALID,
-						       false);
-      if (os == NULL)
-        return;
-
-      this->gdb_index_data_ = new Gdb_index(os);
-      os->add_output_section_data(this->gdb_index_data_);
-      os->set_after_input_sections();
-    }
-
-  this->gdb_index_data_->scan_debug_info(is_type_unit, object, symbols,
-					 symbols_size, shndx, reloc_shndx,
-					 reloc_type);
-}
-
 // Add POSD to an output section using NAME, TYPE, and FLAGS.  Return
 // the output section.
 
@@ -1362,24 +1323,10 @@
       && order != ORDER_FINI
       && order != ORDER_RELRO_LAST
       && order != ORDER_NON_RELRO_FIRST
-      && strcmp(name, ".eh_frame") != 0
       && strcmp(name, ".ctors") != 0
       && strcmp(name, ".dtors") != 0
       && strcmp(name, ".jcr") != 0)
-    {
-      os->set_is_patch_space_allowed();
-
-      // Certain sections require "holes" to be filled with
-      // specific fill patterns.  These fill patterns may have
-      // a minimum size, so we must prevent allocations from the
-      // free list that leave a hole smaller than the minimum.
-      if (strcmp(name, ".debug_info") == 0)
-        os->set_free_space_fill(new Output_fill_debug_info(false));
-      else if (strcmp(name, ".debug_types") == 0)
-        os->set_free_space_fill(new Output_fill_debug_info(true));
-      else if (strcmp(name, ".debug_line") == 0)
-        os->set_free_space_fill(new Output_fill_debug_line());
-    }
+    os->set_is_patch_space_allowed();
 
   // If we have already attached the sections to segments, then we
   // need to attach this one now.  This happens for sections created
@@ -3960,8 +3907,7 @@
 // some targets have multiple reloc sections in PLT_REL.
 
 // If DYN_REL is not NULL, it is used for DT_REL/DT_RELA,
-// DT_RELSZ/DT_RELASZ, DT_RELENT/DT_RELAENT.  Again we use the output
-// section.
+// DT_RELSZ/DT_RELASZ, DT_RELENT/DT_RELAENT.
 
 // If ADD_DEBUG is true, we add a DT_DEBUG entry when generating an
 // executable.
@@ -3990,16 +3936,13 @@
   if (dyn_rel != NULL && dyn_rel->output_section() != NULL)
     {
       odyn->add_section_address(use_rel ? elfcpp::DT_REL : elfcpp::DT_RELA,
-				dyn_rel->output_section());
-      if (plt_rel != NULL
-	  && plt_rel->output_section() != NULL
-	  && dynrel_includes_plt)
+				dyn_rel);
+      if (plt_rel != NULL && dynrel_includes_plt)
 	odyn->add_section_size(use_rel ? elfcpp::DT_RELSZ : elfcpp::DT_RELASZ,
-			       dyn_rel->output_section(),
-			       plt_rel->output_section());
+			       dyn_rel, plt_rel);
       else
 	odyn->add_section_size(use_rel ? elfcpp::DT_RELSZ : elfcpp::DT_RELASZ,
-			       dyn_rel->output_section());
+			       dyn_rel);
       const int size = parameters->target().get_size();
       elfcpp::DT rel_tag;
       int rel_size;
@@ -5053,52 +4996,4 @@
 				  off_t* off);
 #endif
 
-#ifdef HAVE_TARGET_32_LITTLE
-template
-void
-Layout::add_to_gdb_index(bool is_type_unit,
-			 Sized_relobj<32, false>* object,
-			 const unsigned char* symbols,
-			 off_t symbols_size,
-			 unsigned int shndx,
-			 unsigned int reloc_shndx,
-			 unsigned int reloc_type);
-#endif
-
-#ifdef HAVE_TARGET_32_BIG
-template
-void
-Layout::add_to_gdb_index(bool is_type_unit,
-			 Sized_relobj<32, true>* object,
-			 const unsigned char* symbols,
-			 off_t symbols_size,
-			 unsigned int shndx,
-			 unsigned int reloc_shndx,
-			 unsigned int reloc_type);
-#endif
-
-#ifdef HAVE_TARGET_64_LITTLE
-template
-void
-Layout::add_to_gdb_index(bool is_type_unit,
-			 Sized_relobj<64, false>* object,
-			 const unsigned char* symbols,
-			 off_t symbols_size,
-			 unsigned int shndx,
-			 unsigned int reloc_shndx,
-			 unsigned int reloc_type);
-#endif
-
-#ifdef HAVE_TARGET_64_BIG
-template
-void
-Layout::add_to_gdb_index(bool is_type_unit,
-			 Sized_relobj<64, true>* object,
-			 const unsigned char* symbols,
-			 off_t symbols_size,
-			 unsigned int shndx,
-			 unsigned int reloc_shndx,
-			 unsigned int reloc_type);
-#endif
-
 } // End namespace gold.
diff --git a/binutils/binutils-2.21/gold/layout.h b/binutils/binutils-2.21/gold/layout.h
index 32b4f18..c87f05c 100644
--- a/binutils/binutils-2.21/gold/layout.h
+++ b/binutils/binutils-2.21/gold/layout.h
@@ -58,7 +58,6 @@
 class Output_reduced_debug_abbrev_section;
 class Output_reduced_debug_info_section;
 class Eh_frame;
-class Gdb_index;
 class Target;
 struct Timespec;
 
@@ -72,6 +71,26 @@
 class Free_list
 {
  public:
+  Free_list()
+    : list_(), last_remove_(list_.begin()), extend_(false), length_(0)
+  { }
+
+  void
+  init(off_t len, bool extend);
+
+  void
+  remove(off_t start, off_t end);
+
+  off_t
+  allocate(off_t len, uint64_t align, off_t minoff);
+
+  void
+  dump();
+
+  static void
+  print_stats();
+
+ private:
   struct Free_list_node
   {
     Free_list_node(off_t start, off_t end)
@@ -80,52 +99,6 @@
     off_t start_;
     off_t end_;
   };
-  typedef std::list<Free_list_node>::const_iterator Const_iterator;
-
-  Free_list()
-    : list_(), last_remove_(list_.begin()), extend_(false), length_(0),
-      min_hole_(0)
-  { }
-
-  // Initialize the free list for a section of length LEN.
-  // If EXTEND is true, free space may be allocated past the end.
-  void
-  init(off_t len, bool extend);
-
-  // Set the minimum hole size that is allowed when allocating
-  // from the free list.
-  void
-  set_min_hole_size(off_t min_hole)
-  { this->min_hole_ = min_hole; }
-
-  // Remove a chunk from the free list.
-  void
-  remove(off_t start, off_t end);
-
-  // Allocate a chunk of space from the free list of length LEN,
-  // with alignment ALIGN, and minimum offset MINOFF.
-  off_t
-  allocate(off_t len, uint64_t align, off_t minoff);
-
-  // Return an iterator for the beginning of the free list.
-  Const_iterator
-  begin() const
-  { return this->list_.begin(); }
-
-  // Return an iterator for the end of the free list.
-  Const_iterator
-  end() const
-  { return this->list_.end(); }
-
-  // Dump the free list (for debugging).
-  void
-  dump();
-
-  // Print usage statistics.
-  static void
-  print_stats();
-
- private:
   typedef std::list<Free_list_node>::iterator Iterator;
 
   // The free list.
@@ -140,10 +113,6 @@
   // The total length of the section, segment, or file.
   off_t length_;
 
-  // The minimum hole size allowed.  When allocating from the free list,
-  // we must not leave a hole smaller than this.
-  off_t min_hole_;
-
   // Statistics:
   // The total number of free lists used.
   static unsigned int num_lists;
@@ -523,10 +492,6 @@
 	 const char* name, const elfcpp::Shdr<size, big_endian>& shdr,
 	 unsigned int reloc_shndx, unsigned int reloc_type, off_t* offset);
 
-  std::map<Section_id, unsigned int>*
-  get_section_order_map()
-  { return &this->section_order_map_; }
- 
   bool
   is_section_ordering_specified()
   { return this->section_ordering_specified_; }
@@ -594,18 +559,6 @@
 		  unsigned int reloc_shndx, unsigned int reloc_type,
 		  off_t* offset);
 
-  // Scan a .debug_info or .debug_types section, and add summary
-  // information to the .gdb_index section.
-  template<int size, bool big_endian>
-  void
-  add_to_gdb_index(bool is_type_unit,
-		   Sized_relobj<size, big_endian>* object,
-		   const unsigned char* symbols,
-		   off_t symbols_size,
-		   unsigned int shndx,
-		   unsigned int reloc_shndx,
-		   unsigned int reloc_type);
-
   // Handle a GNU stack note.  This is called once per input object
   // file.  SEEN_GNU_STACK is true if the object file has a
   // .note.GNU-stack section.  GNU_STACK_FLAGS is the section flags
@@ -1250,8 +1203,6 @@
   bool added_eh_frame_data_;
   // The exception frame header output section if there is one.
   Output_section* eh_frame_hdr_section_;
-  // The data for the .gdb_index section.
-  Gdb_index* gdb_index_data_;
   // The space for the build ID checksum if there is one.
   Output_section_data* build_id_note_;
   // The output section containing dwarf abbreviations
@@ -1297,9 +1248,6 @@
   Segment_states* segment_states_;
   // A relaxation debug checker.  We only create one when in debugging mode.
   Relaxation_debug_check* relaxation_debug_check_;
-  // Plugins specify section_ordering using this map.  This is set in
-  // update_section_order in plugin.cc
-  std::map<Section_id, unsigned int> section_order_map_;
   // Hash a pattern to its position in the section ordering file.
   Unordered_map<std::string, unsigned int> input_section_position_;
   // Vector of glob only patterns in the section_ordering file.
diff --git a/binutils/binutils-2.21/gold/object.cc b/binutils/binutils-2.21/gold/object.cc
index 0e0121a..410c15c 100644
--- a/binutils/binutils-2.21/gold/object.cc
+++ b/binutils/binutils-2.21/gold/object.cc
@@ -598,8 +598,6 @@
 void
 Sized_relobj_file<size, big_endian>::do_read_symbols(Read_symbols_data* sd)
 {
-  bool need_local_symbols = false;
-
   this->read_section_data(&this->elf_file_, sd);
 
   const unsigned char* const pshdrs = sd->section_headers->data();
@@ -618,14 +616,6 @@
         build_compressed_section_map(pshdrs, this->shnum(), names,
 				     sd->section_names_size, this);
 
-  if (this->has_eh_frame_
-      || (!parameters->options().relocatable()
-	  && parameters->options().gdb_index()
-	  && (memmem(names, sd->section_names_size, "debug_info", 12) == 0
-	      || memmem(names, sd->section_names_size, "debug_types",
-			13) == 0)))
-    need_local_symbols = true;
-
   sd->symbols = NULL;
   sd->symbols_size = 0;
   sd->external_symbols_offset = 0;
@@ -643,8 +633,7 @@
 				 + this->symtab_shndx_ * This::shdr_size);
   gold_assert(symtabshdr.get_sh_type() == elfcpp::SHT_SYMTAB);
 
-  // If this object has a .eh_frame section, or if building a .gdb_index
-  // section and there is debug info, we need all the symbols.
+  // If this object has a .eh_frame section, we need all the symbols.
   // Otherwise we only need the external symbols.  While it would be
   // simpler to just always read all the symbols, I've seen object
   // files with well over 2000 local symbols, which for a 64-bit
@@ -662,8 +651,8 @@
   off_t extoff = dataoff + locsize;
   section_size_type extsize = datasize - locsize;
 
-  off_t readoff = need_local_symbols ? dataoff : extoff;
-  section_size_type readsize = need_local_symbols ? datasize : extsize;
+  off_t readoff = this->has_eh_frame_ ? dataoff : extoff;
+  section_size_type readsize = this->has_eh_frame_ ? datasize : extsize;
 
   if (readsize == 0)
     {
@@ -695,7 +684,7 @@
 
   sd->symbols = fvsymtab;
   sd->symbols_size = readsize;
-  sd->external_symbols_offset = need_local_symbols ? locsize : 0;
+  sd->external_symbols_offset = this->has_eh_frame_ ? locsize : 0;
   sd->symbol_names = fvstrtab;
   sd->symbol_names_size =
     convert_to_section_size_type(strtabshdr.get_sh_size());
@@ -1236,10 +1225,6 @@
   // Keep track of .eh_frame sections.
   std::vector<unsigned int> eh_frame_sections;
 
-  // Keep track of .debug_info and .debug_types sections.
-  std::vector<unsigned int> debug_info_sections;
-  std::vector<unsigned int> debug_types_sections;
-
   // Skip the first, dummy, section.
   pshdrs = shdrs + This::shdr_size;
   for (unsigned int i = 1; i < shnum; ++i, pshdrs += This::shdr_size)
@@ -1312,7 +1297,9 @@
 	  Incremental_inputs* incremental_inputs = layout->incremental_inputs();
 	  if (incremental_inputs != NULL
 	      && !discard
-	      && can_incremental_update(shdr.get_sh_type()))
+	      && (shdr.get_sh_type() == elfcpp::SHT_PROGBITS
+	          || shdr.get_sh_type() == elfcpp::SHT_NOBITS
+	          || shdr.get_sh_type() == elfcpp::SHT_NOTE))
 	    {
 	      off_t sh_size = shdr.get_sh_size();
 	      section_size_type uncompressed_size;
@@ -1476,21 +1463,6 @@
           // only happens in the second call.
           this->layout_section(layout, i, name, shdr, reloc_shndx[i],
                                reloc_type[i]);
-
-	  // When generating a .gdb_index section, we do additional
-	  // processing of .debug_info and .debug_types sections after all
-	  // the other sections for the same reason as above.
-	  if (!relocatable
-	      && parameters->options().gdb_index()
-	      && !(shdr.get_sh_flags() & elfcpp::SHF_ALLOC))
-	    {
-	      if (strcmp(name, ".debug_info") == 0
-		  || strcmp(name, ".zdebug_info") == 0)
-		debug_info_sections.push_back(i);
-	      else if (strcmp(name, ".debug_types") == 0
-		       || strcmp(name, ".zdebug_types") == 0)
-		debug_types_sections.push_back(i);
-	    }
         }
     }
 
@@ -1592,29 +1564,6 @@
 	this->set_relocs_must_follow_section_writes();
     }
 
-  // When building a .gdb_index section, scan the .debug_info and
-  // .debug_types sections.
-  gold_assert(!is_gc_pass_one
-	      || (debug_info_sections.empty() && debug_types_sections.empty()));
-  for (std::vector<unsigned int>::const_iterator p
-	   = debug_info_sections.begin();
-       p != debug_info_sections.end();
-       ++p)
-    {
-      unsigned int i = *p;
-      layout->add_to_gdb_index(false, this, symbols_data, symbols_size,
-			       i, reloc_shndx[i], reloc_type[i]);
-    }
-  for (std::vector<unsigned int>::const_iterator p
-	   = debug_types_sections.begin();
-       p != debug_types_sections.end();
-       ++p)
-    {
-      unsigned int i = *p;
-      layout->add_to_gdb_index(true, this, symbols_data, symbols_size,
-			       i, reloc_shndx[i], reloc_type[i]);
-    }
-
   if (is_gc_pass_two)
     {
       delete[] gc_sd->section_headers_data;
diff --git a/binutils/binutils-2.21/gold/options.cc b/binutils/binutils-2.21/gold/options.cc
index d9d6bcd..27c4077 100644
--- a/binutils/binutils-2.21/gold/options.cc
+++ b/binutils/binutils-2.21/gold/options.cc
@@ -198,7 +198,7 @@
 {
   char* endptr;
   *retval = strtol(arg, &endptr, 0);
-  if (*endptr != '\0' || *retval < 0)
+  if (*endptr != '\0' || retval < 0)
     gold_fatal(_("%s: invalid option value (expected an integer): %s"),
                option_name, arg);
 }
@@ -1208,37 +1208,6 @@
     gold_fatal(_("Options --incremental-changed, --incremental-unchanged, "
                  "--incremental-unknown require the use of --incremental"));
 
-  // Check for options that are not compatible with incremental linking.
-  // Where an option can be disabled without seriously changing the semantics
-  // of the link, we turn the option off; otherwise, we issue a fatal error.
-
-  if (this->incremental_mode_ != INCREMENTAL_OFF)
-    {
-      if (this->relocatable())
-	gold_fatal(_("incremental linking is not compatible with -r"));
-      if (this->emit_relocs())
-	gold_fatal(_("incremental linking is not compatible with "
-		     "--emit-relocs"));
-      if (this->has_plugins())
-	gold_fatal(_("incremental linking is not compatible with --plugin"));
-      if (this->gc_sections())
-	{
-	  gold_warning(_("ignoring --gc-sections for an incremental link"));
-	  this->set_gc_sections(false);
-	}
-      if (this->icf_enabled())
-	{
-	  gold_warning(_("ignoring --icf for an incremental link"));
-	  this->set_icf_status(ICF_NONE);
-	}
-      if (strcmp(this->compress_debug_sections(), "none") != 0)
-	{
-	  gold_warning(_("ignoring --compress-debug-sections for an "
-			 "incremental link"));
-	  this->set_compress_debug_sections("none");
-	}
-    }
-
   // FIXME: we can/should be doing a lot more sanity checking here.
 }
 
diff --git a/binutils/binutils-2.21/gold/options.h b/binutils/binutils-2.21/gold/options.h
index b021da4..7e00afb 100644
--- a/binutils/binutils-2.21/gold/options.h
+++ b/binutils/binutils-2.21/gold/options.h
@@ -768,14 +768,6 @@
   DEFINE_bool(g, options::EXACTLY_ONE_DASH, '\0', false,
 	      N_("Ignored"), NULL);
 
-  DEFINE_bool(gdb_index, options::TWO_DASHES, '\0', false,
-	      N_("Generate .gdb_index section"),
-	      N_("Do not generate .gdb_index section"));
-
-  DEFINE_bool(gnu_unique, options::TWO_DASHES, '\0', true,
-	      N_("Enable STB_GNU_UNIQUE symbol binding (default)"),
-	      N_("Disable STB_GNU_UNIQUE symbol binding"));
-
   DEFINE_string(soname, options::ONE_DASH, 'h', NULL,
                 N_("Set shared library name"), N_("FILENAME"));
 
diff --git a/binutils/binutils-2.21/gold/output.cc b/binutils/binutils-2.21/gold/output.cc
index c8aa217..84f0935 100644
--- a/binutils/binutils-2.21/gold/output.cc
+++ b/binutils/binutils-2.21/gold/output.cc
@@ -32,7 +32,6 @@
 #include <algorithm>
 #include "libiberty.h"
 
-#include "dwarf.h"
 #include "parameters.h"
 #include "object.h"
 #include "symtab.h"
@@ -54,9 +53,7 @@
 static int
 posix_fallocate(int o, off_t offset, off_t len)
 {
-  if (ftruncate(o, offset + len) < 0)
-    return errno;
-  return 0;
+  return ftruncate(o, offset + len);
 }
 #endif // !defined(HAVE_POSIX_FALLOCATE)
 
@@ -646,7 +643,7 @@
     bool is_symbolless)
   : address_(address), local_sym_index_(GSYM_CODE), type_(type),
     is_relative_(is_relative), is_symbolless_(is_symbolless),
-    is_section_symbol_(false), use_plt_offset_(false), shndx_(INVALID_CODE)
+    is_section_symbol_(false), shndx_(INVALID_CODE)
 {
   // this->type_ is a bitfield; make sure TYPE fits.
   gold_assert(this->type_ == type);
@@ -667,7 +664,7 @@
     bool is_symbolless)
   : address_(address), local_sym_index_(GSYM_CODE), type_(type),
     is_relative_(is_relative), is_symbolless_(is_symbolless),
-    is_section_symbol_(false), use_plt_offset_(false), shndx_(shndx)
+    is_section_symbol_(false), shndx_(shndx)
 {
   gold_assert(shndx != INVALID_CODE);
   // this->type_ is a bitfield; make sure TYPE fits.
@@ -689,12 +686,10 @@
     Address address,
     bool is_relative,
     bool is_symbolless,
-    bool is_section_symbol,
-    bool use_plt_offset)
+    bool is_section_symbol)
   : address_(address), local_sym_index_(local_sym_index), type_(type),
     is_relative_(is_relative), is_symbolless_(is_symbolless),
-    is_section_symbol_(is_section_symbol), use_plt_offset_(use_plt_offset),
-    shndx_(INVALID_CODE)
+    is_section_symbol_(is_section_symbol), shndx_(INVALID_CODE)
 {
   gold_assert(local_sym_index != GSYM_CODE
               && local_sym_index != INVALID_CODE);
@@ -715,12 +710,10 @@
     Address address,
     bool is_relative,
     bool is_symbolless,
-    bool is_section_symbol,
-    bool use_plt_offset)
+    bool is_section_symbol)
   : address_(address), local_sym_index_(local_sym_index), type_(type),
     is_relative_(is_relative), is_symbolless_(is_symbolless),
-    is_section_symbol_(is_section_symbol), use_plt_offset_(use_plt_offset),
-    shndx_(shndx)
+    is_section_symbol_(is_section_symbol), shndx_(shndx)
 {
   gold_assert(local_sym_index != GSYM_CODE
               && local_sym_index != INVALID_CODE);
@@ -743,7 +736,7 @@
     Address address)
   : address_(address), local_sym_index_(SECTION_CODE), type_(type),
     is_relative_(false), is_symbolless_(false),
-    is_section_symbol_(true), use_plt_offset_(false), shndx_(INVALID_CODE)
+    is_section_symbol_(true), shndx_(INVALID_CODE)
 {
   // this->type_ is a bitfield; make sure TYPE fits.
   gold_assert(this->type_ == type);
@@ -764,7 +757,7 @@
     Address address)
   : address_(address), local_sym_index_(SECTION_CODE), type_(type),
     is_relative_(false), is_symbolless_(false),
-    is_section_symbol_(true), use_plt_offset_(false), shndx_(shndx)
+    is_section_symbol_(true), shndx_(shndx)
 {
   gold_assert(shndx != INVALID_CODE);
   // this->type_ is a bitfield; make sure TYPE fits.
@@ -786,7 +779,7 @@
     Address address)
   : address_(address), local_sym_index_(0), type_(type),
     is_relative_(false), is_symbolless_(false),
-    is_section_symbol_(false), use_plt_offset_(false), shndx_(INVALID_CODE)
+    is_section_symbol_(false), shndx_(INVALID_CODE)
 {
   // this->type_ is a bitfield; make sure TYPE fits.
   gold_assert(this->type_ == type);
@@ -802,7 +795,7 @@
     Address address)
   : address_(address), local_sym_index_(0), type_(type),
     is_relative_(false), is_symbolless_(false),
-    is_section_symbol_(false), use_plt_offset_(false), shndx_(shndx)
+    is_section_symbol_(false), shndx_(shndx)
 {
   gold_assert(shndx != INVALID_CODE);
   // this->type_ is a bitfield; make sure TYPE fits.
@@ -821,7 +814,7 @@
     Address address)
   : address_(address), local_sym_index_(TARGET_CODE), type_(type),
     is_relative_(false), is_symbolless_(false),
-    is_section_symbol_(false), use_plt_offset_(false), shndx_(INVALID_CODE)
+    is_section_symbol_(false), shndx_(INVALID_CODE)
 {
   // this->type_ is a bitfield; make sure TYPE fits.
   gold_assert(this->type_ == type);
@@ -838,7 +831,7 @@
     Address address)
   : address_(address), local_sym_index_(TARGET_CODE), type_(type),
     is_relative_(false), is_symbolless_(false),
-    is_section_symbol_(false), use_plt_offset_(false), shndx_(shndx)
+    is_section_symbol_(false), shndx_(shndx)
 {
   gold_assert(shndx != INVALID_CODE);
   // this->type_ is a bitfield; make sure TYPE fits.
@@ -1065,12 +1058,6 @@
   Sized_relobj_file<size, big_endian>* relobj =
       this->u1_.relobj->sized_relobj();
   gold_assert(relobj != NULL);
-  if (this->use_plt_offset_)
-    {
-      uint64_t plt_address =
-	  parameters->target().plt_address_for_local(relobj, lsi);
-      return plt_address + relobj->local_plt_offset(lsi);
-    }
   const Symbol_value<size>* symval = relobj->local_symbol(lsi);
   return symval->value(relobj, addend);
 }
@@ -1298,7 +1285,7 @@
 	// RELATIVE relocation.
 	Symbol* gsym = this->u_.gsym;
 	if (this->use_plt_offset_ && gsym->has_plt_offset())
-	  val = (parameters->target().plt_address_for_global(gsym)
+	  val = (parameters->target().plt_section_for_global(gsym)->address()
 		 + gsym->plt_offset());
 	else
 	  {
@@ -1332,9 +1319,9 @@
 	  val = symval->value(this->u_.object, 0);
 	else
 	  {
-	    uint64_t plt_address =
-	      parameters->target().plt_address_for_local(object, lsi);
-	    val = plt_address + object->local_plt_offset(lsi);
+	    const Output_data* plt =
+	      parameters->target().plt_section_for_local(object, lsi);
+	    val = plt->address() + object->local_plt_offset(lsi);
 	  }
       }
       break;
@@ -1877,142 +1864,6 @@
     }
 }
 
-// Output_fill_debug_info methods.
-
-// Return the minimum size needed for a dummy compilation unit header.
-
-size_t
-Output_fill_debug_info::do_minimum_hole_size() const
-{
-  // Compile unit header fields: unit_length, version, debug_abbrev_offset,
-  // address_size.
-  const size_t len = 4 + 2 + 4 + 1;
-  // For type units, add type_signature, type_offset.
-  if (this->is_debug_types_)
-    return len + 8 + 4;
-  return len;
-}
-
-// Write a dummy compilation unit header to fill a hole in the
-// .debug_info or .debug_types section.
-
-void
-Output_fill_debug_info::do_write(Output_file* of, off_t off, size_t len) const
-{
-  gold_debug(DEBUG_INCREMENTAL, "fill_debug_info(%08lx, %08lx)",
-	     static_cast<long>(off), static_cast<long>(len));
-
-  gold_assert(len >= this->do_minimum_hole_size());
-
-  unsigned char* const oview = of->get_output_view(off, len);
-  unsigned char* pov = oview;
-
-  // Write header fields: unit_length, version, debug_abbrev_offset,
-  // address_size.
-  if (this->is_big_endian())
-    {
-      elfcpp::Swap<32, true>::writeval(pov, len - 4);
-      elfcpp::Swap<16, true>::writeval(pov + 4, this->version);
-      elfcpp::Swap<32, true>::writeval(pov + 6, 0);
-    }
-  else
-    {
-      elfcpp::Swap<32, false>::writeval(pov, len - 4);
-      elfcpp::Swap<16, false>::writeval(pov + 4, this->version);
-      elfcpp::Swap<32, false>::writeval(pov + 6, 0);
-    }
-  pov += 4 + 2 + 4;
-  *pov++ = 4;
-
-  // For type units, the additional header fields -- type_signature,
-  // type_offset -- can be filled with zeroes.
-
-  // Fill the remainder of the free space with zeroes.  The first
-  // zero should tell the consumer there are no DIEs to read in this
-  // compilation unit.
-  if (pov < oview + len)
-    memset(pov, 0, oview + len - pov);
-
-  of->write_output_view(off, len, oview);
-}
-
-// Output_fill_debug_line methods.
-
-// Return the minimum size needed for a dummy line number program header.
-
-size_t
-Output_fill_debug_line::do_minimum_hole_size() const
-{
-  // Line number program header fields: unit_length, version, header_length,
-  // minimum_instruction_length, default_is_stmt, line_base, line_range,
-  // opcode_base, standard_opcode_lengths[], include_directories, filenames.
-  const size_t len = 4 + 2 + 4 + this->header_length;
-  return len;
-}
-
-// Write a dummy line number program header to fill a hole in the
-// .debug_line section.
-
-void
-Output_fill_debug_line::do_write(Output_file* of, off_t off, size_t len) const
-{
-  gold_debug(DEBUG_INCREMENTAL, "fill_debug_line(%08lx, %08lx)",
-	     static_cast<long>(off), static_cast<long>(len));
-
-  gold_assert(len >= this->do_minimum_hole_size());
-
-  unsigned char* const oview = of->get_output_view(off, len);
-  unsigned char* pov = oview;
-
-  // Write header fields: unit_length, version, header_length,
-  // minimum_instruction_length, default_is_stmt, line_base, line_range,
-  // opcode_base, standard_opcode_lengths[], include_directories, filenames.
-  // We set the header_length field to cover the entire hole, so the
-  // line number program is empty.
-  if (this->is_big_endian())
-    {
-      elfcpp::Swap<32, true>::writeval(pov, len - 4);
-      elfcpp::Swap<16, true>::writeval(pov + 4, this->version);
-      elfcpp::Swap<32, true>::writeval(pov + 6, len - (4 + 2 + 4));
-    }
-  else
-    {
-      elfcpp::Swap<32, false>::writeval(pov, len - 4);
-      elfcpp::Swap<16, false>::writeval(pov + 4, this->version);
-      elfcpp::Swap<32, false>::writeval(pov + 6, len - (4 + 2 + 4));
-    }
-  pov += 4 + 2 + 4;
-  *pov++ = 1;	// minimum_instruction_length
-  *pov++ = 0;	// default_is_stmt
-  *pov++ = 0;	// line_base
-  *pov++ = 5;	// line_range
-  *pov++ = 13;	// opcode_base
-  *pov++ = 0;	// standard_opcode_lengths[1]
-  *pov++ = 1;	// standard_opcode_lengths[2]
-  *pov++ = 1;	// standard_opcode_lengths[3]
-  *pov++ = 1;	// standard_opcode_lengths[4]
-  *pov++ = 1;	// standard_opcode_lengths[5]
-  *pov++ = 0;	// standard_opcode_lengths[6]
-  *pov++ = 0;	// standard_opcode_lengths[7]
-  *pov++ = 0;	// standard_opcode_lengths[8]
-  *pov++ = 1;	// standard_opcode_lengths[9]
-  *pov++ = 0;	// standard_opcode_lengths[10]
-  *pov++ = 0;	// standard_opcode_lengths[11]
-  *pov++ = 1;	// standard_opcode_lengths[12]
-  *pov++ = 0;	// include_directories (empty)
-  *pov++ = 0;	// filenames (empty)
-
-  // Some consumers don't check the header_length field, and simply
-  // start reading the line number program immediately following the
-  // header.  For those consumers, we fill the remainder of the free
-  // space with DW_LNS_set_basic_block opcodes.  These are effectively
-  // no-ops: the resulting line table program will not create any rows.
-  if (pov < oview + len)
-    memset(pov, elfcpp::DW_LNS_set_basic_block, oview + len - pov);
-
-  of->write_output_view(off, len, oview);
-}
-
 // Output_section::Input_section methods.
 
 // Return the current data size.  For an input section we store the size here.
@@ -2245,7 +2096,6 @@
     checkpoint_(NULL),
     lookup_maps_(new Output_section_lookup_maps),
     free_list_(),
-    free_space_fill_(NULL),
     patch_space_(0)
 {
   // An unallocated section has no address.  Forcing this means that
@@ -2425,10 +2275,7 @@
       || layout->is_section_ordering_specified())
     {
       Input_section isecn(object, shndx, input_section_size, addralign);
-      /* If section ordering is requested by specifying a ordering file,
-	 using --section-ordering-file, match the section name with
-	 a pattern.  */
-      if (parameters->options().section_ordering_file())
+      if (layout->is_section_ordering_specified())
         {
           unsigned int section_order_index =
             layout->find_section_order_index(std::string(secname));
@@ -3071,10 +2918,7 @@
   if (this->is_patch_space_allowed_ && parameters->incremental_full())
     {
       double pct = parameters->options().incremental_patch();
-      size_t extra = static_cast<size_t>(data_size * pct);
-      if (this->free_space_fill_ != NULL
-          && this->free_space_fill_->minimum_hole_size() > extra)
-	extra = this->free_space_fill_->minimum_hole_size();
+      off_t extra = static_cast<off_t>(data_size * pct);
       off_t new_size = align_address(data_size + extra, this->addralign());
       this->patch_space_ = new_size - data_size;
       gold_debug(DEBUG_INCREMENTAL,
@@ -3397,7 +3241,7 @@
 
 void
 Output_section::update_section_layout(
-  const Section_layout_order* order_map)
+  const Section_layout_order& order_map)
 {
   for (Input_section_list::iterator p = this->input_sections_.begin();
        p != this->input_sections_.end();
@@ -3411,8 +3255,8 @@
 		         : p->relaxed_input_section()->relobj());
 	  unsigned int shndx = p->shndx();
 	  Section_layout_order::const_iterator it
-	    = order_map->find(Section_id(obj, shndx));
-	  if (it == order_map->end())
+	    = order_map.find(Section_id(obj, shndx));
+	  if (it == order_map.end())
 	    continue;
 	  unsigned int section_order_index = it->second;
 	  if (section_order_index != 0)
@@ -3568,26 +3412,6 @@
       p->write(of);
       off = aligned_off + p->data_size();
     }
-
-  // For incremental links, fill in unused chunks in debug sections
-  // with dummy compilation unit headers.
-  if (this->free_space_fill_ != NULL)
-    {
-      for (Free_list::Const_iterator p = this->free_list_.begin();
-	   p != this->free_list_.end();
-	   ++p)
-	{
-	  off_t off = p->start_;
-	  size_t len = p->end_ - off;
-	  this->free_space_fill_->write(of, this->offset() + off, len);
-	}
-      if (this->patch_space_ > 0)
-	{
-	  off_t off = this->current_data_size_for_child() - this->patch_space_;
-	  this->free_space_fill_->write(of, this->offset() + off,
-					this->patch_space_);
-	}
-    }
 }
 
 // If a section requires postprocessing, create the buffer to use.
@@ -4791,27 +4615,17 @@
   if (use_base_file)
     {
       this->open(s.st_size);
-      ssize_t bytes_to_read = s.st_size;
-      unsigned char* p = this->base_;
-      while (bytes_to_read > 0)
-	{
-	  ssize_t len = ::read(o, p, bytes_to_read);
-	  if (len < 0)
-	    {
-	      gold_info(_("%s: read failed: %s"), base_name, strerror(errno));
-	      return false;
-	    }
-	  if (len == 0)
-	    {
-	      gold_info(_("%s: file too short: read only %lld of %lld bytes"),
-			base_name,
-			static_cast<long long>(s.st_size - bytes_to_read),
-			static_cast<long long>(s.st_size));
-	      return false;
-	    }
-	  p += len;
-	  bytes_to_read -= len;
-	}
+      ssize_t len = ::read(o, this->base_, s.st_size);
+      if (len < 0)
+        {
+	  gold_info(_("%s: read failed: %s"), base_name, strerror(errno));
+	  return false;
+        }
+      if (len < s.st_size)
+        {
+	  gold_info(_("%s: file too short"), base_name);
+	  return false;
+        }
       ::close(o);
       return true;
     }
@@ -4956,12 +4770,8 @@
   // output file will wind up incomplete, but we will have already
   // exited.  The alternative to fallocate would be to use fdatasync,
   // but that would be a more significant performance hit.
-  if (writable)
-    {
-      int err = ::posix_fallocate(o, 0, this->file_size_);
-      if (err != 0)
-       gold_fatal(_("%s: %s"), this->name_, strerror(err));
-    }
+  if (writable && ::posix_fallocate(o, 0, this->file_size_) < 0)
+    gold_fatal(_("%s: %s"), this->name_, strerror(errno));
 
   // Map the file into memory.
   int prot = PROT_READ;
diff --git a/binutils/binutils-2.21/gold/output.h b/binutils/binutils-2.21/gold/output.h
index faa6768..59221f3 100644
--- a/binutils/binutils-2.21/gold/output.h
+++ b/binutils/binutils-2.21/gold/output.h
@@ -1035,14 +1035,12 @@
   Output_reloc(Sized_relobj<size, big_endian>* relobj,
 	       unsigned int local_sym_index, unsigned int type,
 	       Output_data* od, Address address, bool is_relative,
-               bool is_symbolless, bool is_section_symbol,
-               bool use_plt_offset);
+               bool is_symbolless, bool is_section_symbol);
 
   Output_reloc(Sized_relobj<size, big_endian>* relobj,
 	       unsigned int local_sym_index, unsigned int type,
 	       unsigned int shndx, Address address, bool is_relative,
-               bool is_symbolless, bool is_section_symbol,
-               bool use_plt_offset);
+               bool is_symbolless, bool is_section_symbol);
 
   // A reloc against the STT_SECTION symbol of an output section.
 
@@ -1220,7 +1218,7 @@
   // input file.
   unsigned int local_sym_index_;
   // The reloc type--a processor specific code.
-  unsigned int type_ : 28;
+  unsigned int type_ : 29;
   // True if the relocation is a RELATIVE relocation.
   bool is_relative_ : 1;
   // True if the relocation is one which should not use
@@ -1228,10 +1226,6 @@
   bool is_symbolless_ : 1;
   // True if the relocation is against a section symbol.
   bool is_section_symbol_ : 1;
-  // True if the addend should be the PLT offset.  This is used only
-  // for RELATIVE relocations to local symbols.
-  // (Used only for RELA, but stored here for space.)
-  bool use_plt_offset_ : 1;
   // If the reloc address is an input section in an object, the
   // section index.  This is INVALID_CODE if the reloc address is
   // specified in some other way.
@@ -1276,10 +1270,9 @@
 	       unsigned int local_sym_index, unsigned int type,
 	       Output_data* od, Address address,
 	       Addend addend, bool is_relative,
-	       bool is_symbolless, bool is_section_symbol,
-	       bool use_plt_offset)
+	       bool is_symbolless, bool is_section_symbol)
     : rel_(relobj, local_sym_index, type, od, address, is_relative,
-           is_symbolless, is_section_symbol, use_plt_offset),
+           is_symbolless, is_section_symbol),
       addend_(addend)
   { }
 
@@ -1287,10 +1280,9 @@
 	       unsigned int local_sym_index, unsigned int type,
 	       unsigned int shndx, Address address,
 	       Addend addend, bool is_relative,
-	       bool is_symbolless, bool is_section_symbol,
-	       bool use_plt_offset)
+	       bool is_symbolless, bool is_section_symbol)
     : rel_(relobj, local_sym_index, type, shndx, address, is_relative,
-           is_symbolless, is_section_symbol, use_plt_offset),
+           is_symbolless, is_section_symbol),
       addend_(addend)
   { }
 
@@ -1581,7 +1573,7 @@
 	    Output_data* od, Address address)
   {
     this->add(od, Output_reloc_type(relobj, local_sym_index, type, od,
-                                    address, false, false, false, false));
+                                    address, false, false, false));
   }
 
   void
@@ -1590,7 +1582,7 @@
 	    Output_data* od, unsigned int shndx, Address address)
   {
     this->add(od, Output_reloc_type(relobj, local_sym_index, type, shndx,
-				    address, false, false, false, false));
+				    address, false, false, false));
   }
 
   // Add a RELATIVE reloc against a local symbol.
@@ -1601,7 +1593,7 @@
 	             Output_data* od, Address address)
   {
     this->add(od, Output_reloc_type(relobj, local_sym_index, type, od,
-                                    address, true, true, false, false));
+                                    address, true, true, false));
   }
 
   void
@@ -1610,7 +1602,7 @@
 	             Output_data* od, unsigned int shndx, Address address)
   {
     this->add(od, Output_reloc_type(relobj, local_sym_index, type, shndx,
-				    address, true, true, false, false));
+				    address, true, true, false));
   }
 
   // Add a local relocation which does not use a symbol for the relocation,
@@ -1622,7 +1614,7 @@
 			      Output_data* od, Address address)
   {
     this->add(od, Output_reloc_type(relobj, local_sym_index, type, od,
-                                    address, false, true, false, false));
+                                    address, false, true, false));
   }
 
   void
@@ -1632,7 +1624,7 @@
 			      Address address)
   {
     this->add(od, Output_reloc_type(relobj, local_sym_index, type, shndx,
-				    address, false, true, false, false));
+				    address, false, true, false));
   }
 
   // Add a reloc against a local section symbol.  This will be
@@ -1645,7 +1637,7 @@
                     Output_data* od, Address address)
   {
     this->add(od, Output_reloc_type(relobj, input_shndx, type, od,
-                                    address, false, false, true, false));
+                                    address, false, false, true));
   }
 
   void
@@ -1654,7 +1646,7 @@
                     Output_data* od, unsigned int shndx, Address address)
   {
     this->add(od, Output_reloc_type(relobj, input_shndx, type, shndx,
-                                    address, false, false, true, false));
+                                    address, false, false, true));
   }
 
   // A reloc against the STT_SECTION symbol of an output section.
@@ -1777,7 +1769,7 @@
 	    Output_data* od, Address address, Addend addend)
   {
     this->add(od, Output_reloc_type(relobj, local_sym_index, type, od, address,
-				    addend, false, false, false, false));
+				    addend, false, false, false));
   }
 
   void
@@ -1787,8 +1779,7 @@
 	    Addend addend)
   {
     this->add(od, Output_reloc_type(relobj, local_sym_index, type, shndx,
-                                    address, addend, false, false, false,
-                                    false));
+                                    address, addend, false, false, false));
   }
 
   // Add a RELATIVE reloc against a local symbol.
@@ -1796,23 +1787,20 @@
   void
   add_local_relative(Sized_relobj<size, big_endian>* relobj,
 	             unsigned int local_sym_index, unsigned int type,
-	             Output_data* od, Address address, Addend addend,
-	             bool use_plt_offset)
+	             Output_data* od, Address address, Addend addend)
   {
     this->add(od, Output_reloc_type(relobj, local_sym_index, type, od, address,
-				    addend, true, true, false,
-				    use_plt_offset));
+				    addend, true, true, false));
   }
 
   void
   add_local_relative(Sized_relobj<size, big_endian>* relobj,
 	             unsigned int local_sym_index, unsigned int type,
 	             Output_data* od, unsigned int shndx, Address address,
-	             Addend addend, bool use_plt_offset)
+	             Addend addend)
   {
     this->add(od, Output_reloc_type(relobj, local_sym_index, type, shndx,
-                                    address, addend, true, true, false,
-                                    use_plt_offset));
+                                    address, addend, true, true, false));
   }
 
   // Add a local relocation which does not use a symbol for the relocation,
@@ -1824,7 +1812,7 @@
 			      Output_data* od, Address address, Addend addend)
   {
     this->add(od, Output_reloc_type(relobj, local_sym_index, type, od, address,
-				    addend, false, true, false, false));
+				    addend, false, true, false));
   }
 
   void
@@ -1834,8 +1822,7 @@
 			      Address address, Addend addend)
   {
     this->add(od, Output_reloc_type(relobj, local_sym_index, type, shndx,
-                                    address, addend, false, true, false,
-                                    false));
+                                    address, addend, false, true, false));
   }
 
   // Add a reloc against a local section symbol.  This will be
@@ -1848,7 +1835,7 @@
                     Output_data* od, Address address, Addend addend)
   {
     this->add(od, Output_reloc_type(relobj, input_shndx, type, od, address,
-				    addend, false, false, true, false));
+				    addend, false, false, true));
   }
 
   void
@@ -1858,8 +1845,7 @@
 		    Addend addend)
   {
     this->add(od, Output_reloc_type(relobj, input_shndx, type, shndx,
-                                    address, addend, false, false, true,
-                                    false));
+                                    address, addend, false, false, true));
   }
 
   // A reloc against the STT_SECTION symbol of an output section.
@@ -2631,98 +2617,6 @@
   Relaxed_input_sections_by_id relaxed_input_sections_by_id_;
 };
 
-// This abstract base class defines the interface for the
-// types of methods used to fill free space left in an output
-// section during an incremental link.  These methods are used
-// to insert dummy compilation units into debug info so that
-// debug info consumers can scan the debug info serially.
-
-class Output_fill
-{
- public:
-  Output_fill()
-  { this->is_big_endian_ = parameters->target().is_big_endian(); }
-
-  // Return the smallest size chunk of free space that can be
-  // filled with a dummy compilation unit.
-  size_t
-  minimum_hole_size() const
-  { return this->do_minimum_hole_size(); }
-
-  // Write a fill pattern of length LEN at offset OFF in the file.
-  void
-  write(Output_file* of, off_t off, size_t len) const
-  { this->do_write(of, off, len); }
-
- protected:
-  virtual size_t
-  do_minimum_hole_size() const = 0;
-
-  virtual void
-  do_write(Output_file* of, off_t off, size_t len) const = 0;
-
-  bool
-  is_big_endian() const
-  { return this->is_big_endian_; }
-
- private:
-  bool is_big_endian_;
-};
-
-// Fill method that introduces a dummy compilation unit in
-// a .debug_info or .debug_types section.
-
-class Output_fill_debug_info : public Output_fill
-{
- public:
-  Output_fill_debug_info(bool is_debug_types)
-    : is_debug_types_(is_debug_types)
-  { }
-
- protected:
-  virtual size_t
-  do_minimum_hole_size() const;
-
-  virtual void
-  do_write(Output_file* of, off_t off, size_t len) const;
-
- private:
-  // Version of the header.
-  static const int version = 4;
-  // True if this is a .debug_types section.
-  bool is_debug_types_;
-};
-
-// Fill method that introduces a dummy compilation unit in
-// a .debug_line section.
-
-class Output_fill_debug_line : public Output_fill
-{
- public:
-  Output_fill_debug_line()
-  { }
-
- protected:
-  virtual size_t
-  do_minimum_hole_size() const;
-
-  virtual void
-  do_write(Output_file* of, off_t off, size_t len) const;
-
- private:
-  // Version of the header.  We write a DWARF-3 header because it's smaller
-  // and many tools have not yet been updated to understand the DWARF-4 header.
-  static const int version = 3;
-  // Length of the portion of the header that follows the header_length
-  // field.  This includes the following fields:
-  // minimum_instruction_length, default_is_stmt, line_base, line_range,
-  // opcode_base, standard_opcode_lengths[], include_directories, filenames.
-  // The standard_opcode_lengths array is 12 bytes long, and the
-  // include_directories and filenames fields each contain only a single
-  // null byte.
-  static const size_t header_length = 19;
-};
-
 // An output section.  We don't expect to have too many output
 // sections, so we don't bother to do a template on the size.
 
@@ -2776,7 +2670,7 @@
   typedef std::map<Section_id, unsigned int> Section_layout_order;
 
   void
-  update_section_layout(const Section_layout_order* order_map);
+  update_section_layout(const Section_layout_order& order_map);
 
   // Update the output section flags based on input section flags.
   void
@@ -3546,15 +3440,6 @@
   set_is_patch_space_allowed()
   { this->is_patch_space_allowed_ = true; }
 
-  // Set a fill method to use for free space left in the output section
-  // during incremental links.
-  void
-  set_free_space_fill(Output_fill* free_space_fill)
-  {
-    this->free_space_fill_ = free_space_fill;
-    this->free_list_.set_min_hole_size(free_space_fill->minimum_hole_size());
-  }
-
   // Reserve space within the fixed layout for the section.  Used for
   // incremental update links.
   void
@@ -4030,8 +3915,6 @@
   // List of available regions within the section, for incremental
   // update links.
   Free_list free_list_;
-  // Method for filling chunks of free space.
-  Output_fill* free_space_fill_;
   // Amount added as patch space for incremental linking.
   off_t patch_space_;
 };
diff --git a/binutils/binutils-2.21/gold/plugin.cc b/binutils/binutils-2.21/gold/plugin.cc
index dc9990c..8ce152c 100644
--- a/binutils/binutils-2.21/gold/plugin.cc
+++ b/binutils/binutils-2.21/gold/plugin.cc
@@ -369,7 +369,6 @@
     {
       if ((*this->current_)->claim_file(&this->plugin_input_file_))
         {
-	  this->any_claimed_ = true;
 	  this->in_claim_file_handler_ = false;
 
 	  if (this->objects_.size() > handle
@@ -1003,18 +1002,14 @@
   return NULL;
 }
 
-// Get symbol counts.  Don't count plugin objects; the replacement
-// files will provide the counts.
+// Get symbol counts.  Not used for plugin objects.
 
 template<int size, bool big_endian>
 void
-Sized_pluginobj<size, big_endian>::do_get_global_symbol_counts(
-    const Symbol_table*,
-    size_t* defined,
-    size_t* used) const
+Sized_pluginobj<size, big_endian>::do_get_global_symbol_counts(const Symbol_table*,
+                                                   size_t*, size_t*) const
 {
-  *defined = 0;
-  *used = 0;
+  gold_unreachable();
 }
 
 // Get symbols.  Not used for plugin objects.
@@ -1382,7 +1377,7 @@
 // which they should appear in the final layout.
 
 static enum ld_plugin_status
-update_section_order(const struct ld_plugin_section* section_list,
+update_section_order(const struct ld_plugin_section *section_list,
 		     unsigned int num_sections)
 {
   gold_assert(parameters->options().has_plugins());
@@ -1393,14 +1388,8 @@
   if (section_list == NULL)
     return LDPS_ERR;
 
-  Layout* layout = parameters->options().plugins()->layout();
-  gold_assert (layout != NULL);
- 
-  std::map<Section_id, unsigned int>* order_map
-    = layout->get_section_order_map();
+  std::map<Section_id, unsigned int> order_map;
 
-  /* Store the mapping from Section_id to section position in layout's
-     order_map to consult after output sections are added.  */  
   for (unsigned int i = 0; i < num_sections; ++i)
     {
       Object* obj = parameters->options().plugins()->get_elf_object(
@@ -1409,9 +1398,17 @@
 	return LDPS_BAD_HANDLE;
       unsigned int shndx = section_list[i].shndx;
       Section_id secn_id(obj, shndx);
-      (*order_map)[secn_id] = i + 1;
+      order_map[secn_id] = i + 1;
     }
 
+  Layout* layout = parameters->options().plugins()->layout();
+  gold_assert (layout != NULL);
+
+  for (Layout::Section_list::const_iterator p = layout->section_list().begin();
+       p != layout->section_list().end();
+       ++p)
+    (*p)->update_section_layout(order_map);
+
   return LDPS_OK;
 }
 
diff --git a/binutils/binutils-2.21/gold/plugin.h b/binutils/binutils-2.21/gold/plugin.h
index 19e6c6d..addbc7b 100644
--- a/binutils/binutils-2.21/gold/plugin.h
+++ b/binutils/binutils-2.21/gold/plugin.h
@@ -124,7 +124,7 @@
  public:
   Plugin_manager(const General_options& options)
     : plugins_(), objects_(), deferred_layout_objects_(), input_file_(NULL),
-      plugin_input_file_(), any_claimed_(false), in_replacement_phase_(false),
+      plugin_input_file_(), in_replacement_phase_(false),
       in_claim_file_handler_(false),
       options_(options), workqueue_(NULL), task_(NULL), input_objects_(NULL),
       symtab_(NULL), layout_(NULL), dirpath_(NULL), mapfile_(NULL),
@@ -222,7 +222,7 @@
   // and we are still in the initial input phase.
   bool
   should_defer_layout() const
-  { return this->any_claimed_ && !this->in_replacement_phase_; }
+  { return !this->objects_.empty() && !this->in_replacement_phase_; }
 
   // Add a regular object to the deferred layout list.  These are
   // objects whose layout has been deferred until after the
@@ -288,9 +288,6 @@
   Input_file* input_file_;
   struct ld_plugin_input_file plugin_input_file_;
 
-  // Whether any input files have been claimed by a plugin.
-  bool any_claimed_;
-
   // TRUE after the all symbols read event; indicates that we are
   // processing replacement files whose symbols should replace the
   // placeholder symbols from the Pluginobj objects.
diff --git a/binutils/binutils-2.21/gold/powerpc.cc b/binutils/binutils-2.21/gold/powerpc.cc
index 240029f..5b4dcbc 100644
--- a/binutils/binutils-2.21/gold/powerpc.cc
+++ b/binutils/binutils-2.21/gold/powerpc.cc
@@ -1325,7 +1325,7 @@
               rela_dyn->add_local_relative(object, r_sym, r_type,
 					   output_section, data_shndx,
 					   reloc.get_r_offset(),
-					   reloc.get_r_addend(), false);
+					   reloc.get_r_addend());
             }
         }
       break;
@@ -1368,7 +1368,7 @@
 		object->set_local_got_offset(r_sym, GOT_TYPE_STANDARD, off);
 		rela_dyn->add_local_relative(object, r_sym,
 					     elfcpp::R_POWERPC_RELATIVE,
-					     got, off, 0, false);
+					     got, off, 0);
 	      }
           }
 	else
diff --git a/binutils/binutils-2.21/gold/readsyms.cc b/binutils/binutils-2.21/gold/readsyms.cc
index 2481fcb..e0cbc62 100644
--- a/binutils/binutils-2.21/gold/readsyms.cc
+++ b/binutils/binutils-2.21/gold/readsyms.cc
@@ -161,10 +161,8 @@
 Read_symbols::run(Workqueue* workqueue)
 {
   // If we didn't queue a new task, then we need to explicitly unblock
-  // the token. If the object is a member of a lib group, however,
-  // the token was already added to the list of locks for the task,
-  // and it will be unblocked automatically at the end of the task.
-  if (!this->do_read_symbols(workqueue) && this->member_ == NULL)
+  // the token.
+  if (!this->do_read_symbols(workqueue))
     workqueue->queue_soon(new Unblock_token(this->this_blocker_,
 					    this->next_blocker_));
 }
diff --git a/binutils/binutils-2.21/gold/reduced_debug_output.cc b/binutils/binutils-2.21/gold/reduced_debug_output.cc
index 4b0f4d6..5bc8053 100644
--- a/binutils/binutils-2.21/gold/reduced_debug_output.cc
+++ b/binutils/binutils-2.21/gold/reduced_debug_output.cc
@@ -61,10 +61,8 @@
       switch(form)
         {
           case elfcpp::DW_FORM_null:
-          case elfcpp::DW_FORM_flag_present:
             break;
           case elfcpp::DW_FORM_strp:
-          case elfcpp::DW_FORM_sec_offset:
             die += is64 ? 8 : 4;
             break;
           case elfcpp::DW_FORM_addr:
@@ -90,7 +88,6 @@
               break;
             }
           case elfcpp::DW_FORM_block:
-          case elfcpp::DW_FORM_exprloc:
             LEB_decoded = read_unsigned_LEB_128(die, &LEB_size);
             die += (LEB_decoded + LEB_size);
             break;
@@ -109,7 +106,6 @@
             break;
           case elfcpp::DW_FORM_data8:
           case elfcpp::DW_FORM_ref8:
-          case elfcpp::DW_FORM_ref_sig8:
             die += 8;
             break;
           case elfcpp::DW_FORM_ref_udata:
@@ -117,20 +113,14 @@
             read_unsigned_LEB_128(die, &LEB_size);
             die += LEB_size;
             break;
-          case elfcpp::DW_FORM_sdata:
-            read_signed_LEB_128(die, &LEB_size);
-            die += LEB_size;
-            break;
           case elfcpp::DW_FORM_string:
             {
               size_t length = strlen(reinterpret_cast<char*>(die));
               die += length + 1;
               break;
             }
+          case elfcpp::DW_FORM_sdata:
           case elfcpp::DW_FORM_indirect:
-          case elfcpp::DW_FORM_GNU_ref_index:
-          case elfcpp::DW_FORM_GNU_addr_index:
-          case elfcpp::DW_FORM_GNU_str_index:
             return false;
       }
     }
diff --git a/binutils/binutils-2.21/gold/resolve.cc b/binutils/binutils-2.21/gold/resolve.cc
index 545e702..fd0fea6 100644
--- a/binutils/binutils-2.21/gold/resolve.cc
+++ b/binutils/binutils-2.21/gold/resolve.cc
@@ -322,9 +322,9 @@
       && to->name()[0] == '_' && to->name()[1] == 'Z')
     {
       Symbol_location fromloc
-          = { object, orig_st_shndx, static_cast<off_t>(sym.get_st_value()) };
+          = { object, orig_st_shndx, sym.get_st_value() };
       Symbol_location toloc = { to->object(), to->shndx(&to_is_ordinary),
-				static_cast<off_t>(to->value()) };
+				to->value() };
       this->candidate_odr_violations_[to->name()].insert(fromloc);
       this->candidate_odr_violations_[to->name()].insert(toloc);
     }
diff --git a/binutils/binutils-2.21/gold/sparc.cc b/binutils/binutils-2.21/gold/sparc.cc
index 2995a59..d3c5310 100644
--- a/binutils/binutils-2.21/gold/sparc.cc
+++ b/binutils/binutils-2.21/gold/sparc.cc
@@ -1850,7 +1850,7 @@
           rela_dyn->add_local_relative(object, r_sym, elfcpp::R_SPARC_RELATIVE,
 				       output_section, data_shndx,
 				       reloc.get_r_offset(),
-				       reloc.get_r_addend(), false);
+				       reloc.get_r_addend());
         }
       break;
 
@@ -1941,7 +1941,7 @@
 		object->set_local_got_offset(r_sym, GOT_TYPE_STANDARD, off);
 		rela_dyn->add_local_relative(object, r_sym,
 					     elfcpp::R_SPARC_RELATIVE,
-					     got, off, 0, false);
+					     got, off, 0);
 	      }
 	  }
 	else
diff --git a/binutils/binutils-2.21/gold/symtab.cc b/binutils/binutils-2.21/gold/symtab.cc
index 09d0f02..8e7dadc 100644
--- a/binutils/binutils-2.21/gold/symtab.cc
+++ b/binutils/binutils-2.21/gold/symtab.cc
@@ -581,16 +581,20 @@
 }
 
 void
-Symbol_table::gc_mark_symbol(Symbol* sym)
+Symbol_table::gc_mark_symbol_for_shlib(Symbol* sym)
 {
-  // Add the object and section to the work list.
-  Relobj* obj = static_cast<Relobj*>(sym->object());
-  bool is_ordinary;
-  unsigned int shndx = sym->shndx(&is_ordinary);
-  if (is_ordinary && shndx != elfcpp::SHN_UNDEF)
+  if (!sym->is_from_dynobj() 
+      && sym->is_externally_visible())
     {
-      gold_assert(this->gc_!= NULL);
-      this->gc_->worklist().push(Section_id(obj, shndx));
+      //Add the object and section to the work list.
+      Relobj* obj = static_cast<Relobj*>(sym->object());
+      bool is_ordinary;
+      unsigned int shndx = sym->shndx(&is_ordinary);
+      if (is_ordinary && shndx != elfcpp::SHN_UNDEF)
+        {
+          gold_assert(this->gc_!= NULL);
+          this->gc_->worklist().push(Section_id(obj, shndx));
+        }
     }
 }
 
@@ -601,7 +605,16 @@
 {
   if (sym->in_dyn() && sym->source() == Symbol::FROM_OBJECT
       && !sym->object()->is_dynamic())
-    this->gc_mark_symbol(sym);
+    {
+      Relobj* obj = static_cast<Relobj*>(sym->object()); 
+      bool is_ordinary;
+      unsigned int shndx = sym->shndx(&is_ordinary);
+      if (is_ordinary && shndx != elfcpp::SHN_UNDEF)
+        {
+          gold_assert(this->gc_ != NULL);
+          this->gc_->worklist().push(Section_id(obj, shndx));
+        }
+    }
 }
 
 // Make TO a symbol which forwards to FROM.
@@ -1105,14 +1118,6 @@
       bool is_default_version = false;
       bool is_forced_local = false;
 
-      // FIXME: For incremental links, we don't store version information,
-      // so we need to ignore version symbols for now.
-      if (parameters->incremental_update() && ver != NULL)
-	{
-	  namelen = ver - name;
-	  ver = NULL;
-	}
-
       if (ver != NULL)
         {
           // The symbol name is of the form foo@VERSION or foo@@VERSION
@@ -1210,16 +1215,11 @@
 				  is_default_version, *psym, st_shndx,
 				  is_ordinary, orig_st_shndx);
       
-      // Do not treat this symbol as garbage if this symbol will be
-      // exported to the dynamic symbol table.  This is true when
-      // building a shared library or using --export-dynamic and
-      // the symbol is externally visible.
-      if (parameters->options().gc_sections()
-	  && res->is_externally_visible()
-	  && !res->is_from_dynobj()
-          && (parameters->options().shared()
-	      || parameters->options().export_dynamic()))
-        this->gc_mark_symbol(res);
+      // If building a shared library using garbage collection, do not 
+      // treat externally visible symbols as garbage.
+      if (parameters->options().gc_sections() 
+          && parameters->options().shared())
+        this->gc_mark_symbol_for_shlib(res);
 
       if (is_forced_local)
 	this->force_local(res);
@@ -1321,11 +1321,6 @@
       return;
     }
 
-  // FIXME: For incremental links, we don't store version information,
-  // so we need to ignore version symbols for now.
-  if (parameters->incremental_update())
-    versym = NULL;
-
   if (versym != NULL && versym_size / 2 < count)
     {
       dynobj->error(_("too few symbol versions"));
@@ -2775,12 +2770,6 @@
       typename elfcpp::Elf_types<size>::Elf_Addr sym_value = sym->value();
       typename elfcpp::Elf_types<size>::Elf_Addr dynsym_value = sym_value;
       elfcpp::STB binding = sym->binding();
-
-      // If --no-gnu-unique is set, change STB_GNU_UNIQUE to STB_GLOBAL.
-      if (binding == elfcpp::STB_GNU_UNIQUE
-          && !parameters->options().gnu_unique())
-	binding = elfcpp::STB_GLOBAL;
-
       switch (sym->source())
 	{
 	case Symbol::FROM_OBJECT:
diff --git a/binutils/binutils-2.21/gold/symtab.h b/binutils/binutils-2.21/gold/symtab.h
index b930b59..aa2975d 100644
--- a/binutils/binutils-2.21/gold/symtab.h
+++ b/binutils/binutils-2.21/gold/symtab.h
@@ -1303,9 +1303,10 @@
   void
   gc_mark_undef_symbols(Layout*);
 
-  // This tells garbage collection that this symbol is referenced.
+  // During garbage collection, this ensures externally visible symbols
+  // are not treated as garbage while building shared objects.
   void
-  gc_mark_symbol (Symbol* sym);
+  gc_mark_symbol_for_shlib(Symbol* sym);
 
   // During garbage collection, this keeps sections that correspond to 
   // symbols seen in dynamic objects.
diff --git a/binutils/binutils-2.21/gold/target.h b/binutils/binutils-2.21/gold/target.h
index 8e49a71..4bdd9ed 100644
--- a/binutils/binutils-2.21/gold/target.h
+++ b/binutils/binutils-2.21/gold/target.h
@@ -274,19 +274,17 @@
   reloc_addend(void* arg, unsigned int type, uint64_t addend) const
   { return this->do_reloc_addend(arg, type, addend); }
 
-  // Return the PLT address to use for a global symbol.  This is used
-  // for STT_GNU_IFUNC symbols.  The symbol's plt_offset is relative
-  // to this PLT address.
-  uint64_t
-  plt_address_for_global(const Symbol* sym) const
-  { return this->do_plt_address_for_global(sym); }
+  // Return the PLT section to use for a global symbol.  This is used
+  // for STT_GNU_IFUNC symbols.
+  Output_data*
+  plt_section_for_global(const Symbol* sym) const
+  { return this->do_plt_section_for_global(sym); }
 
-  // Return the PLT address to use for a local symbol.  This is used
-  // for STT_GNU_IFUNC symbols.  The symbol's plt_offset is relative
-  // to this PLT address.
-  uint64_t
-  plt_address_for_local(const Relobj* object, unsigned int symndx) const
-  { return this->do_plt_address_for_local(object, symndx); }
+  // Return the PLT section to use for a local symbol.  This is used
+  // for STT_GNU_IFUNC symbols.
+  Output_data*
+  plt_section_for_local(const Relobj* object, unsigned int symndx) const
+  { return this->do_plt_section_for_local(object, symndx); }
 
   // Return true if a reference to SYM from a reloc of type R_TYPE
   // means that the current function may call an object compiled
@@ -491,12 +489,12 @@
 
   // Virtual functions that must be overridden by a target that uses
   // STT_GNU_IFUNC symbols.
-  virtual uint64_t
-  do_plt_address_for_global(const Symbol*) const
+  virtual Output_data*
+  do_plt_section_for_global(const Symbol*) const
   { gold_unreachable(); }
 
-  virtual uint64_t
-  do_plt_address_for_local(const Relobj*, unsigned int) const
+  virtual Output_data*
+  do_plt_section_for_local(const Relobj*, unsigned int) const
   { gold_unreachable(); }
 
   // Virtual function which may be overridden by the child class.  The
@@ -831,8 +829,7 @@
   // A target needs to implement this to support incremental linking.
 
   virtual void
-  register_global_plt_entry(Symbol_table*, Layout*,
-			    unsigned int /* plt_index */,
+  register_global_plt_entry(unsigned int /* plt_index */,
 			    Symbol*)
   { gold_unreachable(); }
 
diff --git a/binutils/binutils-2.21/gold/testsuite/Makefile.am b/binutils/binutils-2.21/gold/testsuite/Makefile.am
index 2a6ede3..fb0a4f9 100644
--- a/binutils/binutils-2.21/gold/testsuite/Makefile.am
+++ b/binutils/binutils-2.21/gold/testsuite/Makefile.am
@@ -1420,20 +1420,6 @@
 unused.c:
 	@cp /dev/null $@
 
-check_SCRIPTS += plugin_final_layout.sh
-check_DATA += plugin_final_layout.stdout
-plugin_final_layout.o: plugin_final_layout.cc
-	$(CXXCOMPILE) -O0 -c -ffunction-sections  -fdata-sections -g -o $@ $<
-plugin_final_layout: plugin_final_layout.o plugin_section_order.so gcctestdir/ld
-	$(CXXLINK) -Bgcctestdir/ -Wl,--plugin,"./plugin_section_order.so" plugin_final_layout.o
-plugin_final_layout.stdout: plugin_final_layout
-	$(TEST_NM) -n plugin_final_layout > plugin_final_layout.stdout
-
-plugin_section_order.so: plugin_section_order.o
-	$(LINK) -Bgcctestdir/ -shared plugin_section_order.o
-plugin_section_order.o: plugin_section_order.c
-	$(COMPILE) -O0 -c -fpic -o $@ $<
-
 endif PLUGINS
 
 check_PROGRAMS += exclude_libs_test
@@ -1587,7 +1573,6 @@
 ifuncmain1pie.o: ifuncmain1.c
 	$(COMPILE) -c -fpie -o $@ $<
 
-if IFUNC_STATIC
 check_PROGRAMS += ifuncmain1static
 ifuncmain1static_SOURCES = ifuncmain1.c
 ifuncmain1static_DEPENDENCIES = gcctestdir/ld ifuncdep1.o
@@ -1597,7 +1582,6 @@
 check_PROGRAMS += ifuncmain1picstatic
 ifuncmain1picstatic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld
 	$(LINK) -Bgcctestdir/ -static ifuncmain1pic.o ifuncmod1.o
-endif
 
 check_PROGRAMS += ifuncmain1
 ifuncmain1_SOURCES = ifuncmain1.c
@@ -1645,23 +1629,19 @@
 ifuncdep2pic.o: ifuncdep2.c
 	$(COMPILE) -c -fpic -o $@ $<
 
-if IFUNC_STATIC
 check_PROGRAMS += ifuncmain2static
 ifuncmain2static_SOURCES = ifuncmain2.c ifuncdep2.c
 ifuncmain2static_DEPENDENCIES = gcctestdir/ld
 ifuncmain2static_LDFLAGS = -Bgcctestdir/ -static
-ifuncmain2static_LDADD =
 
 check_PROGRAMS += ifuncmain2picstatic
 ifuncmain2picstatic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld
 	$(LINK) -Bgcctestdir/ -static ifuncmain2pic.o ifuncdep2pic.o
-endif
 
 check_PROGRAMS += ifuncmain2
 ifuncmain2_SOURCES = ifuncmain2.c ifuncdep2.c
 ifuncmain2_DEPENDENCIES = gcctestdir/ld
 ifuncmain2_LDFLAGS = -Bgcctestdir/
-ifuncmain2_LDADD =
 
 check_PROGRAMS += ifuncmain2pic
 ifuncmain2pic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld
@@ -1681,23 +1661,19 @@
 ifuncmain4pic.o: ifuncmain4.c
 	$(COMPILE) -c -fpic -o $@ $<
 
-if IFUNC_STATIC
 check_PROGRAMS += ifuncmain4static
 ifuncmain4static_SOURCES = ifuncmain4.c
 ifuncmain4static_DEPENDENCIES = gcctestdir/ld
 ifuncmain4static_LDFLAGS = -Bgcctestdir/ -static
-ifuncmain4static_LDADD =
 
 check_PROGRAMS += ifuncmain4picstatic
 ifuncmain4picstatic: ifuncmain4pic.o gcctestdir/ld
 	$(LINK) -Bgcctestdir/ -static ifuncmain4pic.o
-endif
 
 check_PROGRAMS += ifuncmain4
 ifuncmain4_SOURCES = ifuncmain4.c
 ifuncmain4_DEPENDENCIES = gcctestdir/ld
 ifuncmain4_LDFLAGS = -Bgcctestdir/
-ifuncmain4_LDADD =
 
 ifuncmain5pic.o: ifuncmain5.c
 	$(COMPILE) -c -fpic -o $@ $<
@@ -1713,7 +1689,6 @@
 ifuncdep5.o: ifuncmod5.c
 	$(COMPILE) -c -o $@ $<
 
-if IFUNC_STATIC
 check_PROGRAMS += ifuncmain5static
 ifuncmain5static_SOURCES = ifuncmain5.c
 ifuncmain5static_DEPENDENCIES = gcctestdir/ld ifuncdep5.o
@@ -1723,7 +1698,6 @@
 check_PROGRAMS += ifuncmain5picstatic
 ifuncmain5picstatic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld
 	$(LINK) -Bgcctestdir/ -static ifuncmain5pic.o ifuncmod5.o
-endif
 
 check_PROGRAMS += ifuncmain5
 ifuncmain5_SOURCES = ifuncmain5.c
@@ -1761,23 +1735,19 @@
 ifuncmain7pie.o: ifuncmain7.c
 	$(COMPILE) -c -fpie -o $@ $<
 
-if IFUNC_STATIC
 check_PROGRAMS += ifuncmain7static
 ifuncmain7static_SOURCES = ifuncmain7.c
 ifuncmain7static_DEPENDENCIES = gcctestdir/ld
 ifuncmain7static_LDFLAGS = -Bgcctestdir/ -static
-ifuncmain7static_LDADD =
 
 check_PROGRAMS += ifuncmain7picstatic
 ifuncmain7picstatic: ifuncmain7pic.o gcctestdir/ld
 	$(LINK) -Bgcctestdir/ -static ifuncmain7pic.o
-endif
 
 check_PROGRAMS += ifuncmain7
 ifuncmain7_SOURCES = ifuncmain7.c
 ifuncmain7_DEPENDENCIES = gcctestdir/ld
 ifuncmain7_LDFLAGS = -Bgcctestdir/
-ifuncmain7_LDADD =
 
 check_PROGRAMS += ifuncmain7pic
 ifuncmain7pic: ifuncmain7pic.o gcctestdir/ld
@@ -1787,18 +1757,6 @@
 ifuncmain7pie: ifuncmain7pie.o gcctestdir/ld
 	$(LINK) -Bgcctestdir/ -pie ifuncmain7pie.o
 
-check_PROGRAMS += ifuncvar
-ifuncvar1_pic.o: ifuncvar1.c
-	$(COMPILE) -c -fpic -o $@ $<
-ifuncvar2_pic.o: ifuncvar2.c	
-	$(COMPILE) -c -fpic -o $@ $<
-ifuncvar.so: ifuncvar1_pic.o ifuncvar2_pic.o gcctestdir/ld
-	$(LINK) -Bgcctestdir/ -shared ifuncvar1_pic.o ifuncvar2_pic.o
-ifuncvar_SOURCES = ifuncvar3.c
-ifuncvar_DEPENDENCIES = gcctestdir/ld ifuncvar.so
-ifuncvar_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-ifuncvar_LDADD = ifuncvar.so
-
 endif IFUNC
 
 # Test that strong reference to a weak symbol in a DSO remains strong.
@@ -1859,63 +1817,27 @@
 memory_test.stdout: memory_test
 	$(TEST_READELF) -lWS  $< > $@
 
-# Test that --gdb-index functions correctly.
-check_SCRIPTS += gdb_index_test_1.sh
-check_DATA += gdb_index_test_1.stdout
-MOSTLYCLEANFILES += gdb_index_test_1.stdout gdb_index_test_1
-gdb_index_test.o: gdb_index_test.cc
-	$(CXXCOMPILE) -O0 -g -c -o $@ $<
-gdb_index_test_1: gdb_index_test.o gcctestdir/ld
-	$(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $<
-gdb_index_test_1.stdout: gdb_index_test_1
-	$(TEST_READELF) --debug-dump=gdb_index $< > $@
-
-if HAVE_ZLIB
-
-check_SCRIPTS += gdb_index_test_2.sh
-check_DATA += gdb_index_test_2.stdout
-MOSTLYCLEANFILES += gdb_index_test_2.stdout gdb_index_test_2
-gdb_index_test_cdebug.o: gdb_index_test.cc
-	$(CXXCOMPILE) -O0 -g -Wa,--compress-debug-sections -c -o $@ $<
-gdb_index_test_2: gdb_index_test_cdebug.o gcctestdir/ld
-	$(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $<
-gdb_index_test_2.stdout: gdb_index_test_2
-	$(TEST_READELF) --debug-dump=gdb_index $< > $@
-
-endif HAVE_ZLIB
-
 # End-to-end incremental linking tests.
 # Incremental linking is currently supported only on the x86_64 target.
 
 if DEFAULT_TARGET_X86_64
 
-two_file_test_1_v1_ndebug.o: two_file_test_1_v1.cc
-	$(CXXCOMPILE) -O0 -g0 -c -o $@ $<
-two_file_test_1_ndebug.o: two_file_test_1.cc
-	$(CXXCOMPILE) -O0 -g0 -c -o $@ $<
-two_file_test_1b_ndebug.o: two_file_test_1b.cc
-	$(CXXCOMPILE) -O0 -g0 -c -o $@ $<
-two_file_test_2_ndebug.o: two_file_test_2.cc
-	$(CXXCOMPILE) -O0 -g0 -c -o $@ $<
-two_file_test_main_ndebug.o: two_file_test_main.cc
-	$(CXXCOMPILE) -O0 -g0 -c -o $@ $<
-
 check_PROGRAMS += incremental_test_2
 MOSTLYCLEANFILES += two_file_test_tmp_2.o
-incremental_test_2: two_file_test_1_v1_ndebug.o two_file_test_1_ndebug.o two_file_test_1b_ndebug.o \
-		    two_file_test_2_ndebug.o two_file_test_main_ndebug.o gcctestdir/ld
-	cp -f two_file_test_1_v1_ndebug.o two_file_test_tmp_2.o
-	$(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ two_file_test_tmp_2.o two_file_test_1b_ndebug.o two_file_test_2_ndebug.o two_file_test_main_ndebug.o
+incremental_test_2: two_file_test_1_v1.o two_file_test_1.o two_file_test_1b.o \
+		    two_file_test_2.o two_file_test_main.o gcctestdir/ld
+	cp -f two_file_test_1_v1.o two_file_test_tmp_2.o
+	$(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ two_file_test_tmp_2.o two_file_test_1b.o two_file_test_2.o two_file_test_main.o
 	@sleep 1
-	cp -f two_file_test_1_ndebug.o two_file_test_tmp_2.o
-	$(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ two_file_test_tmp_2.o two_file_test_1b_ndebug.o two_file_test_2_ndebug.o two_file_test_main_ndebug.o
+	cp -f two_file_test_1.o two_file_test_tmp_2.o
+	$(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ two_file_test_tmp_2.o two_file_test_1b.o two_file_test_2.o two_file_test_main.o
 
 check_PROGRAMS += incremental_test_3
 MOSTLYCLEANFILES += two_file_test_tmp_3.o
 incremental_test_3: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \
 		    two_file_test_2.o two_file_test_main.o gcctestdir/ld
 	cp -f two_file_test_1b_v1.o two_file_test_tmp_3.o
-	$(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ two_file_test_1.o two_file_test_tmp_3.o two_file_test_2.o two_file_test_main.o
+	$(CXXLINK) -Wl,--incremental-full -Bgcctestdir/ two_file_test_1.o two_file_test_tmp_3.o two_file_test_2.o two_file_test_main.o
 	@sleep 1
 	cp -f two_file_test_1b.o two_file_test_tmp_3.o
 	$(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ two_file_test_1.o two_file_test_tmp_3.o two_file_test_2.o two_file_test_main.o
@@ -1925,7 +1847,7 @@
 incremental_test_4: two_file_test_1.o two_file_test_1b.o two_file_test_2_v1.o \
 		    two_file_test_2.o two_file_test_main.o gcctestdir/ld
 	cp -f two_file_test_2_v1.o two_file_test_tmp_4.o
-	$(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ two_file_test_1.o two_file_test_1b.o two_file_test_tmp_4.o two_file_test_main.o
+	$(CXXLINK) -Wl,--incremental-full -Bgcctestdir/ two_file_test_1.o two_file_test_1b.o two_file_test_tmp_4.o two_file_test_main.o
 	mv -f incremental_test_4 incremental_test_4.base
 	@sleep 1
 	cp -f two_file_test_2.o two_file_test_tmp_4.o
@@ -1937,7 +1859,7 @@
 		    two_file_test_2.o two_file_test_main.o gcctestdir/ld
 	cp -f two_file_test_1b_v1.o two_file_test_tmp_5.o
 	$(TEST_AR) rc two_file_test_5.a two_file_test_1.o two_file_test_tmp_5.o two_file_test_2.o
-	$(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ two_file_test_main.o two_file_test_5.a
+	$(CXXLINK) -Wl,--incremental-full -Bgcctestdir/ two_file_test_main.o two_file_test_5.a
 	@sleep 1
 	cp -f two_file_test_1b.o two_file_test_tmp_5.o
 	$(TEST_AR) rc two_file_test_5.a two_file_test_1.o two_file_test_tmp_5.o two_file_test_2.o
@@ -1951,7 +1873,7 @@
 		    two_file_test_2.o two_file_test_main.o gcctestdir/ld
 	cp -f two_file_test_1b.o two_file_test_tmp_6.o
 	$(TEST_AR) rc two_file_test_6.a two_file_test_1.o two_file_test_tmp_6.o two_file_test_2.o
-	$(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ two_file_test_main.o two_file_test_6.a
+	$(CXXLINK) -Wl,--incremental-full -Bgcctestdir/ two_file_test_main.o two_file_test_6.a
 	@sleep 1
 	cp -f two_file_test_1b_v1.o two_file_test_tmp_6.o
 	$(TEST_AR) rc two_file_test_6.a two_file_test_1.o two_file_test_tmp_6.o two_file_test_2.o
@@ -1960,7 +1882,7 @@
 check_PROGRAMS += incremental_copy_test
 incremental_copy_test: copy_test_v1.o copy_test.o copy_test_1.so copy_test_2.so
 	cp -f copy_test_v1.o copy_test_tmp.o
-	$(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ -Wl,-R,. copy_test_tmp.o copy_test_1.so copy_test_2.so
+	$(CXXLINK) -Wl,--incremental-full -Bgcctestdir/ -Wl,-R,. copy_test_tmp.o copy_test_1.so copy_test_2.so
 	@sleep 1
 	cp -f copy_test.o copy_test_tmp.o
 	$(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ -Wl,-R,. copy_test_tmp.o copy_test_1.so copy_test_2.so
@@ -1968,22 +1890,11 @@
 check_PROGRAMS += incremental_common_test_1
 incremental_common_test_1: common_test_1_v1.o common_test_1_v2.o gcctestdir/ld
 	cp -f common_test_1_v1.o common_test_1_tmp.o
-	$(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ common_test_1_tmp.o
+	$(CXXLINK) -Wl,--incremental-full -Bgcctestdir/ common_test_1_tmp.o
 	@sleep 1
 	cp -f common_test_1_v2.o common_test_1_tmp.o
 	$(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ common_test_1_tmp.o
 
-check_PROGRAMS += incremental_comdat_test_1
-incremental_comdat_test_1: incr_comdat_test_1.o incr_comdat_test_2_v1.o incr_comdat_test_2_v2.o incr_comdat_test_2_v3.o gcctestdir/ld
-	cp -f incr_comdat_test_2_v1.o incr_comdat_test_1_tmp.o
-	$(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o
-	@sleep 1
-	cp -f incr_comdat_test_2_v2.o incr_comdat_test_1_tmp.o
-	$(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o
-	@sleep 1
-	cp -f incr_comdat_test_2_v3.o incr_comdat_test_1_tmp.o
-	$(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o
-
 endif DEFAULT_TARGET_X86_64
 
 endif GCC
diff --git a/binutils/binutils-2.21/gold/testsuite/Makefile.in b/binutils/binutils-2.21/gold/testsuite/Makefile.in
index 9b8ba8a..94a5a93 100644
--- a/binutils/binutils-2.21/gold/testsuite/Makefile.in
+++ b/binutils/binutils-2.21/gold/testsuite/Makefile.in
@@ -47,10 +47,7 @@
 	$(am__EXEEXT_13) $(am__EXEEXT_14) $(am__EXEEXT_15) \
 	$(am__EXEEXT_16) $(am__EXEEXT_17) $(am__EXEEXT_18) \
 	$(am__EXEEXT_19) $(am__EXEEXT_20) $(am__EXEEXT_21) \
-	$(am__EXEEXT_22) $(am__EXEEXT_23) $(am__EXEEXT_24) \
-	$(am__EXEEXT_25) $(am__EXEEXT_26) $(am__EXEEXT_27) \
-	$(am__EXEEXT_28) $(am__EXEEXT_29) $(am__EXEEXT_30) \
-	$(am__EXEEXT_31) $(am__EXEEXT_32)
+	$(am__EXEEXT_22) $(am__EXEEXT_23)
 @NATIVE_OR_CROSS_LINKER_TRUE@am__append_1 = object_unittest \
 @NATIVE_OR_CROSS_LINKER_TRUE@	binary_unittest
 
@@ -282,8 +279,7 @@
 @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@	plugin_test_3.sh \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@	plugin_test_4.sh \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@	plugin_test_6.sh \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@	plugin_test_7.sh \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@	plugin_final_layout.sh
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@	plugin_test_7.sh
 
 # Test that symbols known in the IR file but not in the replacement file
 # produce an unresolved symbol error.
@@ -295,8 +291,7 @@
 @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@	plugin_test_6.err \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@	plugin_test_7.err \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@	plugin_test_7.syms \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@	plugin_test_9.err \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@	plugin_final_layout.stdout
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@	plugin_test_9.err
 # Make a copy of two_file_test_1.o, which does not define the symbol _Z4t16av.
 @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@am__append_26 =  \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@	plugin_test_1.err \
@@ -327,16 +322,13 @@
 # weak reference in a DSO.
 
 # Test that MEMORY region support works.
-
-# Test that --gdb-index functions correctly.
 @GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_28 = exclude_libs_test.sh \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	discard_locals_test.sh \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	hidden_test.sh \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	retain_symbols_file_test.sh \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	no_version_test.sh \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	strong_ref_weak_def.sh \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@	dyn_weak_ref.sh memory_test.sh \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@	gdb_index_test_1.sh
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	dyn_weak_ref.sh memory_test.sh
 @GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_29 = exclude_libs_test.syms \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	discard_locals_test.syms \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	discard_locals_relocatable_test1.syms \
@@ -346,8 +338,7 @@
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	no_version_test.stdout \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	strong_ref_weak_def.stdout \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	dyn_weak_ref.stdout \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@	memory_test.stdout \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@	gdb_index_test_1.stdout
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	memory_test.stdout
 @GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_30 = exclude_libs_test.syms \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	libexclude_libs_test_1.a \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	libexclude_libs_test_2.a \
@@ -373,9 +364,7 @@
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	dyn_weak_ref_2.so \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	dyn_weak_ref.stdout \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	memory_test.stdout memory_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@	memory_test.o \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@	gdb_index_test_1.stdout \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@	gdb_index_test_1
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	memory_test.o
 @GCC_TRUE@@MCMODEL_MEDIUM_TRUE@@NATIVE_LINKER_TRUE@am__append_31 = large
 @GCC_FALSE@large_DEPENDENCIES =
 @MCMODEL_MEDIUM_FALSE@large_DEPENDENCIES =
@@ -389,79 +378,126 @@
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	searched_file_test
 @GCC_FALSE@searched_file_test_DEPENDENCIES =
 @NATIVE_LINKER_FALSE@searched_file_test_DEPENDENCIES =
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am__append_33 = ifuncmain1static \
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain1picstatic
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am__append_34 = ifuncmain1 \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am__append_33 =  \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain1static \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain1picstatic \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain1 \
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain1pic \
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain1vis \
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain1vispic \
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain1staticpic \
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain1pie \
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain1vispie \
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain1staticpie
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am__append_35 = ifuncmain2static \
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain2picstatic
-@GCC_FALSE@ifuncmain2static_DEPENDENCIES =
-@IFUNC_FALSE@ifuncmain2static_DEPENDENCIES =
-@IFUNC_STATIC_FALSE@ifuncmain2static_DEPENDENCIES =
-@NATIVE_LINKER_FALSE@ifuncmain2static_DEPENDENCIES =
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am__append_36 = ifuncmain2 \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain1staticpie \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain2static \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain2picstatic \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain2 \
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain2pic \
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain3
-@GCC_FALSE@ifuncmain2_DEPENDENCIES =
-@IFUNC_FALSE@ifuncmain2_DEPENDENCIES =
-@NATIVE_LINKER_FALSE@ifuncmain2_DEPENDENCIES =
-@GCC_FALSE@ifuncmain3_DEPENDENCIES =
-@IFUNC_FALSE@ifuncmain3_DEPENDENCIES =
-@NATIVE_LINKER_FALSE@ifuncmain3_DEPENDENCIES =
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am__append_37 = ifuncmain4static \
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain4picstatic
-@GCC_FALSE@ifuncmain4static_DEPENDENCIES =
-@IFUNC_FALSE@ifuncmain4static_DEPENDENCIES =
-@IFUNC_STATIC_FALSE@ifuncmain4static_DEPENDENCIES =
-@NATIVE_LINKER_FALSE@ifuncmain4static_DEPENDENCIES =
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am__append_38 = ifuncmain4
-@GCC_FALSE@ifuncmain4_DEPENDENCIES =
-@IFUNC_FALSE@ifuncmain4_DEPENDENCIES =
-@NATIVE_LINKER_FALSE@ifuncmain4_DEPENDENCIES =
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am__append_39 = ifuncmain5static \
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain5picstatic
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am__append_40 = ifuncmain5 \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain3 \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain4static \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain4picstatic \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain4 \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain5static \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain5picstatic \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain5 \
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain5pic \
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain5staticpic \
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain5pie \
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain6pie
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am__append_41 = ifuncmain7static \
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain7picstatic
-@GCC_FALSE@ifuncmain7static_DEPENDENCIES =
-@IFUNC_FALSE@ifuncmain7static_DEPENDENCIES =
-@IFUNC_STATIC_FALSE@ifuncmain7static_DEPENDENCIES =
-@NATIVE_LINKER_FALSE@ifuncmain7static_DEPENDENCIES =
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am__append_42 = ifuncmain7 \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain6pie \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain7static \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain7picstatic \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain7 \
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain7pic \
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain7pie \
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncvar
-@GCC_FALSE@ifuncmain7_DEPENDENCIES =
-@IFUNC_FALSE@ifuncmain7_DEPENDENCIES =
-@NATIVE_LINKER_FALSE@ifuncmain7_DEPENDENCIES =
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain7pie
+@GCC_FALSE@ifuncmain2static_DEPENDENCIES = libgoldtest.a ../libgold.a \
+@GCC_FALSE@	../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
+@GCC_FALSE@	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+@IFUNC_FALSE@ifuncmain2static_DEPENDENCIES = libgoldtest.a \
+@IFUNC_FALSE@	../libgold.a ../../libiberty/libiberty.a \
+@IFUNC_FALSE@	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+@IFUNC_FALSE@	$(am__DEPENDENCIES_1)
+@NATIVE_LINKER_FALSE@ifuncmain2static_DEPENDENCIES = libgoldtest.a \
+@NATIVE_LINKER_FALSE@	../libgold.a ../../libiberty/libiberty.a \
+@NATIVE_LINKER_FALSE@	$(am__DEPENDENCIES_1) \
+@NATIVE_LINKER_FALSE@	$(am__DEPENDENCIES_1) \
+@NATIVE_LINKER_FALSE@	$(am__DEPENDENCIES_1)
+@GCC_FALSE@ifuncmain2_DEPENDENCIES = libgoldtest.a ../libgold.a \
+@GCC_FALSE@	../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
+@GCC_FALSE@	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+@IFUNC_FALSE@ifuncmain2_DEPENDENCIES = libgoldtest.a ../libgold.a \
+@IFUNC_FALSE@	../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
+@IFUNC_FALSE@	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+@NATIVE_LINKER_FALSE@ifuncmain2_DEPENDENCIES = libgoldtest.a \
+@NATIVE_LINKER_FALSE@	../libgold.a ../../libiberty/libiberty.a \
+@NATIVE_LINKER_FALSE@	$(am__DEPENDENCIES_1) \
+@NATIVE_LINKER_FALSE@	$(am__DEPENDENCIES_1) \
+@NATIVE_LINKER_FALSE@	$(am__DEPENDENCIES_1)
+@GCC_FALSE@ifuncmain3_DEPENDENCIES =
+@IFUNC_FALSE@ifuncmain3_DEPENDENCIES =
+@NATIVE_LINKER_FALSE@ifuncmain3_DEPENDENCIES =
+@GCC_FALSE@ifuncmain4static_DEPENDENCIES = libgoldtest.a ../libgold.a \
+@GCC_FALSE@	../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
+@GCC_FALSE@	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+@IFUNC_FALSE@ifuncmain4static_DEPENDENCIES = libgoldtest.a \
+@IFUNC_FALSE@	../libgold.a ../../libiberty/libiberty.a \
+@IFUNC_FALSE@	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+@IFUNC_FALSE@	$(am__DEPENDENCIES_1)
+@NATIVE_LINKER_FALSE@ifuncmain4static_DEPENDENCIES = libgoldtest.a \
+@NATIVE_LINKER_FALSE@	../libgold.a ../../libiberty/libiberty.a \
+@NATIVE_LINKER_FALSE@	$(am__DEPENDENCIES_1) \
+@NATIVE_LINKER_FALSE@	$(am__DEPENDENCIES_1) \
+@NATIVE_LINKER_FALSE@	$(am__DEPENDENCIES_1)
+@GCC_FALSE@ifuncmain4_DEPENDENCIES = libgoldtest.a ../libgold.a \
+@GCC_FALSE@	../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
+@GCC_FALSE@	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+@IFUNC_FALSE@ifuncmain4_DEPENDENCIES = libgoldtest.a ../libgold.a \
+@IFUNC_FALSE@	../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
+@IFUNC_FALSE@	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+@NATIVE_LINKER_FALSE@ifuncmain4_DEPENDENCIES = libgoldtest.a \
+@NATIVE_LINKER_FALSE@	../libgold.a ../../libiberty/libiberty.a \
+@NATIVE_LINKER_FALSE@	$(am__DEPENDENCIES_1) \
+@NATIVE_LINKER_FALSE@	$(am__DEPENDENCIES_1) \
+@NATIVE_LINKER_FALSE@	$(am__DEPENDENCIES_1)
+@GCC_FALSE@ifuncmain7static_DEPENDENCIES = libgoldtest.a ../libgold.a \
+@GCC_FALSE@	../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
+@GCC_FALSE@	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+@IFUNC_FALSE@ifuncmain7static_DEPENDENCIES = libgoldtest.a \
+@IFUNC_FALSE@	../libgold.a ../../libiberty/libiberty.a \
+@IFUNC_FALSE@	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+@IFUNC_FALSE@	$(am__DEPENDENCIES_1)
+@NATIVE_LINKER_FALSE@ifuncmain7static_DEPENDENCIES = libgoldtest.a \
+@NATIVE_LINKER_FALSE@	../libgold.a ../../libiberty/libiberty.a \
+@NATIVE_LINKER_FALSE@	$(am__DEPENDENCIES_1) \
+@NATIVE_LINKER_FALSE@	$(am__DEPENDENCIES_1) \
+@NATIVE_LINKER_FALSE@	$(am__DEPENDENCIES_1)
+@GCC_FALSE@ifuncmain7_DEPENDENCIES = libgoldtest.a ../libgold.a \
+@GCC_FALSE@	../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
+@GCC_FALSE@	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+@IFUNC_FALSE@ifuncmain7_DEPENDENCIES = libgoldtest.a ../libgold.a \
+@IFUNC_FALSE@	../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
+@IFUNC_FALSE@	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+@NATIVE_LINKER_FALSE@ifuncmain7_DEPENDENCIES = libgoldtest.a \
+@NATIVE_LINKER_FALSE@	../libgold.a ../../libiberty/libiberty.a \
+@NATIVE_LINKER_FALSE@	$(am__DEPENDENCIES_1) \
+@NATIVE_LINKER_FALSE@	$(am__DEPENDENCIES_1) \
+@NATIVE_LINKER_FALSE@	$(am__DEPENDENCIES_1)
 
 # Test that --start-lib and --end-lib function correctly.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_43 = start_lib_test
-@GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@am__append_44 = gdb_index_test_2.sh
-@GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@am__append_45 = gdb_index_test_2.stdout
-@GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@am__append_46 = gdb_index_test_2.stdout gdb_index_test_2
+@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_34 = start_lib_test
+
+# End-to-end incremental linking tests.
+# Incremental linking is currently supported only on the x86_64 target.
 
 # Test the --incremental-unchanged flag with an archive library.
 # The second link should not update the library.
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_47 = incremental_test_2 \
+@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_35 = incremental_test_2 \
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	incremental_test_3 \
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	incremental_test_4 \
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	incremental_test_5 \
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	incremental_test_6 \
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	incremental_copy_test \
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	incremental_common_test_1 \
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	incremental_comdat_test_1
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_48 = two_file_test_tmp_2.o \
+@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	incremental_common_test_1
+@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_36 = two_file_test_tmp_2.o \
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	two_file_test_tmp_3.o \
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	two_file_test_tmp_4.o \
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	incremental_test_4.base \
@@ -471,34 +507,34 @@
 # These tests work with native and cross linkers.
 
 # Test script section order.
-@NATIVE_OR_CROSS_LINKER_TRUE@am__append_49 = script_test_10.sh
-@NATIVE_OR_CROSS_LINKER_TRUE@am__append_50 = script_test_10.stdout
+@NATIVE_OR_CROSS_LINKER_TRUE@am__append_37 = script_test_10.sh
+@NATIVE_OR_CROSS_LINKER_TRUE@am__append_38 = script_test_10.stdout
 
 # These tests work with cross linkers only.
-@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_51 = split_i386.sh
-@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_52 = split_i386_1.stdout split_i386_2.stdout \
+@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_39 = split_i386.sh
+@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_40 = split_i386_1.stdout split_i386_2.stdout \
 @DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@	split_i386_3.stdout split_i386_4.stdout split_i386_r.stdout
 
-@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_53 = split_i386_1 split_i386_2 split_i386_3 \
+@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_41 = split_i386_1 split_i386_2 split_i386_3 \
 @DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@	split_i386_4 split_i386_r
 
-@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_54 = split_x86_64.sh
-@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_55 = split_x86_64_1.stdout split_x86_64_2.stdout \
+@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_42 = split_x86_64.sh
+@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_43 = split_x86_64_1.stdout split_x86_64_2.stdout \
 @DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@	split_x86_64_3.stdout split_x86_64_4.stdout split_x86_64_r.stdout
 
-@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_56 = split_x86_64_1 split_x86_64_2 split_x86_64_3 \
+@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_44 = split_x86_64_1 split_x86_64_2 split_x86_64_3 \
 @DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@	split_x86_64_4 split_x86_64_r
 
 
 # Cortex-A8 workaround test.
-@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_57 = arm_abs_global.sh \
+@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_45 = arm_abs_global.sh \
 @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@	arm_branch_in_range.sh \
 @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@	arm_branch_out_of_range.sh \
 @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@	arm_fix_v4bx.sh \
 @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@	arm_attr_merge.sh \
 @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@	arm_cortex_a8.sh \
 @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@	arm_exidx_test.sh
-@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_58 = arm_abs_global.stdout \
+@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_46 = arm_abs_global.stdout \
 @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@	arm_bl_in_range.stdout \
 @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@	arm_bl_out_of_range.stdout \
 @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@	thumb_bl_in_range.stdout \
@@ -525,7 +561,7 @@
 @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@	arm_cortex_a8_local.stdout \
 @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@	arm_cortex_a8_local_reloc.stdout \
 @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@	arm_exidx_test.stdout
-@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_59 = arm_abs_global \
+@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_47 = arm_abs_global \
 @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@	arm_bl_in_range \
 @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@	arm_bl_out_of_range \
 @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@	thumb_bl_in_range \
@@ -681,9 +717,8 @@
 @GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_20 =  \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	permission_test$(EXEEXT) \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	searched_file_test$(EXEEXT)
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_21 = ifuncmain1static$(EXEEXT) \
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain1picstatic$(EXEEXT)
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_22 =  \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_21 = ifuncmain1static$(EXEEXT) \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain1picstatic$(EXEEXT) \
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain1$(EXEEXT) \
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain1pic$(EXEEXT) \
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain1vis$(EXEEXT) \
@@ -691,41 +726,35 @@
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain1staticpic$(EXEEXT) \
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain1pie$(EXEEXT) \
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain1vispie$(EXEEXT) \
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain1staticpie$(EXEEXT)
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_23 = ifuncmain2static$(EXEEXT) \
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain2picstatic$(EXEEXT)
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_24 =  \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain1staticpie$(EXEEXT) \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain2static$(EXEEXT) \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain2picstatic$(EXEEXT) \
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain2$(EXEEXT) \
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain2pic$(EXEEXT) \
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain3$(EXEEXT)
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_25 = ifuncmain4static$(EXEEXT) \
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain4picstatic$(EXEEXT)
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_26 =  \
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain4$(EXEEXT)
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_27 = ifuncmain5static$(EXEEXT) \
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain5picstatic$(EXEEXT)
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_28 =  \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain3$(EXEEXT) \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain4static$(EXEEXT) \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain4picstatic$(EXEEXT) \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain4$(EXEEXT) \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain5static$(EXEEXT) \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain5picstatic$(EXEEXT) \
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain5$(EXEEXT) \
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain5pic$(EXEEXT) \
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain5staticpic$(EXEEXT) \
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain5pie$(EXEEXT) \
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain6pie$(EXEEXT)
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_29 = ifuncmain7static$(EXEEXT) \
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain7picstatic$(EXEEXT)
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_30 =  \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain6pie$(EXEEXT) \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain7static$(EXEEXT) \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain7picstatic$(EXEEXT) \
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain7$(EXEEXT) \
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain7pic$(EXEEXT) \
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain7pie$(EXEEXT) \
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncvar$(EXEEXT)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_31 = start_lib_test$(EXEEXT)
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_32 = incremental_test_2$(EXEEXT) \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncmain7pie$(EXEEXT)
+@GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_22 = start_lib_test$(EXEEXT)
+@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_23 = incremental_test_2$(EXEEXT) \
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	incremental_test_3$(EXEEXT) \
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	incremental_test_4$(EXEEXT) \
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	incremental_test_5$(EXEEXT) \
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	incremental_test_6$(EXEEXT) \
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	incremental_copy_test$(EXEEXT) \
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	incremental_common_test_1$(EXEEXT) \
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	incremental_comdat_test_1$(EXEEXT)
+@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	incremental_common_test_1$(EXEEXT)
 basic_pic_test_SOURCES = basic_pic_test.c
 basic_pic_test_OBJECTS = basic_pic_test.$(OBJEXT)
 basic_pic_test_LDADD = $(LDADD)
@@ -914,7 +943,7 @@
 ifuncmain1pie_DEPENDENCIES = libgoldtest.a ../libgold.a \
 	../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
 	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am_ifuncmain1static_OBJECTS = ifuncmain1.$(OBJEXT)
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am_ifuncmain1static_OBJECTS = ifuncmain1.$(OBJEXT)
 ifuncmain1static_OBJECTS = $(am_ifuncmain1static_OBJECTS)
 ifuncmain1static_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
 	$(ifuncmain1static_LDFLAGS) $(LDFLAGS) -o $@
@@ -949,6 +978,7 @@
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am_ifuncmain2_OBJECTS = ifuncmain2.$(OBJEXT) \
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncdep2.$(OBJEXT)
 ifuncmain2_OBJECTS = $(am_ifuncmain2_OBJECTS)
+ifuncmain2_LDADD = $(LDADD)
 ifuncmain2_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(ifuncmain2_LDFLAGS) \
 	$(LDFLAGS) -o $@
 ifuncmain2pic_SOURCES = ifuncmain2pic.c
@@ -963,9 +993,10 @@
 ifuncmain2picstatic_DEPENDENCIES = libgoldtest.a ../libgold.a \
 	../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
 	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am_ifuncmain2static_OBJECTS = ifuncmain2.$(OBJEXT) \
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncdep2.$(OBJEXT)
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am_ifuncmain2static_OBJECTS = ifuncmain2.$(OBJEXT) \
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncdep2.$(OBJEXT)
 ifuncmain2static_OBJECTS = $(am_ifuncmain2static_OBJECTS)
+ifuncmain2static_LDADD = $(LDADD)
 ifuncmain2static_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
 	$(ifuncmain2static_LDFLAGS) $(LDFLAGS) -o $@
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am_ifuncmain3_OBJECTS = ifuncmain3.$(OBJEXT)
@@ -974,6 +1005,7 @@
 	$(LDFLAGS) -o $@
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am_ifuncmain4_OBJECTS = ifuncmain4.$(OBJEXT)
 ifuncmain4_OBJECTS = $(am_ifuncmain4_OBJECTS)
+ifuncmain4_LDADD = $(LDADD)
 ifuncmain4_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(ifuncmain4_LDFLAGS) \
 	$(LDFLAGS) -o $@
 ifuncmain4picstatic_SOURCES = ifuncmain4picstatic.c
@@ -982,8 +1014,9 @@
 ifuncmain4picstatic_DEPENDENCIES = libgoldtest.a ../libgold.a \
 	../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
 	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am_ifuncmain4static_OBJECTS = ifuncmain4.$(OBJEXT)
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am_ifuncmain4static_OBJECTS = ifuncmain4.$(OBJEXT)
 ifuncmain4static_OBJECTS = $(am_ifuncmain4static_OBJECTS)
+ifuncmain4static_LDADD = $(LDADD)
 ifuncmain4static_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
 	$(ifuncmain4static_LDFLAGS) $(LDFLAGS) -o $@
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am_ifuncmain5_OBJECTS = ifuncmain5.$(OBJEXT)
@@ -1008,7 +1041,7 @@
 ifuncmain5pie_DEPENDENCIES = libgoldtest.a ../libgold.a \
 	../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
 	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am_ifuncmain5static_OBJECTS = ifuncmain5.$(OBJEXT)
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am_ifuncmain5static_OBJECTS = ifuncmain5.$(OBJEXT)
 ifuncmain5static_OBJECTS = $(am_ifuncmain5static_OBJECTS)
 ifuncmain5static_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
 	$(ifuncmain5static_LDFLAGS) $(LDFLAGS) -o $@
@@ -1026,6 +1059,7 @@
 	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am_ifuncmain7_OBJECTS = ifuncmain7.$(OBJEXT)
 ifuncmain7_OBJECTS = $(am_ifuncmain7_OBJECTS)
+ifuncmain7_LDADD = $(LDADD)
 ifuncmain7_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(ifuncmain7_LDFLAGS) \
 	$(LDFLAGS) -o $@
 ifuncmain7pic_SOURCES = ifuncmain7pic.c
@@ -1046,22 +1080,11 @@
 ifuncmain7pie_DEPENDENCIES = libgoldtest.a ../libgold.a \
 	../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
 	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am_ifuncmain7static_OBJECTS = ifuncmain7.$(OBJEXT)
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am_ifuncmain7static_OBJECTS = ifuncmain7.$(OBJEXT)
 ifuncmain7static_OBJECTS = $(am_ifuncmain7static_OBJECTS)
+ifuncmain7static_LDADD = $(LDADD)
 ifuncmain7static_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
 	$(ifuncmain7static_LDFLAGS) $(LDFLAGS) -o $@
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@am_ifuncvar_OBJECTS =  \
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	ifuncvar3.$(OBJEXT)
-ifuncvar_OBJECTS = $(am_ifuncvar_OBJECTS)
-ifuncvar_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(ifuncvar_LDFLAGS) \
-	$(LDFLAGS) -o $@
-incremental_comdat_test_1_SOURCES = incremental_comdat_test_1.c
-incremental_comdat_test_1_OBJECTS =  \
-	incremental_comdat_test_1.$(OBJEXT)
-incremental_comdat_test_1_LDADD = $(LDADD)
-incremental_comdat_test_1_DEPENDENCIES = libgoldtest.a ../libgold.a \
-	../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
 incremental_common_test_1_SOURCES = incremental_common_test_1.c
 incremental_common_test_1_OBJECTS =  \
 	incremental_common_test_1.$(OBJEXT)
@@ -1588,8 +1611,7 @@
 	$(ifuncmain5static_SOURCES) ifuncmain5staticpic.c \
 	ifuncmain6pie.c $(ifuncmain7_SOURCES) ifuncmain7pic.c \
 	ifuncmain7picstatic.c ifuncmain7pie.c \
-	$(ifuncmain7static_SOURCES) $(ifuncvar_SOURCES) \
-	incremental_comdat_test_1.c incremental_common_test_1.c \
+	$(ifuncmain7static_SOURCES) incremental_common_test_1.c \
 	incremental_copy_test.c incremental_test_2.c \
 	incremental_test_3.c incremental_test_4.c incremental_test_5.c \
 	incremental_test_6.c $(initpri1_SOURCES) $(justsyms_SOURCES) \
@@ -1738,8 +1760,6 @@
 EXEEXT = @EXEEXT@
 GENCAT = @GENCAT@
 GMSGFMT = @GMSGFMT@
-GOLD_LDADD = @GOLD_LDADD@
-GOLD_LDFLAGS = @GOLD_LDFLAGS@
 GREP = @GREP@
 INCINTL = @INCINTL@
 INSTALL = @INSTALL@
@@ -1762,7 +1782,6 @@
 MKINSTALLDIRS = @MKINSTALLDIRS@
 MSGFMT = @MSGFMT@
 MSGMERGE = @MSGMERGE@
-NM = @NM@
 NO_WERROR = @NO_WERROR@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
@@ -1876,18 +1895,18 @@
 # the right choice for files 'make' builds that people rebuild.
 MOSTLYCLEANFILES = *.so *.syms *.stdout $(am__append_4) \
 	$(am__append_9) $(am__append_18) $(am__append_26) \
-	$(am__append_30) $(am__append_46) $(am__append_48) \
-	$(am__append_53) $(am__append_56) $(am__append_59)
+	$(am__append_30) $(am__append_36) $(am__append_41) \
+	$(am__append_44) $(am__append_47)
 
 # We will add to these later, for each individual test.  Note
 # that we add each test under check_SCRIPTS or check_PROGRAMS;
 # the TESTS variable is automatically populated from these.
 check_SCRIPTS = $(am__append_2) $(am__append_24) $(am__append_28) \
-	$(am__append_44) $(am__append_49) $(am__append_51) \
-	$(am__append_54) $(am__append_57)
+	$(am__append_37) $(am__append_39) $(am__append_42) \
+	$(am__append_45)
 check_DATA = $(am__append_3) $(am__append_25) $(am__append_29) \
-	$(am__append_45) $(am__append_50) $(am__append_52) \
-	$(am__append_55) $(am__append_58)
+	$(am__append_38) $(am__append_40) $(am__append_43) \
+	$(am__append_46)
 BUILT_SOURCES = $(am__append_17)
 TESTS = $(check_SCRIPTS) $(check_PROGRAMS)
 
@@ -2270,10 +2289,10 @@
 @GCC_TRUE@@NATIVE_LINKER_TRUE@searched_file_test_DEPENDENCIES = alt/searched_file_test_lib.a
 @GCC_TRUE@@NATIVE_LINKER_TRUE@searched_file_test_LDFLAGS = -Bgcctestdir/ -Lalt
 @GCC_TRUE@@NATIVE_LINKER_TRUE@searched_file_test_LDADD = -l:searched_file_test_lib.a
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain1static_SOURCES = ifuncmain1.c
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain1static_DEPENDENCIES = gcctestdir/ld ifuncdep1.o
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain1static_LDFLAGS = -Bgcctestdir/ -static
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain1static_LDADD = ifuncdep1.o
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain1static_SOURCES = ifuncmain1.c
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain1static_DEPENDENCIES = gcctestdir/ld ifuncdep1.o
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain1static_LDFLAGS = -Bgcctestdir/ -static
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain1static_LDADD = ifuncdep1.o
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain1_SOURCES = ifuncmain1.c
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain1_DEPENDENCIES = gcctestdir/ld ifuncmod1.so
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain1_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
@@ -2282,46 +2301,36 @@
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain1vis_DEPENDENCIES = gcctestdir/ld ifuncmod1.so
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain1vis_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain1vis_LDADD = ifuncmod1.so
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain2static_SOURCES = ifuncmain2.c ifuncdep2.c
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain2static_DEPENDENCIES = gcctestdir/ld
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain2static_LDFLAGS = -Bgcctestdir/ -static
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain2static_LDADD = 
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain2static_SOURCES = ifuncmain2.c ifuncdep2.c
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain2static_DEPENDENCIES = gcctestdir/ld
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain2static_LDFLAGS = -Bgcctestdir/ -static
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain2_SOURCES = ifuncmain2.c ifuncdep2.c
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain2_DEPENDENCIES = gcctestdir/ld
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain2_LDFLAGS = -Bgcctestdir/
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain2_LDADD = 
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain3_SOURCES = ifuncmain3.c
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain3_DEPENDENCIES = gcctestdir/ld ifuncmod3.so
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain3_LDFLAGS = -Bgcctestdir/ -Wl,--export-dynamic -Wl,-R,.
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain3_LDADD = -ldl
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain4static_SOURCES = ifuncmain4.c
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain4static_DEPENDENCIES = gcctestdir/ld
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain4static_LDFLAGS = -Bgcctestdir/ -static
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain4static_LDADD = 
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain4static_SOURCES = ifuncmain4.c
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain4static_DEPENDENCIES = gcctestdir/ld
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain4static_LDFLAGS = -Bgcctestdir/ -static
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain4_SOURCES = ifuncmain4.c
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain4_DEPENDENCIES = gcctestdir/ld
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain4_LDFLAGS = -Bgcctestdir/
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain4_LDADD = 
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain5static_SOURCES = ifuncmain5.c
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain5static_DEPENDENCIES = gcctestdir/ld ifuncdep5.o
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain5static_LDFLAGS = -Bgcctestdir/ -static
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain5static_LDADD = ifuncdep5.o
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain5static_SOURCES = ifuncmain5.c
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain5static_DEPENDENCIES = gcctestdir/ld ifuncdep5.o
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain5static_LDFLAGS = -Bgcctestdir/ -static
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain5static_LDADD = ifuncdep5.o
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain5_SOURCES = ifuncmain5.c
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain5_DEPENDENCIES = gcctestdir/ld ifuncmod5.so
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain5_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain5_LDADD = ifuncmod5.so
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain7static_SOURCES = ifuncmain7.c
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain7static_DEPENDENCIES = gcctestdir/ld
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain7static_LDFLAGS = -Bgcctestdir/ -static
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain7static_LDADD = 
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain7static_SOURCES = ifuncmain7.c
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain7static_DEPENDENCIES = gcctestdir/ld
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain7static_LDFLAGS = -Bgcctestdir/ -static
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain7_SOURCES = ifuncmain7.c
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain7_DEPENDENCIES = gcctestdir/ld
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain7_LDFLAGS = -Bgcctestdir/
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain7_LDADD = 
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncvar_SOURCES = ifuncvar3.c
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncvar_DEPENDENCIES = gcctestdir/ld ifuncvar.so
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncvar_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncvar_LDADD = ifuncvar.so
 @DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200
 @DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200
 all: $(BUILT_SOURCES)
@@ -2495,9 +2504,6 @@
 @IFUNC_FALSE@ifuncmain1picstatic$(EXEEXT): $(ifuncmain1picstatic_OBJECTS) $(ifuncmain1picstatic_DEPENDENCIES) 
 @IFUNC_FALSE@	@rm -f ifuncmain1picstatic$(EXEEXT)
 @IFUNC_FALSE@	$(LINK) $(ifuncmain1picstatic_OBJECTS) $(ifuncmain1picstatic_LDADD) $(LIBS)
-@IFUNC_STATIC_FALSE@ifuncmain1picstatic$(EXEEXT): $(ifuncmain1picstatic_OBJECTS) $(ifuncmain1picstatic_DEPENDENCIES) 
-@IFUNC_STATIC_FALSE@	@rm -f ifuncmain1picstatic$(EXEEXT)
-@IFUNC_STATIC_FALSE@	$(LINK) $(ifuncmain1picstatic_OBJECTS) $(ifuncmain1picstatic_LDADD) $(LIBS)
 @NATIVE_LINKER_FALSE@ifuncmain1picstatic$(EXEEXT): $(ifuncmain1picstatic_OBJECTS) $(ifuncmain1picstatic_DEPENDENCIES) 
 @NATIVE_LINKER_FALSE@	@rm -f ifuncmain1picstatic$(EXEEXT)
 @NATIVE_LINKER_FALSE@	$(LINK) $(ifuncmain1picstatic_OBJECTS) $(ifuncmain1picstatic_LDADD) $(LIBS)
@@ -2570,9 +2576,6 @@
 @IFUNC_FALSE@ifuncmain2picstatic$(EXEEXT): $(ifuncmain2picstatic_OBJECTS) $(ifuncmain2picstatic_DEPENDENCIES) 
 @IFUNC_FALSE@	@rm -f ifuncmain2picstatic$(EXEEXT)
 @IFUNC_FALSE@	$(LINK) $(ifuncmain2picstatic_OBJECTS) $(ifuncmain2picstatic_LDADD) $(LIBS)
-@IFUNC_STATIC_FALSE@ifuncmain2picstatic$(EXEEXT): $(ifuncmain2picstatic_OBJECTS) $(ifuncmain2picstatic_DEPENDENCIES) 
-@IFUNC_STATIC_FALSE@	@rm -f ifuncmain2picstatic$(EXEEXT)
-@IFUNC_STATIC_FALSE@	$(LINK) $(ifuncmain2picstatic_OBJECTS) $(ifuncmain2picstatic_LDADD) $(LIBS)
 @NATIVE_LINKER_FALSE@ifuncmain2picstatic$(EXEEXT): $(ifuncmain2picstatic_OBJECTS) $(ifuncmain2picstatic_DEPENDENCIES) 
 @NATIVE_LINKER_FALSE@	@rm -f ifuncmain2picstatic$(EXEEXT)
 @NATIVE_LINKER_FALSE@	$(LINK) $(ifuncmain2picstatic_OBJECTS) $(ifuncmain2picstatic_LDADD) $(LIBS)
@@ -2591,9 +2594,6 @@
 @IFUNC_FALSE@ifuncmain4picstatic$(EXEEXT): $(ifuncmain4picstatic_OBJECTS) $(ifuncmain4picstatic_DEPENDENCIES) 
 @IFUNC_FALSE@	@rm -f ifuncmain4picstatic$(EXEEXT)
 @IFUNC_FALSE@	$(LINK) $(ifuncmain4picstatic_OBJECTS) $(ifuncmain4picstatic_LDADD) $(LIBS)
-@IFUNC_STATIC_FALSE@ifuncmain4picstatic$(EXEEXT): $(ifuncmain4picstatic_OBJECTS) $(ifuncmain4picstatic_DEPENDENCIES) 
-@IFUNC_STATIC_FALSE@	@rm -f ifuncmain4picstatic$(EXEEXT)
-@IFUNC_STATIC_FALSE@	$(LINK) $(ifuncmain4picstatic_OBJECTS) $(ifuncmain4picstatic_LDADD) $(LIBS)
 @NATIVE_LINKER_FALSE@ifuncmain4picstatic$(EXEEXT): $(ifuncmain4picstatic_OBJECTS) $(ifuncmain4picstatic_DEPENDENCIES) 
 @NATIVE_LINKER_FALSE@	@rm -f ifuncmain4picstatic$(EXEEXT)
 @NATIVE_LINKER_FALSE@	$(LINK) $(ifuncmain4picstatic_OBJECTS) $(ifuncmain4picstatic_LDADD) $(LIBS)
@@ -2618,9 +2618,6 @@
 @IFUNC_FALSE@ifuncmain5picstatic$(EXEEXT): $(ifuncmain5picstatic_OBJECTS) $(ifuncmain5picstatic_DEPENDENCIES) 
 @IFUNC_FALSE@	@rm -f ifuncmain5picstatic$(EXEEXT)
 @IFUNC_FALSE@	$(LINK) $(ifuncmain5picstatic_OBJECTS) $(ifuncmain5picstatic_LDADD) $(LIBS)
-@IFUNC_STATIC_FALSE@ifuncmain5picstatic$(EXEEXT): $(ifuncmain5picstatic_OBJECTS) $(ifuncmain5picstatic_DEPENDENCIES) 
-@IFUNC_STATIC_FALSE@	@rm -f ifuncmain5picstatic$(EXEEXT)
-@IFUNC_STATIC_FALSE@	$(LINK) $(ifuncmain5picstatic_OBJECTS) $(ifuncmain5picstatic_LDADD) $(LIBS)
 @NATIVE_LINKER_FALSE@ifuncmain5picstatic$(EXEEXT): $(ifuncmain5picstatic_OBJECTS) $(ifuncmain5picstatic_DEPENDENCIES) 
 @NATIVE_LINKER_FALSE@	@rm -f ifuncmain5picstatic$(EXEEXT)
 @NATIVE_LINKER_FALSE@	$(LINK) $(ifuncmain5picstatic_OBJECTS) $(ifuncmain5picstatic_LDADD) $(LIBS)
@@ -2672,9 +2669,6 @@
 @IFUNC_FALSE@ifuncmain7picstatic$(EXEEXT): $(ifuncmain7picstatic_OBJECTS) $(ifuncmain7picstatic_DEPENDENCIES) 
 @IFUNC_FALSE@	@rm -f ifuncmain7picstatic$(EXEEXT)
 @IFUNC_FALSE@	$(LINK) $(ifuncmain7picstatic_OBJECTS) $(ifuncmain7picstatic_LDADD) $(LIBS)
-@IFUNC_STATIC_FALSE@ifuncmain7picstatic$(EXEEXT): $(ifuncmain7picstatic_OBJECTS) $(ifuncmain7picstatic_DEPENDENCIES) 
-@IFUNC_STATIC_FALSE@	@rm -f ifuncmain7picstatic$(EXEEXT)
-@IFUNC_STATIC_FALSE@	$(LINK) $(ifuncmain7picstatic_OBJECTS) $(ifuncmain7picstatic_LDADD) $(LIBS)
 @NATIVE_LINKER_FALSE@ifuncmain7picstatic$(EXEEXT): $(ifuncmain7picstatic_OBJECTS) $(ifuncmain7picstatic_DEPENDENCIES) 
 @NATIVE_LINKER_FALSE@	@rm -f ifuncmain7picstatic$(EXEEXT)
 @NATIVE_LINKER_FALSE@	$(LINK) $(ifuncmain7picstatic_OBJECTS) $(ifuncmain7picstatic_LDADD) $(LIBS)
@@ -2690,18 +2684,6 @@
 ifuncmain7static$(EXEEXT): $(ifuncmain7static_OBJECTS) $(ifuncmain7static_DEPENDENCIES) 
 	@rm -f ifuncmain7static$(EXEEXT)
 	$(ifuncmain7static_LINK) $(ifuncmain7static_OBJECTS) $(ifuncmain7static_LDADD) $(LIBS)
-ifuncvar$(EXEEXT): $(ifuncvar_OBJECTS) $(ifuncvar_DEPENDENCIES) 
-	@rm -f ifuncvar$(EXEEXT)
-	$(ifuncvar_LINK) $(ifuncvar_OBJECTS) $(ifuncvar_LDADD) $(LIBS)
-@DEFAULT_TARGET_X86_64_FALSE@incremental_comdat_test_1$(EXEEXT): $(incremental_comdat_test_1_OBJECTS) $(incremental_comdat_test_1_DEPENDENCIES) 
-@DEFAULT_TARGET_X86_64_FALSE@	@rm -f incremental_comdat_test_1$(EXEEXT)
-@DEFAULT_TARGET_X86_64_FALSE@	$(LINK) $(incremental_comdat_test_1_OBJECTS) $(incremental_comdat_test_1_LDADD) $(LIBS)
-@GCC_FALSE@incremental_comdat_test_1$(EXEEXT): $(incremental_comdat_test_1_OBJECTS) $(incremental_comdat_test_1_DEPENDENCIES) 
-@GCC_FALSE@	@rm -f incremental_comdat_test_1$(EXEEXT)
-@GCC_FALSE@	$(LINK) $(incremental_comdat_test_1_OBJECTS) $(incremental_comdat_test_1_LDADD) $(LIBS)
-@NATIVE_LINKER_FALSE@incremental_comdat_test_1$(EXEEXT): $(incremental_comdat_test_1_OBJECTS) $(incremental_comdat_test_1_DEPENDENCIES) 
-@NATIVE_LINKER_FALSE@	@rm -f incremental_comdat_test_1$(EXEEXT)
-@NATIVE_LINKER_FALSE@	$(LINK) $(incremental_comdat_test_1_OBJECTS) $(incremental_comdat_test_1_LDADD) $(LIBS)
 @DEFAULT_TARGET_X86_64_FALSE@incremental_common_test_1$(EXEEXT): $(incremental_common_test_1_OBJECTS) $(incremental_common_test_1_DEPENDENCIES) 
 @DEFAULT_TARGET_X86_64_FALSE@	@rm -f incremental_common_test_1$(EXEEXT)
 @DEFAULT_TARGET_X86_64_FALSE@	$(LINK) $(incremental_common_test_1_OBJECTS) $(incremental_common_test_1_LDADD) $(LIBS)
@@ -3135,8 +3117,6 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ifuncmain7pic.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ifuncmain7picstatic.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ifuncmain7pie.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ifuncvar3.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/incremental_comdat_test_1.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/incremental_common_test_1.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/incremental_copy_test.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/incremental_test_2.Po@am__quote@
@@ -3519,8 +3499,6 @@
 	@p='plugin_test_6.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
 plugin_test_7.sh.log: plugin_test_7.sh
 	@p='plugin_test_7.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
-plugin_final_layout.sh.log: plugin_final_layout.sh
-	@p='plugin_final_layout.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
 exclude_libs_test.sh.log: exclude_libs_test.sh
 	@p='exclude_libs_test.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
 discard_locals_test.sh.log: discard_locals_test.sh
@@ -3537,10 +3515,6 @@
 	@p='dyn_weak_ref.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
 memory_test.sh.log: memory_test.sh
 	@p='memory_test.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
-gdb_index_test_1.sh.log: gdb_index_test_1.sh
-	@p='gdb_index_test_1.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
-gdb_index_test_2.sh.log: gdb_index_test_2.sh
-	@p='gdb_index_test_2.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
 script_test_10.sh.log: script_test_10.sh
 	@p='script_test_10.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
 split_i386.sh.log: split_i386.sh
@@ -3821,8 +3795,6 @@
 	@p='ifuncmain7pic$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
 ifuncmain7pie.log: ifuncmain7pie$(EXEEXT)
 	@p='ifuncmain7pie$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
-ifuncvar.log: ifuncvar$(EXEEXT)
-	@p='ifuncvar$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
 start_lib_test.log: start_lib_test$(EXEEXT)
 	@p='start_lib_test$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
 incremental_test_2.log: incremental_test_2$(EXEEXT)
@@ -3839,8 +3811,6 @@
 	@p='incremental_copy_test$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
 incremental_common_test_1.log: incremental_common_test_1$(EXEEXT)
 	@p='incremental_common_test_1$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
-incremental_comdat_test_1.log: incremental_comdat_test_1$(EXEEXT)
-	@p='incremental_comdat_test_1$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
 .test.log:
 	@p='$<'; $(am__check_pre) $(TEST_LOG_COMPILE) "$$tst" $(am__check_post)
 @am__EXEEXT_TRUE@.test$(EXEEXT).log:
@@ -4586,17 +4556,6 @@
 @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@	$(COMPILE) -c -o $@ $<
 @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@unused.c:
 @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@	@cp /dev/null $@
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_final_layout.o: plugin_final_layout.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@	$(CXXCOMPILE) -O0 -c -ffunction-sections  -fdata-sections -g -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_final_layout: plugin_final_layout.o plugin_section_order.so gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@	$(CXXLINK) -Bgcctestdir/ -Wl,--plugin,"./plugin_section_order.so" plugin_final_layout.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_final_layout.stdout: plugin_final_layout
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@	$(TEST_NM) -n plugin_final_layout > plugin_final_layout.stdout
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_section_order.so: plugin_section_order.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@	$(LINK) -Bgcctestdir/ -shared plugin_section_order.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_section_order.o: plugin_section_order.c
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@	$(COMPILE) -O0 -c -fpic -o $@ $<
 @GCC_TRUE@@NATIVE_LINKER_TRUE@exclude_libs_test.syms: exclude_libs_test
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	$(TEST_READELF) -sW $< >$@ 2>/dev/null
 @GCC_TRUE@@NATIVE_LINKER_TRUE@libexclude_libs_test_1.a: exclude_libs_test_1.o
@@ -4677,8 +4636,8 @@
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	$(COMPILE) -c -fpic -o $@ $<
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain1pie.o: ifuncmain1.c
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	$(COMPILE) -c -fpie -o $@ $<
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain1picstatic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	$(LINK) -Bgcctestdir/ -static ifuncmain1pic.o ifuncmod1.o
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain1picstatic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	$(LINK) -Bgcctestdir/ -static ifuncmain1pic.o ifuncmod1.o
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain1pic: ifuncmain1pic.o ifuncmod1.so gcctestdir/ld
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	$(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.so -Wl,-R,.
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain1vispic.o: ifuncmain1vis.c
@@ -4701,8 +4660,8 @@
 
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncdep2pic.o: ifuncdep2.c
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	$(COMPILE) -c -fpic -o $@ $<
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain2picstatic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	$(LINK) -Bgcctestdir/ -static ifuncmain2pic.o ifuncdep2pic.o
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain2picstatic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	$(LINK) -Bgcctestdir/ -static ifuncmain2pic.o ifuncdep2pic.o
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain2pic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	$(LINK) -Bgcctestdir/ ifuncmain2pic.o ifuncdep2pic.o
 
@@ -4713,8 +4672,8 @@
 
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain4pic.o: ifuncmain4.c
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	$(COMPILE) -c -fpic -o $@ $<
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain4picstatic: ifuncmain4pic.o gcctestdir/ld
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	$(LINK) -Bgcctestdir/ -static ifuncmain4pic.o
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain4picstatic: ifuncmain4pic.o gcctestdir/ld
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	$(LINK) -Bgcctestdir/ -static ifuncmain4pic.o
 
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain5pic.o: ifuncmain5.c
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	$(COMPILE) -c -fpic -o $@ $<
@@ -4729,8 +4688,8 @@
 
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncdep5.o: ifuncmod5.c
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	$(COMPILE) -c -o $@ $<
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain5picstatic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	$(LINK) -Bgcctestdir/ -static ifuncmain5pic.o ifuncmod5.o
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain5picstatic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	$(LINK) -Bgcctestdir/ -static ifuncmain5pic.o ifuncmod5.o
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain5pic: ifuncmain5pic.o ifuncmod5.so gcctestdir/ld
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	$(LINK) -Bgcctestdir/ ifuncmain5pic.o ifuncmod5.so -Wl,-R,.
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain5staticpic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld
@@ -4753,18 +4712,12 @@
 
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain7pie.o: ifuncmain7.c
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	$(COMPILE) -c -fpie -o $@ $<
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain7picstatic: ifuncmain7pic.o gcctestdir/ld
-@GCC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	$(LINK) -Bgcctestdir/ -static ifuncmain7pic.o
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain7picstatic: ifuncmain7pic.o gcctestdir/ld
+@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	$(LINK) -Bgcctestdir/ -static ifuncmain7pic.o
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain7pic: ifuncmain7pic.o gcctestdir/ld
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	$(LINK) -Bgcctestdir/ ifuncmain7pic.o
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain7pie: ifuncmain7pie.o gcctestdir/ld
 @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	$(LINK) -Bgcctestdir/ -pie ifuncmain7pie.o
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncvar1_pic.o: ifuncvar1.c
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	$(COMPILE) -c -fpic -o $@ $<
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncvar2_pic.o: ifuncvar2.c	
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	$(COMPILE) -c -fpic -o $@ $<
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncvar.so: ifuncvar1_pic.o ifuncvar2_pic.o gcctestdir/ld
-@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@	$(LINK) -Bgcctestdir/ -shared ifuncvar1_pic.o ifuncvar2_pic.o
 @GCC_TRUE@@NATIVE_LINKER_TRUE@strong_ref_weak_def_2.o: strong_ref_weak_def_2.c
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	$(COMPILE) -o $@ -c -fPIC $<
 @GCC_TRUE@@NATIVE_LINKER_TRUE@strong_ref_weak_def_2.so: strong_ref_weak_def_2.o gcctestdir/ld
@@ -4801,50 +4754,24 @@
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	$(LINK) -Bgcctestdir/ -nostartfiles -nostdlib -T $(srcdir)/memory_test.t -o $@ memory_test.o
 @GCC_TRUE@@NATIVE_LINKER_TRUE@memory_test.stdout: memory_test
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	$(TEST_READELF) -lWS  $< > $@
-@GCC_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test.o: gdb_index_test.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXCOMPILE) -O0 -g -c -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_1: gdb_index_test.o gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_1.stdout: gdb_index_test_1
-@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(TEST_READELF) --debug-dump=gdb_index $< > $@
-@GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_cdebug.o: gdb_index_test.cc
-@GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@	$(CXXCOMPILE) -O0 -g -Wa,--compress-debug-sections -c -o $@ $<
-@GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_2: gdb_index_test_cdebug.o gcctestdir/ld
-@GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $<
-@GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_2.stdout: gdb_index_test_2
-@GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@	$(TEST_READELF) --debug-dump=gdb_index $< > $@
-
-# End-to-end incremental linking tests.
-# Incremental linking is currently supported only on the x86_64 target.
-
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_test_1_v1_ndebug.o: two_file_test_1_v1.cc
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXCOMPILE) -O0 -g0 -c -o $@ $<
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_test_1_ndebug.o: two_file_test_1.cc
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXCOMPILE) -O0 -g0 -c -o $@ $<
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_test_1b_ndebug.o: two_file_test_1b.cc
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXCOMPILE) -O0 -g0 -c -o $@ $<
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_test_2_ndebug.o: two_file_test_2.cc
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXCOMPILE) -O0 -g0 -c -o $@ $<
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_test_main_ndebug.o: two_file_test_main.cc
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXCOMPILE) -O0 -g0 -c -o $@ $<
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@incremental_test_2: two_file_test_1_v1_ndebug.o two_file_test_1_ndebug.o two_file_test_1b_ndebug.o \
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@		    two_file_test_2_ndebug.o two_file_test_main_ndebug.o gcctestdir/ld
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	cp -f two_file_test_1_v1_ndebug.o two_file_test_tmp_2.o
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ two_file_test_tmp_2.o two_file_test_1b_ndebug.o two_file_test_2_ndebug.o two_file_test_main_ndebug.o
+@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@incremental_test_2: two_file_test_1_v1.o two_file_test_1.o two_file_test_1b.o \
+@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@		    two_file_test_2.o two_file_test_main.o gcctestdir/ld
+@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	cp -f two_file_test_1_v1.o two_file_test_tmp_2.o
+@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ two_file_test_tmp_2.o two_file_test_1b.o two_file_test_2.o two_file_test_main.o
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	@sleep 1
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	cp -f two_file_test_1_ndebug.o two_file_test_tmp_2.o
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ two_file_test_tmp_2.o two_file_test_1b_ndebug.o two_file_test_2_ndebug.o two_file_test_main_ndebug.o
+@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	cp -f two_file_test_1.o two_file_test_tmp_2.o
+@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ two_file_test_tmp_2.o two_file_test_1b.o two_file_test_2.o two_file_test_main.o
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@incremental_test_3: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@		    two_file_test_2.o two_file_test_main.o gcctestdir/ld
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	cp -f two_file_test_1b_v1.o two_file_test_tmp_3.o
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ two_file_test_1.o two_file_test_tmp_3.o two_file_test_2.o two_file_test_main.o
+@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Wl,--incremental-full -Bgcctestdir/ two_file_test_1.o two_file_test_tmp_3.o two_file_test_2.o two_file_test_main.o
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	@sleep 1
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	cp -f two_file_test_1b.o two_file_test_tmp_3.o
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ two_file_test_1.o two_file_test_tmp_3.o two_file_test_2.o two_file_test_main.o
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@incremental_test_4: two_file_test_1.o two_file_test_1b.o two_file_test_2_v1.o \
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@		    two_file_test_2.o two_file_test_main.o gcctestdir/ld
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	cp -f two_file_test_2_v1.o two_file_test_tmp_4.o
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ two_file_test_1.o two_file_test_1b.o two_file_test_tmp_4.o two_file_test_main.o
+@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Wl,--incremental-full -Bgcctestdir/ two_file_test_1.o two_file_test_1b.o two_file_test_tmp_4.o two_file_test_main.o
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	mv -f incremental_test_4 incremental_test_4.base
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	@sleep 1
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	cp -f two_file_test_2.o two_file_test_tmp_4.o
@@ -4853,7 +4780,7 @@
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@		    two_file_test_2.o two_file_test_main.o gcctestdir/ld
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	cp -f two_file_test_1b_v1.o two_file_test_tmp_5.o
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(TEST_AR) rc two_file_test_5.a two_file_test_1.o two_file_test_tmp_5.o two_file_test_2.o
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ two_file_test_main.o two_file_test_5.a
+@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Wl,--incremental-full -Bgcctestdir/ two_file_test_main.o two_file_test_5.a
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	@sleep 1
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	cp -f two_file_test_1b.o two_file_test_tmp_5.o
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(TEST_AR) rc two_file_test_5.a two_file_test_1.o two_file_test_tmp_5.o two_file_test_2.o
@@ -4862,32 +4789,23 @@
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@		    two_file_test_2.o two_file_test_main.o gcctestdir/ld
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	cp -f two_file_test_1b.o two_file_test_tmp_6.o
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(TEST_AR) rc two_file_test_6.a two_file_test_1.o two_file_test_tmp_6.o two_file_test_2.o
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ two_file_test_main.o two_file_test_6.a
+@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Wl,--incremental-full -Bgcctestdir/ two_file_test_main.o two_file_test_6.a
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	@sleep 1
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	cp -f two_file_test_1b_v1.o two_file_test_tmp_6.o
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(TEST_AR) rc two_file_test_6.a two_file_test_1.o two_file_test_tmp_6.o two_file_test_2.o
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ two_file_test_main.o -Wl,--incremental-unchanged two_file_test_6.a -Wl,--incremental-unknown
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@incremental_copy_test: copy_test_v1.o copy_test.o copy_test_1.so copy_test_2.so
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	cp -f copy_test_v1.o copy_test_tmp.o
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ -Wl,-R,. copy_test_tmp.o copy_test_1.so copy_test_2.so
+@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Wl,--incremental-full -Bgcctestdir/ -Wl,-R,. copy_test_tmp.o copy_test_1.so copy_test_2.so
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	@sleep 1
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	cp -f copy_test.o copy_test_tmp.o
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ -Wl,-R,. copy_test_tmp.o copy_test_1.so copy_test_2.so
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@incremental_common_test_1: common_test_1_v1.o common_test_1_v2.o gcctestdir/ld
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	cp -f common_test_1_v1.o common_test_1_tmp.o
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ common_test_1_tmp.o
+@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Wl,--incremental-full -Bgcctestdir/ common_test_1_tmp.o
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	@sleep 1
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	cp -f common_test_1_v2.o common_test_1_tmp.o
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ common_test_1_tmp.o
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@incremental_comdat_test_1: incr_comdat_test_1.o incr_comdat_test_2_v1.o incr_comdat_test_2_v2.o incr_comdat_test_2_v3.o gcctestdir/ld
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	cp -f incr_comdat_test_2_v1.o incr_comdat_test_1_tmp.o
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	@sleep 1
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	cp -f incr_comdat_test_2_v2.o incr_comdat_test_1_tmp.o
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	@sleep 1
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	cp -f incr_comdat_test_2_v3.o incr_comdat_test_1_tmp.o
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o
 @NATIVE_OR_CROSS_LINKER_TRUE@script_test_10.o: script_test_10.s
 @NATIVE_OR_CROSS_LINKER_TRUE@	$(TEST_AS) -o $@ $<
 @NATIVE_OR_CROSS_LINKER_TRUE@script_test_10: $(srcdir)/script_test_10.t script_test_10.o gcctestdir/ld
diff --git a/binutils/binutils-2.21/gold/testsuite/gdb_index_test.cc b/binutils/binutils-2.21/gold/testsuite/gdb_index_test.cc
deleted file mode 100644
index c67ac7b..0000000
--- a/binutils/binutils-2.21/gold/testsuite/gdb_index_test.cc
+++ /dev/null
@@ -1,138 +0,0 @@
-// gdb_index_test.cc -- a test case for the --gdb-index option.
-
-// Copyright 2011 Free Software Foundation, Inc.
-// Written by Cary Coutant <ccoutant@google.com>.
-
-// This file is part of gold.
-
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 of the License, or
-// (at your option) any later version.
-
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
-// MA 02110-1301, USA.
-
-// This source file defines a number of symbols of different forms
-// to exercise the DWARF scanner in gold.
-
-namespace
-{
-int c1_count;
-int c2_count;
-};
-
-namespace one
-{
-
-enum G
-{
-  G_A,
-  G_B,
-  G_C
-};
-
-class c1
-{
- public:
-  static int count;
-
-  c1()
-  { ++c1_count; }
-
-  ~c1()
-  {
-    --c1_count;
-  }
-
-  enum E
-  {
-    E_A,
-    E_B,
-    E_C,
-  };
-
-  int
-  val()
-  { return E_A; }
-};
-
-c1 c1v;
-};
-
-namespace two
-{
-const int ci = 3;
-
-template <typename T>
-class c2
-{
- public:
-  c2(T t)
-    : t_(t)
-  {
-    ++c2_count;
-  }
-
-  ~c2()
-  { --c2_count; }
-
-  T
-  val()
-  { return this->t_; }
-
-  T t_;
-};
-
-c2<int> c2v1(1);
-c2<double> c2v2(2.0);
-c2<int const*> c2v3(&ci);
-};
-
-enum F
-{
-  F_A,
-  F_B,
-  F_C
-};
-
-template <class C>
-bool
-check(C* c)
-{ return c->val() == 0; }
-
-bool
-check_enum(int i)
-{ return i > 0; }
-
-struct anonymous_union_container {
-  union {
-    struct astruct {
-      int a;
-    };
-    int b;
-  } u;
-};
-
-anonymous_union_container anonymous_union_var;
-
-int
-main()
-{
-  F f = F_A;
-  one::G g = one::G_A;
-  check_enum(f);
-  check_enum(g);
-  check(&one::c1v);
-  check(&two::c2v1);
-  check(&two::c2v2);
-  check(&two::c2v3);
-  return anonymous_union_var.u.b;
-}
diff --git a/binutils/binutils-2.21/gold/testsuite/gdb_index_test_1.sh b/binutils/binutils-2.21/gold/testsuite/gdb_index_test_1.sh
deleted file mode 100755
index f4c0c1a..0000000
--- a/binutils/binutils-2.21/gold/testsuite/gdb_index_test_1.sh
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/bin/sh
-
-# gdb_index_test_1.sh -- a test case for the --gdb-index option.
-
-# Copyright 2011 Free Software Foundation, Inc.
-# Written by Cary Coutant <ccoutant@google.com>.
-
-# This file is part of gold.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
-# MA 02110-1301, USA.
-
-check()
-{
-    if ! grep -q "$2" "$1"
-    then
-	echo "Did not find expected output:"
-	echo "   $2"
-	echo ""
-	echo "Actual error output below:"
-	cat "$1"
-	exit 1
-    fi
-}
-
-STDOUT=gdb_index_test_1.stdout
-
-check $STDOUT "^Version [45]"
-
-# Look for the symbols we know should be in the symbol table.
-
-check $STDOUT "^\[ *[0-9]*\] (anonymous namespace): "
-check $STDOUT "^\[ *[0-9]*\] (anonymous namespace)::c1_count: "
-check $STDOUT "^\[ *[0-9]*\] (anonymous namespace)::c2_count: "
-check $STDOUT "^\[ *[0-9]*\] bool: "
-check $STDOUT "^\[ *[0-9]*\] check<one::c1>: "
-check $STDOUT "^\[ *[0-9]*\] check<two::c2<double> >: "
-check $STDOUT "^\[ *[0-9]*\] check<two::c2<int> >: "
-# check $STDOUT "^\[ *[0-9]*\] check<two::c2<int const\*> >: "
-check $STDOUT "^\[ *[0-9]*\] double: "
-check $STDOUT "^\[ *[0-9]*\] F_A: "
-check $STDOUT "^\[ *[0-9]*\] F_B: "
-check $STDOUT "^\[ *[0-9]*\] F_C: "
-check $STDOUT "^\[ *[0-9]*\] int: "
-check $STDOUT "^\[ *[0-9]*\] main: "
-check $STDOUT "^\[ *[0-9]*\] one: "
-check $STDOUT "^\[ *[0-9]*\] one::c1: "
-check $STDOUT "^\[ *[0-9]*\] one::c1::~c1: "
-check $STDOUT "^\[ *[0-9]*\] one::c1::c1: "
-check $STDOUT "^\[ *[0-9]*\] one::c1::val: "
-check $STDOUT "^\[ *[0-9]*\] one::c1v: "
-check $STDOUT "^\[ *[0-9]*\] one::G_A: "
-check $STDOUT "^\[ *[0-9]*\] one::G_B: "
-check $STDOUT "^\[ *[0-9]*\] one::G_B: "
-check $STDOUT "^\[ *[0-9]*\] two: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<double>::~c2: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<double>::c2: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<double>::val: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<double>: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<int const\*>: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<int const\*>::~c2: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<int const\*>::c2: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<int const\*>::val: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<int>::~c2: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<int>::c2: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<int>::val: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<int>: "
-check $STDOUT "^\[ *[0-9]*\] two::c2v1: "
-check $STDOUT "^\[ *[0-9]*\] two::c2v2: "
-check $STDOUT "^\[ *[0-9]*\] anonymous_union_var: "
-
-exit 0
diff --git a/binutils/binutils-2.21/gold/testsuite/gdb_index_test_2.sh b/binutils/binutils-2.21/gold/testsuite/gdb_index_test_2.sh
deleted file mode 100755
index 90a3357..0000000
--- a/binutils/binutils-2.21/gold/testsuite/gdb_index_test_2.sh
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/bin/sh
-
-# gdb_index_test_2.sh -- a test case for the --gdb-index option.
-
-# Copyright 2011 Free Software Foundation, Inc.
-# Written by Cary Coutant <ccoutant@google.com>.
-
-# This file is part of gold.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
-# MA 02110-1301, USA.
-
-check()
-{
-    if ! grep -q "$2" "$1"
-    then
-	echo "Did not find expected output:"
-	echo "   $2"
-	echo ""
-	echo "Actual error output below:"
-	cat "$1"
-	exit 1
-    fi
-}
-
-STDOUT=gdb_index_test_2.stdout
-
-check $STDOUT "^Version [45]"
-
-# Look for the symbols we know should be in the symbol table.
-
-check $STDOUT "^\[ *[0-9]*\] (anonymous namespace): "
-check $STDOUT "^\[ *[0-9]*\] (anonymous namespace)::c1_count: "
-check $STDOUT "^\[ *[0-9]*\] (anonymous namespace)::c2_count: "
-check $STDOUT "^\[ *[0-9]*\] bool: "
-check $STDOUT "^\[ *[0-9]*\] check<one::c1>: "
-check $STDOUT "^\[ *[0-9]*\] check<two::c2<double> >: "
-check $STDOUT "^\[ *[0-9]*\] check<two::c2<int> >: "
-# check $STDOUT "^\[ *[0-9]*\] check<two::c2<int const\*> >: "
-check $STDOUT "^\[ *[0-9]*\] double: "
-check $STDOUT "^\[ *[0-9]*\] F_A: "
-check $STDOUT "^\[ *[0-9]*\] F_B: "
-check $STDOUT "^\[ *[0-9]*\] F_C: "
-check $STDOUT "^\[ *[0-9]*\] int: "
-check $STDOUT "^\[ *[0-9]*\] main: "
-check $STDOUT "^\[ *[0-9]*\] one: "
-check $STDOUT "^\[ *[0-9]*\] one::c1: "
-check $STDOUT "^\[ *[0-9]*\] one::c1::~c1: "
-check $STDOUT "^\[ *[0-9]*\] one::c1::c1: "
-check $STDOUT "^\[ *[0-9]*\] one::c1::val: "
-check $STDOUT "^\[ *[0-9]*\] one::c1v: "
-check $STDOUT "^\[ *[0-9]*\] one::G_A: "
-check $STDOUT "^\[ *[0-9]*\] one::G_B: "
-check $STDOUT "^\[ *[0-9]*\] one::G_B: "
-check $STDOUT "^\[ *[0-9]*\] two: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<double>::~c2: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<double>::c2: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<double>::val: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<double>: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<int const\*>: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<int const\*>::~c2: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<int const\*>::c2: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<int const\*>::val: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<int>::~c2: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<int>::c2: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<int>::val: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<int>: "
-check $STDOUT "^\[ *[0-9]*\] two::c2v1: "
-check $STDOUT "^\[ *[0-9]*\] two::c2v2: "
-check $STDOUT "^\[ *[0-9]*\] anonymous_union_var: "
-
-exit 0
diff --git a/binutils/binutils-2.21/gold/testsuite/ifuncvar1.c b/binutils/binutils-2.21/gold/testsuite/ifuncvar1.c
deleted file mode 100644
index 75af2a6..0000000
--- a/binutils/binutils-2.21/gold/testsuite/ifuncvar1.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Test global variable initialized to hidden STT_GNU_IFUNC symbol.  */
-
-int didit;
-
-extern void doit (void);
-
-void
-doit (void)
-{
-  didit = 1;
-}
-
-void (*get_foo (void)) (void) __asm__ ("foo");
-__asm__ (".type foo, %gnu_indirect_function");
-__asm__ (".hidden foo");
-
-void (*get_foo (void)) (void)
-{
-  return &doit;
-}
diff --git a/binutils/binutils-2.21/gold/testsuite/ifuncvar2.c b/binutils/binutils-2.21/gold/testsuite/ifuncvar2.c
deleted file mode 100644
index f09de0e..0000000
--- a/binutils/binutils-2.21/gold/testsuite/ifuncvar2.c
+++ /dev/null
@@ -1,12 +0,0 @@
-/* Test global variable initialized to hidden STT_GNU_IFUNC symbol.  */
-
-extern void foo (void);
-void (*f) (void) = &foo;
-
-extern void bar (void);
-
-void
-bar (void)
-{
-  f ();
-}
diff --git a/binutils/binutils-2.21/gold/testsuite/ifuncvar3.c b/binutils/binutils-2.21/gold/testsuite/ifuncvar3.c
deleted file mode 100644
index e078b56..0000000
--- a/binutils/binutils-2.21/gold/testsuite/ifuncvar3.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Test global variable initialized to hidden STT_GNU_IFUNC symbol.  */
-
-#include <assert.h>
-
-extern void bar (void);
-extern int didit;
-
-int
-main (void)
-{
-  bar ();
-  assert (didit == 1);
-  return 0;
-}
diff --git a/binutils/binutils-2.21/gold/testsuite/incr_comdat_test_1.cc b/binutils/binutils-2.21/gold/testsuite/incr_comdat_test_1.cc
deleted file mode 100644
index 7a232c2..0000000
--- a/binutils/binutils-2.21/gold/testsuite/incr_comdat_test_1.cc
+++ /dev/null
@@ -1,68 +0,0 @@
-// incr_comdat_test_1.cc -- test incremental update with comdat sections
-
-// Copyright 2011 Free Software Foundation, Inc.
-// Written by Cary Coutant <ccoutant@google.com>.
-
-// This file is part of gold.
-
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 of the License, or
-// (at your option) any later version.
-
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
-// MA 02110-1301, USA.
-
-#include <cstdio>
-
-template <class T>
-T GetMax(T a, T b)
-{
-  return a > b ? a : b;
-}
-
-extern int foo();
-
-int bar()
-{
-  return GetMax<int>(4, 5);
-}
-
-class A
-{
- public:
-  int sum(int k)
-  { 
-    static int total = 0;
-    total += k;
-    return total;
-  }
-};
-
-#define CHECK_EQ(var, expected)						\
-  do									\
-    {									\
-      if ((var) != (expected))						\
-	{								\
-	  printf(#var ": expected %d, found %d\n", expected, var);	\
-	  return 1;							\
-	}								\
-    }									\
-  while (0)
-
-int main()
-{
-  A a;
-  CHECK_EQ(bar(), 5);
-  CHECK_EQ(foo(), 11);
-  CHECK_EQ(a.sum(55), 11 + 55);
-  CHECK_EQ(a.sum(66), 11 + 55 + 66);
-  return 0;
-}
diff --git a/binutils/binutils-2.21/gold/testsuite/incr_comdat_test_2_v1.cc b/binutils/binutils-2.21/gold/testsuite/incr_comdat_test_2_v1.cc
deleted file mode 100644
index f7d6a8c..0000000
--- a/binutils/binutils-2.21/gold/testsuite/incr_comdat_test_2_v1.cc
+++ /dev/null
@@ -1,44 +0,0 @@
-// incr_comdat_test_2.cc -- test incremental update with comdat sections
-
-// Copyright 2011 Free Software Foundation, Inc.
-// Written by Cary Coutant <ccoutant@google.com>.
-
-// This file is part of gold.
-
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 of the License, or
-// (at your option) any later version.
-
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
-// MA 02110-1301, USA.
-
-template <class T>
-T GetMax(T a, T b)
-{
-  return a > b ? a : b;
-}
-
-class A
-{
- public:
-  int sum(int k)
-  { 
-    static int total = 0;
-    total += k;
-    return total;
-  }
-};
-
-int foo()
-{
-  A a;
-  return GetMax<int>(10, a.sum(8));
-}
diff --git a/binutils/binutils-2.21/gold/testsuite/incr_comdat_test_2_v2.cc b/binutils/binutils-2.21/gold/testsuite/incr_comdat_test_2_v2.cc
deleted file mode 100644
index fca7fda..0000000
--- a/binutils/binutils-2.21/gold/testsuite/incr_comdat_test_2_v2.cc
+++ /dev/null
@@ -1,44 +0,0 @@
-// incr_comdat_test_2.cc -- test incremental update with comdat sections
-
-// Copyright 2011 Free Software Foundation, Inc.
-// Written by Cary Coutant <ccoutant@google.com>.
-
-// This file is part of gold.
-
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 of the License, or
-// (at your option) any later version.
-
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
-// MA 02110-1301, USA.
-
-template <class T>
-T GetMax(T a, T b)
-{
-  return a > b ? a : b;
-}
-
-class A
-{
- public:
-  int sum(int k)
-  { 
-    static int total = 0;
-    total += k;
-    return total;
-  }
-};
-
-int foo()
-{
-  A a;
-  return GetMax<int>(10, a.sum(9));
-}
diff --git a/binutils/binutils-2.21/gold/testsuite/incr_comdat_test_2_v3.cc b/binutils/binutils-2.21/gold/testsuite/incr_comdat_test_2_v3.cc
deleted file mode 100644
index cbb83c1..0000000
--- a/binutils/binutils-2.21/gold/testsuite/incr_comdat_test_2_v3.cc
+++ /dev/null
@@ -1,44 +0,0 @@
-// incr_comdat_test_2.cc -- test incremental update with comdat sections
-
-// Copyright 2011 Free Software Foundation, Inc.
-// Written by Cary Coutant <ccoutant@google.com>.
-
-// This file is part of gold.
-
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 of the License, or
-// (at your option) any later version.
-
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
-// MA 02110-1301, USA.
-
-template <class T>
-T GetMax(T a, T b)
-{
-  return a > b ? a : b;
-}
-
-class A
-{
- public:
-  int sum(int k)
-  { 
-    static int total = 0;
-    total += k;
-    return total;
-  }
-};
-
-int foo()
-{
-  A a;
-  return GetMax<int>(10, a.sum(11));
-}
diff --git a/binutils/binutils-2.21/gold/testsuite/plugin_final_layout.cc b/binutils/binutils-2.21/gold/testsuite/plugin_final_layout.cc
deleted file mode 100644
index 3e264f6..0000000
--- a/binutils/binutils-2.21/gold/testsuite/plugin_final_layout.cc
+++ /dev/null
@@ -1,41 +0,0 @@
-// plugin_final_layout.cc -- a test case for gold
-
-// Copyright 2011 Free Software Foundation, Inc.
-// Written by Sriraman Tallam <tmsriram@google.com>.
-
-// This file is part of gold.
-
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 of the License, or
-// (at your option) any later version.
-
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
-// MA 02110-1301, USA.
-
-// The goal of this program is to verify if section ordering
-// via plugins happens correctly.
-
-void bar ()
-{
-}
-
-void baz ()
-{
-}
-
-void foo ()
-{
-}
-
-int main ()
-{
-  return 0;
-}
diff --git a/binutils/binutils-2.21/gold/testsuite/plugin_final_layout.sh b/binutils/binutils-2.21/gold/testsuite/plugin_final_layout.sh
deleted file mode 100755
index 600f8e2..0000000
--- a/binutils/binutils-2.21/gold/testsuite/plugin_final_layout.sh
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/bin/sh
-
-# plugin_final_layout.sh -- test
-
-# Copyright 2011 Free Software Foundation, Inc.
-# Written by Sriraman Tallam <tmsriram@google.com>.
-
-# This file is part of gold.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
-# MA 02110-1301, USA.
-
-# The goal of this program is to verify if --section-ordering-file works as
-# intended.  File final_layout.cc is in this test.
-
-
-set -e
-
-check()
-{
-    awk "
-BEGIN { saw1 = 0; saw2 = 0; err = 0; }
-/.*$2\$/ { saw1 = 1; }
-/.*$3\$/ {
-     saw2 = 1;
-     if (!saw1)
-       {
-	  printf \"layout of $2 and $3 is not right\\n\";
-	  err = 1;
-	  exit 1;
-       }
-    }
-END {
-      if (!saw1 && !err)
-        {
-	  printf \"did not see $2\\n\";
-	  exit 1;
-	}
-      if (!saw2 && !err)
-	{
-	  printf \"did not see $3\\n\";
-	  exit 1;
-	}
-    }" $1
-}
-
-check plugin_final_layout.stdout "_Z3foov" "_Z3barv"
-check plugin_final_layout.stdout "_Z3barv" "_Z3bazv"
diff --git a/binutils/binutils-2.21/gold/testsuite/plugin_section_order.c b/binutils/binutils-2.21/gold/testsuite/plugin_section_order.c
deleted file mode 100644
index b1c294d..0000000
--- a/binutils/binutils-2.21/gold/testsuite/plugin_section_order.c
+++ /dev/null
@@ -1,166 +0,0 @@
-/* plugin_section_reorder.c -- Simple plugin to reorder function sections
-
-   Copyright 2011 Free Software Foundation, Inc.
-   Written by Sriraman Tallam <tmsriram@google.com>.
-
-   This file is part of gold.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
-   MA 02110-1301, USA.  */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include "plugin-api.h"
-
-static ld_plugin_get_input_section_count get_input_section_count = NULL;
-static ld_plugin_get_input_section_type get_input_section_type = NULL;
-static ld_plugin_get_input_section_name get_input_section_name = NULL;
-static ld_plugin_get_input_section_contents get_input_section_contents = NULL;
-static ld_plugin_update_section_order update_section_order = NULL;
-static ld_plugin_allow_section_ordering allow_section_ordering = NULL;
-
-enum ld_plugin_status onload(struct ld_plugin_tv *tv);
-enum ld_plugin_status claim_file_hook(const struct ld_plugin_input_file *file,
-                                      int *claimed);
-enum ld_plugin_status all_symbols_read_hook(void);
-
-/* Plugin entry point.  */
-enum ld_plugin_status
-onload(struct ld_plugin_tv *tv)
-{
-  struct ld_plugin_tv *entry;
-  for (entry = tv; entry->tv_tag != LDPT_NULL; ++entry)
-    {
-      switch (entry->tv_tag)
-        {
-        case LDPT_REGISTER_CLAIM_FILE_HOOK:
-          assert((*entry->tv_u.tv_register_claim_file) (claim_file_hook) == LDPS_OK);
-          break;
-	case LDPT_REGISTER_ALL_SYMBOLS_READ_HOOK:
-          assert((*entry->tv_u.tv_register_all_symbols_read) (all_symbols_read_hook)
-		  == LDPS_OK);
-          break;
-        case LDPT_GET_INPUT_SECTION_COUNT:
-          get_input_section_count = *entry->tv_u.tv_get_input_section_count;
-          break;
-        case LDPT_GET_INPUT_SECTION_TYPE:
-          get_input_section_type = *entry->tv_u.tv_get_input_section_type;
-          break;
-        case LDPT_GET_INPUT_SECTION_NAME:
-          get_input_section_name = *entry->tv_u.tv_get_input_section_name;
-          break;
-        case LDPT_GET_INPUT_SECTION_CONTENTS:
-          get_input_section_contents = *entry->tv_u.tv_get_input_section_contents;
-          break;
-	case LDPT_UPDATE_SECTION_ORDER:
-	  update_section_order = *entry->tv_u.tv_update_section_order;
-	  break;
-	case LDPT_ALLOW_SECTION_ORDERING:
-	  allow_section_ordering = *entry->tv_u.tv_allow_section_ordering;
-	  break;
-        default:
-          break;
-        }
-    }
-
-  if (get_input_section_count == NULL
-      || get_input_section_type == NULL
-      || get_input_section_name == NULL
-      || get_input_section_contents == NULL
-      || update_section_order == NULL
-      || allow_section_ordering == NULL)
-    {
-      fprintf(stderr, "Some interfaces are missing\n");
-      return LDPS_ERR;
-    }
-
-  return LDPS_OK;
-}
-
-inline static int is_prefix_of(const char *prefix, const char *str)
-{
-  return strncmp(prefix, str, strlen (prefix)) == 0;
-}
-
-struct ld_plugin_section section_list[3];
-int num_entries = 0;
-
-/* This function is called by the linker for every new object it encounters.  */
-enum ld_plugin_status
-claim_file_hook(const struct ld_plugin_input_file *file, int *claimed)
-{
-  static int is_ordering_specified = 0;
-  struct ld_plugin_section section;
-  unsigned int count = 0;
-  unsigned int shndx;
-
-  *claimed = 0;
-  if (is_ordering_specified == 0)
-    {
-      /* Inform the linker to prepare for section reordering.  */
-      (*allow_section_ordering)();
-      is_ordering_specified = 1;
-    }
-
-  (*get_input_section_count)(file->handle, &count);
-
-  for (shndx = 0; shndx < count; ++shndx)
-    {
-      char *name = NULL;
-      int position = 3;
-
-      section.handle = file->handle;
-      section.shndx = shndx;
-      (*get_input_section_name)(section, &name);
-
-      /* Order is foo() followed by bar() followed by baz()  */
-      if (is_prefix_of(".text.", name))
-	{
-	  if (strstr(name, "_Z3foov") != NULL)
-	    position = 0;
-	  else if (strstr(name, "_Z3barv") != NULL)
-	    position = 1;
-	  else if (strstr(name, "_Z3bazv") != NULL)
-	    position = 2;
-	  else
-	    position = 3;
-	}
-      if (position < 3)
-	{
-	  section_list[position].handle = file->handle;
-	  section_list[position].shndx = shndx;
-	  num_entries++;
-	}
-    }
-  return LDPS_OK;
-}
-
-/* This function is called by the linker after all the symbols have been read.
-   At this stage, it is fine to tell the linker the desired function order.  */
-
-enum ld_plugin_status
-all_symbols_read_hook(void)
-{
-  if (num_entries == 3)
-    update_section_order(section_list, num_entries);
-
-  return LDPS_OK;
-}
diff --git a/binutils/binutils-2.21/gold/x86_64.cc b/binutils/binutils-2.21/gold/x86_64.cc
index 2d74564..65d3359 100644
--- a/binutils/binutils-2.21/gold/x86_64.cc
+++ b/binutils/binutils-2.21/gold/x86_64.cc
@@ -53,24 +53,22 @@
  public:
   typedef Output_data_reloc<elfcpp::SHT_RELA, true, 64, false> Reloc_section;
 
-  Output_data_plt_x86_64(Layout* layout, Output_data_got<64, false>* got,
- 			 Output_data_space* got_plt,
-			 Output_data_space* got_irelative)
-    : Output_section_data(16), tlsdesc_rel_(NULL), irelative_rel_(NULL),
-      got_(got), got_plt_(got_plt), got_irelative_(got_irelative), count_(0),
-      irelative_count_(0), tlsdesc_got_offset_(-1U), free_list_()
-  { this->init(layout); }
+  Output_data_plt_x86_64(Symbol_table* symtab, Layout* layout,
+			 Output_data_got<64, false>* got,
+			 Output_data_space* got_plt)
+    : Output_section_data(8), tlsdesc_rel_(NULL), got_(got), got_plt_(got_plt),
+      count_(0), tlsdesc_got_offset_(-1U), free_list_()
+  { this->init(symtab, layout); }
 
-  Output_data_plt_x86_64(Layout* layout, Output_data_got<64, false>* got,
+  Output_data_plt_x86_64(Symbol_table* symtab, Layout* layout,
+			 Output_data_got<64, false>* got,
 			 Output_data_space* got_plt,
-			 Output_data_space* got_irelative,
 			 unsigned int plt_count)
-    : Output_section_data((plt_count + 1) * plt_entry_size, 16, false),
-      tlsdesc_rel_(NULL), irelative_rel_(NULL), got_(got), got_plt_(got_plt),
-      got_irelative_(got_irelative), count_(plt_count), irelative_count_(0),
-      tlsdesc_got_offset_(-1U), free_list_()
+    : Output_section_data((plt_count + 1) * plt_entry_size, 8, false),
+      tlsdesc_rel_(NULL), got_(got), got_plt_(got_plt),
+      count_(plt_count), tlsdesc_got_offset_(-1U), free_list_()
   {
-    this->init(layout);
+    this->init(symtab, layout);
 
     // Initialize the free list and reserve the first entry.
     this->free_list_.init((plt_count + 1) * plt_entry_size, false);
@@ -79,22 +77,20 @@
 
   // Initialize the PLT section.
   void
-  init(Layout* layout);
+  init(Symbol_table* symtab, Layout* layout);
 
   // Add an entry to the PLT.
   void
-  add_entry(Symbol_table*, Layout*, Symbol* gsym);
+  add_entry(Symbol* gsym);
 
   // Add an entry to the PLT for a local STT_GNU_IFUNC symbol.
   unsigned int
-  add_local_ifunc_entry(Symbol_table* symtab, Layout*,
-			Sized_relobj_file<64, false>* relobj,
+  add_local_ifunc_entry(Sized_relobj_file<64, false>* relobj,
 			unsigned int local_sym_index);
 
   // Add the relocation for a PLT entry.
   void
-  add_relocation(Symbol_table*, Layout*, Symbol* gsym,
-		 unsigned int got_offset);
+  add_relocation(Symbol* gsym, unsigned int got_offset);
 
   // Add the reserved TLSDESC_PLT entry to the PLT.
   void
@@ -114,7 +110,7 @@
   // Return the offset of the reserved TLSDESC_PLT entry.
   unsigned int
   get_tlsdesc_plt_offset() const
-  { return (this->count_ + this->irelative_count_ + 1) * plt_entry_size; }
+  { return (this->count_ + 1) * plt_entry_size; }
 
   // Return the .rela.plt section data.
   Reloc_section*
@@ -125,20 +121,10 @@
   Reloc_section*
   rela_tlsdesc(Layout*);
 
-  // Return where the IRELATIVE relocations should go in the PLT
-  // relocations.
-  Reloc_section*
-  rela_irelative(Symbol_table*, Layout*);
-
-  // Return whether we created a section for IRELATIVE relocations.
-  bool
-  has_irelative_section() const
-  { return this->irelative_rel_ != NULL; }
-
   // Return the number of PLT entries.
   unsigned int
   entry_count() const
-  { return this->count_ + this->irelative_count_; }
+  { return this->count_; }
 
   // Return the offset of the first non-reserved PLT entry.
   static unsigned int
@@ -158,14 +144,6 @@
 			    (plt_index + 2) * plt_entry_size);
   }
 
-  // Return the PLT address to use for a global symbol.
-  uint64_t
-  address_for_global(const Symbol*);
-
-  // Return the PLT address to use for a local symbol.
-  uint64_t
-  address_for_local(const Relobj*, unsigned int symndx);
-
  protected:
   void
   do_adjust_output_section(Output_section* os);
@@ -203,20 +181,12 @@
   // The TLSDESC relocs, if necessary.  These must follow the regular
   // PLT relocs.
   Reloc_section* tlsdesc_rel_;
-  // The IRELATIVE relocs, if necessary.  These must follow the
-  // regular PLT relocations and the TLSDESC relocations.
-  Reloc_section* irelative_rel_;
   // The .got section.
   Output_data_got<64, false>* got_;
   // The .got.plt section.
   Output_data_space* got_plt_;
-  // The part of the .got.plt section used for IRELATIVE relocs.
-  Output_data_space* got_irelative_;
   // The number of PLT entries.
   unsigned int count_;
-  // Number of PLT entries with R_X86_64_IRELATIVE relocs.  These
-  // follow the regular PLT entries.
-  unsigned int irelative_count_;
   // Offset of the reserved TLSDESC_GOT entry when needed.
   unsigned int tlsdesc_got_offset_;
   // List of available regions within the section, for incremental
@@ -240,10 +210,10 @@
 
   Target_x86_64()
     : Target_freebsd<64, false>(&x86_64_info),
-      got_(NULL), plt_(NULL), got_plt_(NULL), got_irelative_(NULL),
-      got_tlsdesc_(NULL), global_offset_table_(NULL), rela_dyn_(NULL),
-      rela_irelative_(NULL), copy_relocs_(elfcpp::R_X86_64_COPY),
-      dynbss_(NULL), got_mod_index_offset_(-1U), tlsdesc_reloc_info_(),
+      got_(NULL), plt_(NULL), got_plt_(NULL), got_tlsdesc_(NULL),
+      global_offset_table_(NULL), rela_dyn_(NULL),
+      copy_relocs_(elfcpp::R_X86_64_COPY), dynbss_(NULL),
+      got_mod_index_offset_(-1U), tlsdesc_reloc_info_(),
       tls_base_symbol_defined_(false)
   { }
 
@@ -369,13 +339,13 @@
   do_reloc_addend(void* arg, unsigned int r_type, uint64_t addend) const;
 
   // Return the PLT section.
-  uint64_t
-  do_plt_address_for_global(const Symbol* gsym) const
-  { return this->plt_section()->address_for_global(gsym); }
+  Output_data*
+  do_plt_section_for_global(const Symbol*) const
+  { return this->plt_section(); }
 
-  uint64_t
-  do_plt_address_for_local(const Relobj* relobj, unsigned int symndx) const
-  { return this->plt_section()->address_for_local(relobj, symndx); }
+  Output_data*
+  do_plt_section_for_local(const Relobj*, unsigned int) const
+  { return this->plt_section(); }
 
   // Adjust -fstack-split code which calls non-stack-split code.
   void
@@ -436,8 +406,7 @@
 
   // Register an existing PLT entry for a global symbol.
   void
-  register_global_plt_entry(Symbol_table*, Layout*, unsigned int plt_index,
-			    Symbol* gsym);
+  register_global_plt_entry(unsigned int plt_index, Symbol* gsym);
 
   // Force a COPY relocation for a given symbol.
   void
@@ -707,10 +676,6 @@
   Reloc_section*
   rela_tlsdesc_section(Layout*) const;
 
-  // Get the section to use for IRELATIVE relocations.
-  Reloc_section*
-  rela_irelative_section(Layout*);
-
   // Add a potential copy relocation.
   void
   copy_reloc(Symbol_table* symtab, Layout* layout,
@@ -761,16 +726,12 @@
   Output_data_plt_x86_64* plt_;
   // The GOT PLT section.
   Output_data_space* got_plt_;
-  // The GOT section for IRELATIVE relocations.
-  Output_data_space* got_irelative_;
   // The GOT section for TLSDESC relocations.
   Output_data_got<64, false>* got_tlsdesc_;
   // The _GLOBAL_OFFSET_TABLE_ symbol.
   Symbol* global_offset_table_;
   // The dynamic reloc section.
   Reloc_section* rela_dyn_;
-  // The section to use for IRELATIVE relocs.
-  Reloc_section* rela_irelative_;
   // Relocs saved to avoid a COPY reloc.
   Copy_relocs<elfcpp::SHT_RELA, 64, false> copy_relocs_;
   // Space for variables copied with a COPY reloc.
@@ -857,17 +818,8 @@
 				      elfcpp::STV_HIDDEN, 0,
 				      false, false);
 
-      // If there are any IRELATIVE relocations, they get GOT entries
-      // in .got.plt after the jump slot entries.
-      this->got_irelative_ = new Output_data_space(8, "** GOT IRELATIVE PLT");
-      layout->add_output_section_data(".got.plt", elfcpp::SHT_PROGBITS,
-				      (elfcpp::SHF_ALLOC
-				       | elfcpp::SHF_WRITE),
-				      this->got_irelative_,
-				      ORDER_NON_RELRO_FIRST, false);
-
       // If there are any TLSDESC relocations, they get GOT entries in
-      // .got.plt after the jump slot and IRELATIVE entries.
+      // .got.plt after the jump slot entries.
       this->got_tlsdesc_ = new Output_data_got<64, false>();
       layout->add_output_section_data(".got.plt", elfcpp::SHT_PROGBITS,
 				      (elfcpp::SHF_ALLOC
@@ -895,38 +847,33 @@
   return this->rela_dyn_;
 }
 
-// Get the section to use for IRELATIVE relocs, creating it if
-// necessary.  These go in .rela.dyn, but only after all other dynamic
-// relocations.  They need to follow the other dynamic relocations so
-// that they can refer to global variables initialized by those
-// relocs.
-
-Target_x86_64::Reloc_section*
-Target_x86_64::rela_irelative_section(Layout* layout)
-{
-  if (this->rela_irelative_ == NULL)
-    {
-      // Make sure we have already created the dynamic reloc section.
-      this->rela_dyn_section(layout);
-      this->rela_irelative_ = new Reloc_section(false);
-      layout->add_output_section_data(".rela.dyn", elfcpp::SHT_RELA,
-				      elfcpp::SHF_ALLOC, this->rela_irelative_,
-				      ORDER_DYNAMIC_RELOCS, false);
-      gold_assert(this->rela_dyn_->output_section()
-		  == this->rela_irelative_->output_section());
-    }
-  return this->rela_irelative_;
-}
-
 // Initialize the PLT section.
 
 void
-Output_data_plt_x86_64::init(Layout* layout)
+Output_data_plt_x86_64::init(Symbol_table* symtab, Layout* layout)
 {
   this->rel_ = new Reloc_section(false);
   layout->add_output_section_data(".rela.plt", elfcpp::SHT_RELA,
 				  elfcpp::SHF_ALLOC, this->rel_,
 				  ORDER_DYNAMIC_PLT_RELOCS, false);
+
+  if (parameters->doing_static_link())
+    {
+      // A statically linked executable will only have a .rela.plt
+      // section to hold R_X86_64_IRELATIVE relocs for STT_GNU_IFUNC
+      // symbols.  The library will use these symbols to locate the
+      // IRELATIVE relocs at program startup time.
+      symtab->define_in_output_data("__rela_iplt_start", NULL,
+				    Symbol_table::PREDEFINED,
+				    this->rel_, 0, 0, elfcpp::STT_NOTYPE,
+				    elfcpp::STB_GLOBAL, elfcpp::STV_HIDDEN,
+				    0, false, true);
+      symtab->define_in_output_data("__rela_iplt_end", NULL,
+				    Symbol_table::PREDEFINED,
+				    this->rel_, 0, 0, elfcpp::STT_NOTYPE,
+				    elfcpp::STB_GLOBAL, elfcpp::STV_HIDDEN,
+				    0, true, true);
+    }
 }
 
 void
@@ -938,8 +885,7 @@
 // Add an entry to the PLT.
 
 void
-Output_data_plt_x86_64::add_entry(Symbol_table* symtab, Layout* layout,
-				  Symbol* gsym)
+Output_data_plt_x86_64::add_entry(Symbol* gsym)
 {
   gold_assert(!gsym->has_plt_offset());
 
@@ -947,47 +893,25 @@
   off_t plt_offset;
   section_offset_type got_offset;
 
-  unsigned int* pcount;
-  unsigned int offset;
-  unsigned int reserved;
-  Output_data_space* got;
-  if (gsym->type() == elfcpp::STT_GNU_IFUNC
-      && gsym->can_use_relative_reloc(false))
-    {
-      pcount = &this->irelative_count_;
-      offset = 0;
-      reserved = 0;
-      got = this->got_irelative_;
-    }
-  else
-    {
-      pcount = &this->count_;
-      offset = 1;
-      reserved = 3;
-      got = this->got_plt_;
-    }
-
   if (!this->is_data_size_valid())
     {
-      // Note that when setting the PLT offset for a non-IRELATIVE
-      // entry we skip the initial reserved PLT entry.
-      plt_index = *pcount + offset;
+      // Note that when setting the PLT offset we skip the initial
+      // reserved PLT entry.
+      plt_index = this->count_ + 1;
       plt_offset = plt_index * plt_entry_size;
 
-      ++*pcount;
+      ++this->count_;
 
-      got_offset = (plt_index - offset + reserved) * 8;
-      gold_assert(got_offset == got->current_data_size());
+      got_offset = (plt_index - 1 + 3) * 8;
+      gold_assert(got_offset == this->got_plt_->current_data_size());
 
       // Every PLT entry needs a GOT entry which points back to the PLT
       // entry (this will be changed by the dynamic linker, normally
       // lazily when the function is called).
-      got->set_current_data_size(got_offset + 8);
+      this->got_plt_->set_current_data_size(got_offset + 8);
     }
   else
     {
-      // FIXME: This is probably not correct for IRELATIVE relocs.
-
       // For incremental updates, find an available slot.
       plt_offset = this->free_list_.allocate(plt_entry_size, plt_entry_size, 0);
       if (plt_offset == -1)
@@ -998,13 +922,13 @@
       // can be calculated from the PLT index, adjusting for the three
       // reserved entries at the beginning of the GOT.
       plt_index = plt_offset / plt_entry_size - 1;
-      got_offset = (plt_index - offset + reserved) * 8;
+      got_offset = (plt_index - 1 + 3) * 8;
     }
 
   gsym->set_plt_offset(plt_offset);
 
   // Every PLT entry needs a reloc.
-  this->add_relocation(symtab, layout, gsym, got_offset);
+  this->add_relocation(gsym, got_offset);
 
   // Note that we don't need to save the symbol.  The contents of the
   // PLT are independent of which symbols are used.  The symbols only
@@ -1016,25 +940,22 @@
 
 unsigned int
 Output_data_plt_x86_64::add_local_ifunc_entry(
-    Symbol_table* symtab,
-    Layout* layout,
     Sized_relobj_file<64, false>* relobj,
     unsigned int local_sym_index)
 {
-  unsigned int plt_offset = this->irelative_count_ * plt_entry_size;
-  ++this->irelative_count_;
+  unsigned int plt_offset = (this->count_ + 1) * plt_entry_size;
+  ++this->count_;
 
-  section_offset_type got_offset = this->got_irelative_->current_data_size();
+  section_offset_type got_offset = this->got_plt_->current_data_size();
 
   // Every PLT entry needs a GOT entry which points back to the PLT
   // entry.
-  this->got_irelative_->set_current_data_size(got_offset + 8);
+  this->got_plt_->set_current_data_size(got_offset + 8);
 
   // Every PLT entry needs a reloc.
-  Reloc_section* rela = this->rela_irelative(symtab, layout);
-  rela->add_symbolless_local_addend(relobj, local_sym_index,
-				    elfcpp::R_X86_64_IRELATIVE,
-				    this->got_irelative_, got_offset, 0);
+  this->rel_->add_symbolless_local_addend(relobj, local_sym_index,
+					  elfcpp::R_X86_64_IRELATIVE,
+					  this->got_plt_, got_offset, 0);
 
   return plt_offset;
 }
@@ -1042,16 +963,12 @@
 // Add the relocation for a PLT entry.
 
 void
-Output_data_plt_x86_64::add_relocation(Symbol_table* symtab, Layout* layout,
-				       Symbol* gsym, unsigned int got_offset)
+Output_data_plt_x86_64::add_relocation(Symbol* gsym, unsigned int got_offset)
 {
   if (gsym->type() == elfcpp::STT_GNU_IFUNC
       && gsym->can_use_relative_reloc(false))
-    {
-      Reloc_section* rela = this->rela_irelative(symtab, layout);
-      rela->add_symbolless_global_addend(gsym, elfcpp::R_X86_64_IRELATIVE,
-					 this->got_irelative_, got_offset, 0);
-    }
+    this->rel_->add_symbolless_global_addend(gsym, elfcpp::R_X86_64_IRELATIVE,
+					     this->got_plt_, got_offset, 0);
   else
     {
       gsym->set_needs_dynsym_entry();
@@ -1072,78 +989,17 @@
       layout->add_output_section_data(".rela.plt", elfcpp::SHT_RELA,
 				      elfcpp::SHF_ALLOC, this->tlsdesc_rel_,
 				      ORDER_DYNAMIC_PLT_RELOCS, false);
-      gold_assert(this->tlsdesc_rel_->output_section()
-		  == this->rel_->output_section());
+      gold_assert(this->tlsdesc_rel_->output_section() ==
+		  this->rel_->output_section());
     }
   return this->tlsdesc_rel_;
 }
 
-// Return where the IRELATIVE relocations should go in the PLT.  These
-// follow the JUMP_SLOT and the TLSDESC relocations.
-
-Output_data_plt_x86_64::Reloc_section*
-Output_data_plt_x86_64::rela_irelative(Symbol_table* symtab, Layout* layout)
-{
-  if (this->irelative_rel_ == NULL)
-    {
-      // Make sure we have a place for the TLSDESC relocations, in
-      // case we see any later on.
-      this->rela_tlsdesc(layout);
-      this->irelative_rel_ = new Reloc_section(false);
-      layout->add_output_section_data(".rela.plt", elfcpp::SHT_RELA,
-				      elfcpp::SHF_ALLOC, this->irelative_rel_,
-				      ORDER_DYNAMIC_PLT_RELOCS, false);
-      gold_assert(this->irelative_rel_->output_section()
-		  == this->rel_->output_section());
-
-      if (parameters->doing_static_link())
-	{
-	  // A statically linked executable will only have a .rela.plt
-	  // section to hold R_X86_64_IRELATIVE relocs for
-	  // STT_GNU_IFUNC symbols.  The library will use these
-	  // symbols to locate the IRELATIVE relocs at program startup
-	  // time.
-	  symtab->define_in_output_data("__rela_iplt_start", NULL,
-					Symbol_table::PREDEFINED,
-					this->irelative_rel_, 0, 0,
-					elfcpp::STT_NOTYPE, elfcpp::STB_GLOBAL,
-					elfcpp::STV_HIDDEN, 0, false, true);
-	  symtab->define_in_output_data("__rela_iplt_end", NULL,
-					Symbol_table::PREDEFINED,
-					this->irelative_rel_, 0, 0,
-					elfcpp::STT_NOTYPE, elfcpp::STB_GLOBAL,
-					elfcpp::STV_HIDDEN, 0, true, true);
-	}
-    }
-  return this->irelative_rel_;
-}
-
-// Return the PLT address to use for a global symbol.
-
-uint64_t
-Output_data_plt_x86_64::address_for_global(const Symbol* gsym)
-{
-  uint64_t offset = 0;
-  if (gsym->type() == elfcpp::STT_GNU_IFUNC
-      && gsym->can_use_relative_reloc(false))
-    offset = (this->count_ + 1) * plt_entry_size;
-  return this->address() + offset;
-}
-
-// Return the PLT address to use for a local symbol.  These are always
-// IRELATIVE relocs.
-
-uint64_t
-Output_data_plt_x86_64::address_for_local(const Relobj*, unsigned int)
-{
-  return this->address() + (this->count_ + 1) * plt_entry_size;
-}
-
 // Set the final size.
 void
 Output_data_plt_x86_64::set_final_data_size()
 {
-  unsigned int count = this->count_ + this->irelative_count_;
+  unsigned int count = this->count_;
   if (this->has_tlsdesc_entry())
     ++count;
   this->set_data_size((count + 1) * plt_entry_size);
@@ -1200,12 +1056,8 @@
   unsigned char* const oview = of->get_output_view(offset, oview_size);
 
   const off_t got_file_offset = this->got_plt_->offset();
-  gold_assert(parameters->incremental_update()
-	      || (got_file_offset + this->got_plt_->data_size()
-		  == this->got_irelative_->offset()));
   const section_size_type got_size =
-    convert_to_section_size_type(this->got_plt_->data_size()
-				 + this->got_irelative_->data_size());
+    convert_to_section_size_type(this->got_plt_->data_size());
   unsigned char* const got_view = of->get_output_view(got_file_offset,
 						      got_size);
 
@@ -1237,7 +1089,7 @@
 
   unsigned int plt_offset = plt_entry_size;
   unsigned int got_offset = 24;
-  const unsigned int count = this->count_ + this->irelative_count_;
+  const unsigned int count = this->count_;
   for (unsigned int plt_index = 0;
        plt_index < count;
        ++plt_index,
@@ -1295,9 +1147,8 @@
       // Create the GOT sections first.
       this->got_section(symtab, layout);
 
-      this->plt_ = new Output_data_plt_x86_64(layout, this->got_,
-					      this->got_plt_,
-					      this->got_irelative_);
+      this->plt_ = new Output_data_plt_x86_64(symtab, layout, this->got_,
+                                              this->got_plt_);
       layout->add_output_section_data(".plt", elfcpp::SHT_PROGBITS,
 				      (elfcpp::SHF_ALLOC
 				       | elfcpp::SHF_EXECINSTR),
@@ -1329,7 +1180,7 @@
   if (this->plt_ == NULL)
     this->make_plt_section(symtab, layout);
 
-  this->plt_->add_entry(symtab, layout, gsym);
+  this->plt_->add_entry(gsym);
 }
 
 // Make a PLT entry for a local STT_GNU_IFUNC symbol.
@@ -1343,8 +1194,7 @@
     return;
   if (this->plt_ == NULL)
     this->make_plt_section(symtab, layout);
-  unsigned int plt_offset = this->plt_->add_local_ifunc_entry(symtab, layout,
-							      relobj,
+  unsigned int plt_offset = this->plt_->add_local_ifunc_entry(relobj,
 							      local_sym_index);
   relobj->set_local_plt_offset(local_sym_index, plt_offset);
 }
@@ -1419,17 +1269,9 @@
 				  this->got_tlsdesc_,
 				  ORDER_NON_RELRO_FIRST, false);
 
-  // If there are any IRELATIVE relocations, they get GOT entries in
-  // .got.plt after the jump slot and TLSDESC entries.
-  this->got_irelative_ = new Output_data_space(0, 8, "** GOT IRELATIVE PLT");
-  layout->add_output_section_data(".got.plt", elfcpp::SHT_PROGBITS,
-				  elfcpp::SHF_ALLOC | elfcpp::SHF_WRITE,
-				  this->got_irelative_,
-				  ORDER_NON_RELRO_FIRST, false);
-
   // Create the PLT section.
-  this->plt_ = new Output_data_plt_x86_64(layout, this->got_, this->got_plt_,
-					  this->got_irelative_, plt_count);
+  this->plt_ = new Output_data_plt_x86_64(symtab, layout, this->got_,
+					  this->got_plt_, plt_count);
   layout->add_output_section_data(".plt", elfcpp::SHT_PROGBITS,
 				  elfcpp::SHF_ALLOC | elfcpp::SHF_EXECINSTR,
 				  this->plt_, ORDER_PLT, false);
@@ -1463,7 +1305,7 @@
     case GOT_TYPE_STANDARD:
       if (parameters->options().output_is_position_independent())
 	rela_dyn->add_local_relative(obj, r_sym, elfcpp::R_X86_64_RELATIVE,
-				     this->got_, got_offset, 0, false);
+				     this->got_, got_offset, 0);
       break;
     case GOT_TYPE_TLS_OFFSET:
       rela_dyn->add_local(obj, r_sym, elfcpp::R_X86_64_TPOFF64,
@@ -1536,9 +1378,7 @@
 // Register an existing PLT entry for a global symbol.
 
 void
-Target_x86_64::register_global_plt_entry(Symbol_table* symtab,
-					 Layout* layout,
-					 unsigned int plt_index,
+Target_x86_64::register_global_plt_entry(unsigned int plt_index,
 					 Symbol* gsym)
 {
   gold_assert(this->plt_ != NULL);
@@ -1549,7 +1389,7 @@
   gsym->set_plt_offset((plt_index + 1) * this->plt_entry_size());
 
   unsigned int got_offset = (plt_index + 3) * 8;
-  this->plt_->add_relocation(symtab, layout, gsym, got_offset);
+  this->plt_->add_relocation(gsym, got_offset);
 }
 
 // Force a COPY relocation for a given symbol.
@@ -1837,8 +1677,8 @@
                            const elfcpp::Sym<64, false>& lsym)
 {
   // A local STT_GNU_IFUNC symbol may require a PLT entry.
-  bool is_ifunc = lsym.get_st_type() == elfcpp::STT_GNU_IFUNC;
-  if (is_ifunc && this->reloc_needs_plt_for_ifunc(object, r_type))
+  if (lsym.get_st_type() == elfcpp::STT_GNU_IFUNC
+      && this->reloc_needs_plt_for_ifunc(object, r_type))
     {
       unsigned int r_sym = elfcpp::elf_r_sym<64>(reloc.get_r_info());
       target->make_local_ifunc_plt_entry(symtab, layout, object, r_sym);
@@ -1866,7 +1706,7 @@
 				       elfcpp::R_X86_64_RELATIVE,
 				       output_section, data_shndx,
 				       reloc.get_r_offset(),
-				       reloc.get_r_addend(), is_ifunc);
+				       reloc.get_r_addend());
         }
       break;
 
@@ -1942,7 +1782,7 @@
 	// lets function pointers compare correctly with shared
 	// libraries.  Otherwise we would need an IRELATIVE reloc.
 	bool is_new;
-	if (is_ifunc)
+	if (lsym.get_st_type() == elfcpp::STT_GNU_IFUNC)
 	  is_new = got->add_local_plt(object, r_sym, GOT_TYPE_STANDARD);
 	else
 	  is_new = got->add_local(object, r_sym, GOT_TYPE_STANDARD);
@@ -1960,7 +1800,7 @@
 		      object->local_got_offset(r_sym, GOT_TYPE_STANDARD);
 		    rela_dyn->add_local_relative(object, r_sym,
 						 elfcpp::R_X86_64_RELATIVE,
-						 got, got_offset, 0, is_ifunc);
+						 got, got_offset, 0);
 		  }
                 else
                   {
@@ -2265,8 +2105,7 @@
 		// STT_GNU_IFUNC symbol.  This makes a function
 		// address in a PIE executable match the address in a
 		// shared library that it links against.
-		Reloc_section* rela_dyn =
-		  target->rela_irelative_section(layout);
+		Reloc_section* rela_dyn = target->rela_dyn_section(layout);
 		unsigned int r_type = elfcpp::R_X86_64_IRELATIVE;
 		rela_dyn->add_symbolless_global_addend(gsym, r_type,
 						       output_section, object,
@@ -2710,7 +2549,7 @@
   if (gsym != NULL
       && gsym->use_plt_offset(Scan::get_reference_flags(r_type)))
     {
-      symval.set_output_value(target->plt_address_for_global(gsym)
+      symval.set_output_value(target->plt_section()->address()
 			      + gsym->plt_offset());
       psymval = &symval;
     }
@@ -2719,7 +2558,7 @@
       unsigned int r_sym = elfcpp::elf_r_sym<64>(rela.get_r_info());
       if (object->local_has_plt_offset(r_sym))
 	{
-	  symval.set_output_value(target->plt_address_for_local(object, r_sym)
+	  symval.set_output_value(target->plt_section()->address()
 				  + object->local_plt_offset(r_sym));
 	  psymval = &symval;
 	}
@@ -3004,6 +2843,7 @@
             }
           if (optimized_type == tls::TLSOPT_TO_IE)
             {
+              gold_assert(tls_segment != NULL);
               value = target->got_plt_section()->address() + got_offset;
               this->tls_gd_to_ie(relinfo, relnum, tls_segment, rela, r_type,
                                  value, view, address, view_size);
@@ -3628,7 +3468,7 @@
 Target_x86_64::do_dynsym_value(const Symbol* gsym) const
 {
   gold_assert(gsym->is_from_dynobj() && gsym->has_plt_offset());
-  return this->plt_address_for_global(gsym) + gsym->plt_offset();
+  return this->plt_section()->address() + gsym->plt_offset();
 }
 
 // Return a string used to fill a code section with nops to take up
@@ -3648,51 +3488,42 @@
     }
 
   // Nop sequences of various lengths.
-  const char nop1[1] = { '\x90' };                 // nop
-  const char nop2[2] = { '\x66', '\x90' };         // xchg %ax %ax
-  const char nop3[3] = { '\x0f', '\x1f', '\x00' }; // nop (%rax)
-  const char nop4[4] = { '\x0f', '\x1f', '\x40',   // nop 0(%rax)
-  			 '\x00'};
-  const char nop5[5] = { '\x0f', '\x1f', '\x44',   // nop 0(%rax,%rax,1)
-			 '\x00', '\x00' };
-  const char nop6[6] = { '\x66', '\x0f', '\x1f',   // nopw 0(%rax,%rax,1)
-  			 '\x44', '\x00', '\x00' };
-  const char nop7[7] = { '\x0f', '\x1f', '\x80',   // nopl 0L(%rax)
-  			 '\x00', '\x00', '\x00',
-			 '\x00' };
-  const char nop8[8] = { '\x0f', '\x1f', '\x84',   // nopl 0L(%rax,%rax,1)
-  			 '\x00', '\x00', '\x00',
-			 '\x00', '\x00' };
-  const char nop9[9] = { '\x66', '\x0f', '\x1f',   // nopw 0L(%rax,%rax,1)
-  			 '\x84', '\x00', '\x00',
-			 '\x00', '\x00', '\x00' };
-  const char nop10[10] = { '\x66', '\x2e', '\x0f', // nopw %cs:0L(%rax,%rax,1)
-  			   '\x1f', '\x84', '\x00',
-			   '\x00', '\x00', '\x00',
-			   '\x00' };
-  const char nop11[11] = { '\x66', '\x66', '\x2e', // data16
-  			   '\x0f', '\x1f', '\x84', // nopw %cs:0L(%rax,%rax,1)
-			   '\x00', '\x00', '\x00',
-			   '\x00', '\x00' };
-  const char nop12[12] = { '\x66', '\x66', '\x66', // data16; data16
-  			   '\x2e', '\x0f', '\x1f', // nopw %cs:0L(%rax,%rax,1)
-			   '\x84', '\x00', '\x00',
-			   '\x00', '\x00', '\x00' };
-  const char nop13[13] = { '\x66', '\x66', '\x66', // data16; data16; data16
-  			   '\x66', '\x2e', '\x0f', // nopw %cs:0L(%rax,%rax,1)
-			   '\x1f', '\x84', '\x00',
-			   '\x00', '\x00', '\x00',
-                           '\x00' };
-  const char nop14[14] = { '\x66', '\x66', '\x66', // data16; data16; data16
-  			   '\x66', '\x66', '\x2e', // data16
-			   '\x0f', '\x1f', '\x84', // nopw %cs:0L(%rax,%rax,1)
-			   '\x00', '\x00', '\x00',
-                           '\x00', '\x00' };
-  const char nop15[15] = { '\x66', '\x66', '\x66', // data16; data16; data16
-  			   '\x66', '\x66', '\x66', // data16; data16
-			   '\x2e', '\x0f', '\x1f', // nopw %cs:0L(%rax,%rax,1)
-			   '\x84', '\x00', '\x00',
-                           '\x00', '\x00', '\x00' };
+  const char nop1[1] = { 0x90 };                   // nop
+  const char nop2[2] = { 0x66, 0x90 };             // xchg %ax %ax
+  const char nop3[3] = { 0x0f, 0x1f, 0x00 };       // nop (%rax)
+  const char nop4[4] = { 0x0f, 0x1f, 0x40, 0x00};  // nop 0(%rax)
+  const char nop5[5] = { 0x0f, 0x1f, 0x44, 0x00,   // nop 0(%rax,%rax,1)
+                         0x00 };
+  const char nop6[6] = { 0x66, 0x0f, 0x1f, 0x44,   // nopw 0(%rax,%rax,1)
+                         0x00, 0x00 };
+  const char nop7[7] = { 0x0f, 0x1f, 0x80, 0x00,   // nopl 0L(%rax)
+                         0x00, 0x00, 0x00 };
+  const char nop8[8] = { 0x0f, 0x1f, 0x84, 0x00,   // nopl 0L(%rax,%rax,1)
+                         0x00, 0x00, 0x00, 0x00 };
+  const char nop9[9] = { 0x66, 0x0f, 0x1f, 0x84,   // nopw 0L(%rax,%rax,1)
+                         0x00, 0x00, 0x00, 0x00,
+                         0x00 };
+  const char nop10[10] = { 0x66, 0x2e, 0x0f, 0x1f, // nopw %cs:0L(%rax,%rax,1)
+                           0x84, 0x00, 0x00, 0x00,
+                           0x00, 0x00 };
+  const char nop11[11] = { 0x66, 0x66, 0x2e, 0x0f, // data16
+                           0x1f, 0x84, 0x00, 0x00, // nopw %cs:0L(%rax,%rax,1)
+                           0x00, 0x00, 0x00 };
+  const char nop12[12] = { 0x66, 0x66, 0x66, 0x2e, // data16; data16
+                           0x0f, 0x1f, 0x84, 0x00, // nopw %cs:0L(%rax,%rax,1)
+                           0x00, 0x00, 0x00, 0x00 };
+  const char nop13[13] = { 0x66, 0x66, 0x66, 0x66, // data16; data16; data16
+                           0x2e, 0x0f, 0x1f, 0x84, // nopw %cs:0L(%rax,%rax,1)
+                           0x00, 0x00, 0x00, 0x00,
+                           0x00 };
+  const char nop14[14] = { 0x66, 0x66, 0x66, 0x66, // data16; data16; data16
+                           0x66, 0x2e, 0x0f, 0x1f, // data16
+                           0x84, 0x00, 0x00, 0x00, // nopw %cs:0L(%rax,%rax,1)
+                           0x00, 0x00 };
+  const char nop15[15] = { 0x66, 0x66, 0x66, 0x66, // data16; data16; data16
+                           0x66, 0x66, 0x2e, 0x0f, // data16; data16
+                           0x1f, 0x84, 0x00, 0x00, // nopw %cs:0L(%rax,%rax,1)
+                           0x00, 0x00, 0x00 };
 
   const char* nops[16] = {
     NULL,
diff --git a/binutils/binutils-2.21/gprof/hist.c b/binutils/binutils-2.21/gprof/hist.c
index f681304..25364b2 100644
--- a/binutils/binutils-2.21/gprof/hist.c
+++ b/binutils/binutils-2.21/gprof/hist.c
@@ -365,13 +365,13 @@
   bfd_vma sym_low_pc, sym_high_pc;
   bfd_vma overlap, addr;
   unsigned int bin_count;
-  unsigned int i, j, k;
+  unsigned int i, j;
   double count_time, credit;
 
   bfd_vma lowpc = r->lowpc / sizeof (UNIT);
 
   /* Iterate over all sample bins.  */
-  for (i = 0, k = 1; i < r->num_bins; ++i)
+  for (i = 0, j = 1; i < r->num_bins; ++i)
     {
       bin_count = r->sample[i];
       if (! bin_count)
@@ -389,11 +389,8 @@
 		    bin_count));
       total_time += count_time;
 
-      /* Credit all symbols that are covered by bin I.
-
-	 PR gprof/13325: Make sure that K does not get decremented
-	 and J will never be less than 0.  */
-      for (j = k - 1; j < symtab.len; k = ++j)
+      /* Credit all symbols that are covered by bin I.  */
+      for (j = j - 1; j < symtab.len; ++j)
 	{
 	  sym_low_pc = symtab.base[j].hist.scaled_addr;
 	  sym_high_pc = symtab.base[j + 1].hist.scaled_addr;
diff --git a/binutils/binutils-2.21/include/demangle.h b/binutils/binutils-2.21/include/demangle.h
index f157495..8ad073d 100644
--- a/binutils/binutils-2.21/include/demangle.h
+++ b/binutils/binutils-2.21/include/demangle.h
@@ -396,9 +396,7 @@
   /* An unnamed type.  */
   DEMANGLE_COMPONENT_UNNAMED_TYPE,
   /* A pack expansion.  */
-  DEMANGLE_COMPONENT_PACK_EXPANSION,
-  /* A cloned function.  */
-  DEMANGLE_COMPONENT_CLONE
+  DEMANGLE_COMPONENT_PACK_EXPANSION
 };
 
 /* Types which are only used internally.  */
diff --git a/binutils/binutils-2.21/include/dwarf2.h b/binutils/binutils-2.21/include/dwarf2.h
index bb3c264..fea23ad 100644
--- a/binutils/binutils-2.21/include/dwarf2.h
+++ b/binutils/binutils-2.21/include/dwarf2.h
@@ -269,12 +269,8 @@
     DW_FORM_sec_offset = 0x17,
     DW_FORM_exprloc = 0x18,
     DW_FORM_flag_present = 0x19,
-    DW_FORM_ref_sig8 = 0x20,
+    DW_FORM_ref_sig8 = 0x20
 #define DW_FORM_sig8  DW_FORM_ref_sig8  /* Note: The use of DW_FORM_sig8 is deprecated.  */
-    /* Extensions for Fission.  */
-    DW_FORM_GNU_ref_index = 0x70,
-    DW_FORM_GNU_addr_index = 0x71,
-    DW_FORM_GNU_str_index = 0x72
   };
 
 /* Attribute names and codes.  */
@@ -442,13 +438,6 @@
     /* Template template argument name.
        See http://gcc.gnu.org/wiki/TemplateParmsDwarf .  */
     DW_AT_GNU_template_name = 0x2110,
-    /* Extensions for Fission.  */
-    DW_AT_GNU_dwo_name = 0x2130,
-    DW_AT_GNU_dwo_id = 0x2131,
-    DW_AT_GNU_ref_base = 0x2132,
-    DW_AT_GNU_addr_base = 0x2133,
-    DW_AT_GNU_pubnames = 0x2134,
-    DW_AT_GNU_pubtypes = 0x2135,
     /* VMS extensions.  */
     DW_AT_VMS_rtnbeg_pd_address = 0x2201,
     /* GNAT extensions.  */
diff --git a/binutils/binutils-2.21/ld/testsuite/ld-elf/new.cc b/binutils/binutils-2.21/ld/testsuite/ld-elf/new.cc
index 513cf2f..b4c8882 100644
--- a/binutils/binutils-2.21/ld/testsuite/ld-elf/new.cc
+++ b/binutils/binutils-2.21/ld/testsuite/ld-elf/new.cc
@@ -1,4 +1,5 @@
 #include <new>
+#include <exception_defines.h>
 
 using std::bad_alloc;
 
diff --git a/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-10-i386.s b/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-10-i386.s
index 8411e81..76c5bef 100644
--- a/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-10-i386.s
+++ b/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-10-i386.s
@@ -6,6 +6,8 @@
         movl ifunc@GOTOFF(%ecx), %eax
 	call ifunc@PLT
 	call ifunc
+        movl xxx@GOT(%ecx), %eax
+        movl xxx, %eax
         ret
 
         .section .text.bar,"ax",@progbits
@@ -18,3 +20,7 @@
         .type ifunc, @gnu_indirect_function
 ifunc:
         ret
+
+        .section .data.foo,"aw",@progbits
+xxx:
+	.long ifunc 
diff --git a/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-10-x86-64.s b/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-10-x86-64.s
index ea6f8c2..11e29b5 100644
--- a/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-10-x86-64.s
+++ b/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-10-x86-64.s
@@ -6,6 +6,7 @@
         movl ifunc(%rip), %eax
 	call ifunc@PLT
 	call ifunc
+        movl xxx(%rip), %eax
         ret
 
         .section .text.bar,"ax",@progbits
@@ -18,3 +19,7 @@
         .type ifunc, @gnu_indirect_function
 ifunc:
         ret
+
+        .section .data.foo,"aw",@progbits
+xxx:
+	.quad ifunc 
diff --git a/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-11-i386.s b/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-11-i386.s
index 06f5924..e0e4740 100644
--- a/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-11-i386.s
+++ b/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-11-i386.s
@@ -3,9 +3,11 @@
 foo:
         .global foo
         movl ifunc@GOT(%ecx), %eax
-	movl ifunc@GOTOFF(%ecx), %eax
+        movl ifunc@GOTOFF(%ecx), %eax
 	call ifunc@PLT
 	call ifunc
+        movl xxx@GOT(%ecx), %eax
+        movl xxx, %eax
         ret
 
         .section .text.bar,"ax",@progbits
@@ -16,6 +18,10 @@
 
         .section .text.ifunc,"ax",@progbits
         .type ifunc, @gnu_indirect_function
-        .global ifunc
+	.global ifunc
 ifunc:
         ret
+
+        .section .data.foo,"aw",@progbits
+xxx:
+	.long ifunc 
diff --git a/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-11-x86-64.s b/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-11-x86-64.s
index 70d4fbf..8525419 100644
--- a/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-11-x86-64.s
+++ b/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-11-x86-64.s
@@ -6,6 +6,7 @@
         movl ifunc(%rip), %eax
 	call ifunc@PLT
 	call ifunc
+        movl xxx(%rip), %eax
         ret
 
         .section .text.bar,"ax",@progbits
@@ -19,3 +20,7 @@
         .global ifunc
 ifunc:
         ret
+
+        .section .data.foo,"aw",@progbits
+xxx:
+	.quad ifunc 
diff --git a/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-12-i386.d b/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-12-i386.d
new file mode 100644
index 0000000..de14181
--- /dev/null
+++ b/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-12-i386.d
@@ -0,0 +1,6 @@
+#ld: -shared -m elf_i386 -e bar --gc-sections
+#as: --32
+#readelf: -r --wide
+#target: x86_64-*-* i?86-*-*
+
+There are no relocations in this file.
diff --git a/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-12-i386.s b/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-12-i386.s
new file mode 100644
index 0000000..840302f
--- /dev/null
+++ b/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-12-i386.s
@@ -0,0 +1,25 @@
+        .section .text.foo,"ax",@progbits
+        .type foo, @function
+foo:
+        movl ifunc@GOT(%ecx), %eax
+        movl ifunc@GOTOFF(%ecx), %eax
+	call ifunc@PLT
+	call ifunc
+        movl xxx@GOT(%ecx), %eax
+        movl xxx, %eax
+        ret
+
+        .section .text.bar,"ax",@progbits
+        .type bar, @function
+bar:
+        .global bar
+        ret
+
+        .section .text.ifunc,"ax",@progbits
+        .type ifunc, @gnu_indirect_function
+ifunc:
+        ret
+
+        .section .data.foo,"aw",@progbits
+xxx:
+	.long ifunc 
diff --git a/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-12-x86-64.d b/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-12-x86-64.d
new file mode 100644
index 0000000..40f07c3
--- /dev/null
+++ b/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-12-x86-64.d
@@ -0,0 +1,6 @@
+#ld: -shared -m elf_x86_64 -e bar --gc-sections
+#as: --64
+#readelf: -r --wide
+#target: x86_64-*-*
+
+There are no relocations in this file.
diff --git a/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-12-x86-64.s b/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-12-x86-64.s
new file mode 100644
index 0000000..491684b
--- /dev/null
+++ b/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-12-x86-64.s
@@ -0,0 +1,24 @@
+        .section .text.foo,"ax",@progbits
+        .type foo, @function
+foo:
+        movl ifunc@GOTPCREL(%rip), %eax
+        movl ifunc(%rip), %eax
+	call ifunc@PLT
+	call ifunc
+        movl xxx(%rip), %eax
+        ret
+
+        .section .text.bar,"ax",@progbits
+        .type bar, @function
+bar:
+        .global bar
+        ret
+
+        .section .text.ifunc,"ax",@progbits
+        .type ifunc, @gnu_indirect_function
+ifunc:
+        ret
+
+        .section .data.foo,"aw",@progbits
+xxx:
+	.quad ifunc 
diff --git a/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-13-i386.d b/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-13-i386.d
new file mode 100644
index 0000000..162c3e4
--- /dev/null
+++ b/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-13-i386.d
@@ -0,0 +1,19 @@
+#source: ifunc-13a-i386.s
+#source: ifunc-13b-i386.s
+#ld: -shared -m elf_i386 -z nocombreloc
+#as: --32
+#readelf: -r --wide
+#target: x86_64-*-* i?86-*-*
+
+Relocation section '.rel.got' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+#...
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_386_GLOB_DAT[ ]+ifunc\(\)[ ]+ifunc
+#...
+Relocation section '.rel.ifunc' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_386_32[ ]+ifunc\(\)[ ]+ifunc
+#...
+Relocation section '.rel.plt' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_386_JUMP_SLOT[ ]+ifunc\(\)[ ]+ifunc
diff --git a/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-13-x86-64.d b/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-13-x86-64.d
new file mode 100644
index 0000000..d0c0647
--- /dev/null
+++ b/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-13-x86-64.d
@@ -0,0 +1,18 @@
+#source: ifunc-13a-x86-64.s
+#source: ifunc-13b-x86-64.s
+#ld: -shared -m elf_x86_64 -z nocombreloc
+#as: --64
+#readelf: -r --wide
+#target: x86_64-*-*
+
+Relocation section '.rela.got' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_GLOB_DAT[ ]+ifunc\(\)[ ]+ifunc \+ 0
+#...
+Relocation section '.rela.ifunc' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_64[ ]+ifunc\(\)[ ]+ifunc \+ 0
+#...
+Relocation section '.rela.plt' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_JUMP_SLOT[ ]+ifunc\(\)[ ]+ifunc \+ 0
diff --git a/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-13a-i386.s b/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-13a-i386.s
new file mode 100644
index 0000000..eb893af
--- /dev/null
+++ b/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-13a-i386.s
@@ -0,0 +1,10 @@
+	.text
+        .type foo, @function
+	.global
+foo:
+	movl xxx@GOT(%ebx), %eax
+        ret
+
+	.data
+xxx:
+	.long ifunc 
diff --git a/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-13a-x86-64.s b/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-13a-x86-64.s
new file mode 100644
index 0000000..5bfc9e0
--- /dev/null
+++ b/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-13a-x86-64.s
@@ -0,0 +1,10 @@
+	.text
+        .type foo, @function
+	.global
+foo:
+        movl xxx(%rip), %eax
+        ret
+
+	.data
+xxx:
+	.quad ifunc 
diff --git a/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-13b-i386.s b/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-13b-i386.s
new file mode 100644
index 0000000..3560394
--- /dev/null
+++ b/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-13b-i386.s
@@ -0,0 +1,5 @@
+	.text
+        .type ifunc, @gnu_indirect_function
+	.globl ifunc
+ifunc:
+        ret
diff --git a/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-13b-x86-64.s b/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-13b-x86-64.s
new file mode 100644
index 0000000..3560394
--- /dev/null
+++ b/binutils/binutils-2.21/ld/testsuite/ld-ifunc/ifunc-13b-x86-64.s
@@ -0,0 +1,5 @@
+	.text
+        .type ifunc, @gnu_indirect_function
+	.globl ifunc
+ifunc:
+        ret
diff --git a/binutils/binutils-2.21/libiberty/cp-demangle.c b/binutils/binutils-2.21/libiberty/cp-demangle.c
index 290967e..8b0b825 100644
--- a/binutils/binutils-2.21/libiberty/cp-demangle.c
+++ b/binutils/binutils-2.21/libiberty/cp-demangle.c
@@ -416,9 +416,6 @@
 
 static struct demangle_component *d_unnamed_type (struct d_info *);
 
-static struct demangle_component *
-d_clone_suffix (struct d_info *, struct demangle_component *);
-
 static int
 d_add_substitution (struct d_info *, struct demangle_component *);
 
@@ -804,7 +801,6 @@
     case DEMANGLE_COMPONENT_LITERAL_NEG:
     case DEMANGLE_COMPONENT_COMPOUND_NAME:
     case DEMANGLE_COMPONENT_VECTOR_TYPE:
-    case DEMANGLE_COMPONENT_CLONE:
       if (left == NULL || right == NULL)
 	return NULL;
       break;
@@ -1026,7 +1022,7 @@
   return p;
 }
 
-/* <mangled-name> ::= _Z <encoding> [<clone-suffix>]*
+/* <mangled-name> ::= _Z <encoding>
 
    TOP_LEVEL is non-zero when called at the top level.  */
 
@@ -1034,8 +1030,6 @@
 struct demangle_component *
 cplus_demangle_mangled_name (struct d_info *di, int top_level)
 {
-  struct demangle_component *p;
-
   if (! d_check_char (di, '_')
       /* Allow missing _ if not at toplevel to work around a
 	 bug in G++ abi-version=2 mangling; see the comment in
@@ -1044,18 +1038,7 @@
     return NULL;
   if (! d_check_char (di, 'Z'))
     return NULL;
-  p = d_encoding (di, top_level);
-
-  /* If at top level and parsing parameters, check for a clone
-     suffix.  */
-  if (top_level && (di->options & DMGL_PARAMS) != 0)
-    while (d_peek_char (di) == '.'
-	   && (IS_LOWER (d_peek_next_char (di))
-	       || d_peek_next_char (di) == '_'
-	       || IS_DIGIT (d_peek_next_char (di))))
-      p = d_clone_suffix (di, p);
-
-  return p;
+  return d_encoding (di, top_level);
 }
 
 /* Return whether a function should have a return type.  The argument
@@ -2349,7 +2332,7 @@
       struct demangle_component *type;
 
       char peek = d_peek_char (di);
-      if (peek == '\0' || peek == 'E' || peek == '.')
+      if (peek == '\0' || peek == 'E')
 	break;
       type = cplus_demangle_type (di);
       if (type == NULL)
@@ -3069,33 +3052,6 @@
   return ret;
 }
 
-/* <clone-suffix> ::= [ . <clone-type-identifier> ] [ . <nonnegative number> ]*
-*/
-
-static struct demangle_component *
-d_clone_suffix (struct d_info *di, struct demangle_component *encoding)
-{
-  const char *suffix = d_str (di);
-  const char *pend = suffix;
-  struct demangle_component *n;
-
-  if (*pend == '.' && (IS_LOWER (pend[1]) || pend[1] == '_'))
-    {
-      pend += 2;
-      while (IS_LOWER (*pend) || *pend == '_')
-	++pend;
-    }
-  while (*pend == '.' && IS_DIGIT (pend[1]))
-    {
-      pend += 2;
-      while (IS_DIGIT (*pend))
-	++pend;
-    }
-  d_advance (di, pend - suffix);
-  n = d_make_name (di, suffix, pend - suffix);
-  return d_make_comp (di, DEMANGLE_COMPONENT_CLONE, encoding, n);
-}
-
 /* Add a new substitution.  */
 
 static int
@@ -4373,13 +4329,6 @@
       d_append_char (dpi, '}');
       return;
 
-    case DEMANGLE_COMPONENT_CLONE:
-      d_print_comp (dpi, d_left (dc));
-      d_append_string (dpi, " [clone ");
-      d_print_comp (dpi, d_right (dc));
-      d_append_char (dpi, ']');
-      return;
-
     default:
       d_print_error (dpi);
       return;
diff --git a/binutils/binutils-2.21/libiberty/testsuite/demangle-expected b/binutils/binutils-2.21/libiberty/testsuite/demangle-expected
index 448d757..5b15445 100644
--- a/binutils/binutils-2.21/libiberty/testsuite/demangle-expected
+++ b/binutils/binutils-2.21/libiberty/testsuite/demangle-expected
@@ -4092,50 +4092,3 @@
 --format=auto
 _ZN3Psi7VariantIIcPKcEE5visitIIRZN11VariantTest9TestVisit11test_methodEvEUlS2_E0_RZNS6_11test_methodEvEUlcE1_RZNS6_11test_methodEvEUlNS_4NoneEE_EEENS_13VariantDetail19SelectVisitorResultIIDpT_EE4typeEDpOSG_
 Psi::VariantDetail::SelectVisitorResult<VariantTest::TestVisit::test_method()::{lambda(char const*)#2}&, VariantTest::TestVisit::test_method()::{lambda(char)#3}&, VariantTest::TestVisit::test_method()::{lambda(Psi::None)#1}&>::type Psi::Variant<char, char const*>::visit<VariantTest::TestVisit::test_method()::{lambda(char const*)#2}&, VariantTest::TestVisit::test_method()::{lambda(char)#3}&, VariantTest::TestVisit::test_method()::{lambda(Psi::None)#1}&>((VariantTest::TestVisit::test_method()::{lambda(Psi::None)#1}&&&)...)
-#
-# Clone suffix tests
-#
---format=gnu-v3 --no-params
-_Z3fo5n.clone.1
-fo5(__int128) [clone .clone.1]
-fo5
-#
---format=gnu-v3 --no-params
-_Z3fo5n.constprop.2
-fo5(__int128) [clone .constprop.2]
-fo5
-#
---format=gnu-v3 --no-params
-_Z3fo5n.isra.3
-fo5(__int128) [clone .isra.3]
-fo5
-#
---format=gnu-v3 --no-params
-_Z3fo5n.part.4
-fo5(__int128) [clone .part.4]
-fo5
-#
---format=gnu-v3 --no-params
-_Z12to_be_clonediPv.clone.0
-to_be_cloned(int, void*) [clone .clone.0]
-to_be_cloned
-#
---format=gnu-v3 --no-params
-_Z3fooi.1988
-foo(int) [clone .1988]
-foo
-#
---format=gnu-v3 --no-params
-_Z3fooi.part.9.165493.constprop.775.31805
-foo(int) [clone .part.9.165493] [clone .constprop.775.31805]
-foo
-#
---format=gnu-v3 --no-params
-_Z2f1IiEvT_S0_S0_._omp_fn.2
-void f1<int>(int, int, int) [clone ._omp_fn.2]
-f1<int>
-#
---format=gnu-v3 --no-params
-_Z3fooi._omp_cpyfn.6
-foo(int) [clone ._omp_cpyfn.6]
-foo