This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch to enhance MIPS GOT page estimates


This patch refines the MIPS linker's estimate of an upper bound on the 
number of GOT page entries required.

At present, this is based on the total loadable size of the linked object.  
This causes problems for cases with very large loadable size (certain 
sorts of scientific code with > 512MB of statically allocated arrays) 
where the estimate exceeds the total available size of the GOT.  In 
practice however far fewer local relocations (generally against section 
symbols) are needed than the loadable size would suggest.  So this patch 
adds an alternative estimate based on the offsets actually seen relative 
to each symbol, and then picks the smaller of the two estimates.

Tested with cross to mips-linux-gnu, binutils testsuites; also made sure 
it will build a working glibc for mips64el-linux-gnu (O32, N32 and N64).  
OK to commit?

bfd:
2007-09-18  Richard Sandiford  <richard@codesourcery.com>

	* elfxx-mips.c (mips_got_page_range): New structure.
	(mips_got_page_entry): Likewise.
	(mips_got_info): Add page_gotno and got_page_entries fields.
	(mips_got_page_entry_hash, mips_got_page_entry_eq): New functions.
	(mips_elf_pages_for_range, mips_elf_record_got_page_entry): Likewise.
	(mips_elf_make_got_per_bfd): Initialize page_gotno and
	got_page_entries.
	(mips_elf_multi_got, mips_elf_create_got_section): Likewise.
	(mips_elf_rel_relocation_p, mips_elf_read_rel_addend)
	(mips_elf_add_lo16_rel_addend, mips_elf_get_section_contents): New
	functions, split out from...
	(_bfd_mips_elf_relocate_section): ...here.
	(_bfd_mips_elf_check_relocs): Record GOT page entries too.
	(_bfd_mips_relax_section): Use mips_elf_get_section_contents.
	(_bfd_mips_elf_always_size_sections): Use the smaller of the
	loadable_size- and page_gotno-derived estimates.

ld/testsuite:
2007-09-18  Richard Sandiford  <richard@codesourcery.com>
            Joseph Myers  <joseph@codesourcery.com>

	* ld-mips-elf/got-page-1.d, ld-mips-elf/got-page-1.s,
	* ld-mips-elf/got-page-1.ld: New tests.
	* ld-mips-elf/mips-elf.exp: Run it.
	* ld-mips-elf/multi-got-1.d, ld-mips-elf/multi-got-no-shared.d,
	ld-mips-elf/tls-hidden2-got.d, ld-mips-elf/tls-hidden2.d,
	ld-mips-elf/tls-hidden3.d, ld-mips-elf/tls-hidden3.got,
	ld-mips-elf/tls-hidden3.r, ld-mips-elf/tls-hidden4.got,
	ld-mips-elf/tls-hidden4.r, ld-mips-elf/tls-multi-got-1.d,
	ld-mips-elf/tls-multi-got-1.got, ld-mips-elf/tls-multi-got-1.r,
	ld-mips-elf/tlsbin-o32.d, ld-mips-elf/tlsbin-o32.got,
	ld-mips-elf/tlsdyn-o32-1.d, ld-mips-elf/tlsdyn-o32-1.got,
	ld-mips-elf/tlsdyn-o32-2.d, ld-mips-elf/tlsdyn-o32-2.got,
	ld-mips-elf/tlsdyn-o32-3.d, ld-mips-elf/tlsdyn-o32-3.got,
	ld-mips-elf/tlsdyn-o32.d, ld-mips-elf/tlsdyn-o32.got,
	ld-mips-elf/tlslib-o32-hidden.got, ld-mips-elf/tlslib-o32-ver.got,
	ld-mips-elf/tlslib-o32.d, ld-mips-elf/tlslib-o32.got: Update for
	GOT allocation changes.

Index: bfd/elfxx-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-mips.c,v
retrieving revision 1.213
diff -u -r1.213 elfxx-mips.c
--- bfd/elfxx-mips.c	13 Aug 2007 21:16:38 -0000	1.213
+++ bfd/elfxx-mips.c	17 Sep 2007 23:13:15 -0000
@@ -112,6 +112,30 @@
   long gotidx;
 };
 
+/* This structure describes a range of addends: [MIN_ADDEND, MAX_ADDEND].
+   The structures form a non-overlapping list that is sorted by increasing
+   MIN_ADDEND.  */
+struct mips_got_page_range
+{
+  struct mips_got_page_range *next;
+  bfd_signed_vma min_addend;
+  bfd_signed_vma max_addend;
+};
+
+/* This structure describes the range of addends that are applied to page
+   relocations against a given symbol.  */
+struct mips_got_page_entry
+{
+  /* The input bfd in which the symbol is defined.  */
+  bfd *abfd;
+  /* The index of the symbol, as stored in the relocation r_info.  */
+  long symndx;
+  /* The ranges for this page entry.  */
+  struct mips_got_page_range *ranges;
+  /* The maximum number of page entries needed for RANGES.  */
+  bfd_vma num_pages;
+};
+
 /* This structure is used to hold .got information when linking.  */
 
 struct mips_got_info
@@ -126,12 +150,16 @@
   /* The first unused TLS .got entry.  Used only during
      mips_elf_initialize_tls_index.  */
   unsigned int tls_assigned_gotno;
-  /* The number of local .got entries.  */
+  /* The number of local .got entries, eventually including page entries.  */
   unsigned int local_gotno;
+  /* The maximum number of page entries needed.  */
+  unsigned int page_gotno;
   /* The number of local .got entries we have used.  */
   unsigned int assigned_gotno;
   /* A hash table holding members of the got.  */
   struct htab *got_entries;
+  /* A hash table of mips_got_page_entry structures.  */
+  struct htab *got_page_entries;
   /* A hash table mapping input bfds to other mips_got_info.  NULL
      unless multi-got was necessary.  */
   struct htab *bfd2got;
@@ -2039,6 +2067,25 @@
 	? e1->abfd == e2->abfd && e1->d.address == e2->d.address
 	: e1->d.h == e2->d.h);
 }
+
+static hashval_t
+mips_got_page_entry_hash (const void *entry_)
+{
+  const struct mips_got_page_entry *entry;
+
+  entry = (const struct mips_got_page_entry *) entry_;
+  return entry->abfd->id + entry->symndx;
+}
+
+static int
+mips_got_page_entry_eq (const void *entry1_, const void *entry2_)
+{
+  const struct mips_got_page_entry *entry1, *entry2;
+
+  entry1 = (const struct mips_got_page_entry *) entry1_;
+  entry2 = (const struct mips_got_page_entry *) entry2_;
+  return entry1->abfd == entry2->abfd && entry1->symndx == entry2->symndx;
+}
 
 /* Return the dynamic relocation section.  If it doesn't exist, try to
    create a new it if CREATE_P, otherwise return NULL.  Also return NULL
@@ -2952,6 +2999,104 @@
 
   return TRUE;
 }
+
+/* Return the maximum number of GOT page entries required for RANGE.  */
+
+static bfd_vma
+mips_elf_pages_for_range (const struct mips_got_page_range *range)
+{
+  return (range->max_addend - range->min_addend + 0x1ffff) >> 16;
+}
+
+/* Record that ABFD has a page relocation against symbol SYMNDX and that
+   ADDEND is the addend for that relocation.  G is the GOT information.  */
+
+static bfd_boolean
+mips_elf_record_got_page_entry (bfd *abfd, long symndx, bfd_signed_vma addend,
+				struct mips_got_info *g)
+{
+  struct mips_got_page_entry lookup, *entry;
+  struct mips_got_page_range **range_ptr, *range;
+  bfd_vma old_pages, new_pages;
+  void **loc;
+
+  /* Find the mips_got_page_entry hash table entry for this symbol.  */
+  lookup.abfd = abfd;
+  lookup.symndx = symndx;
+  loc = htab_find_slot (g->got_page_entries, &lookup, INSERT);
+  if (loc == NULL)
+    return FALSE;
+
+  /* Create a mips_got_page_entry if this is the first time we've
+     seen the symbol.  */
+  entry = (struct mips_got_page_entry *) *loc;
+  if (!entry)
+    {
+      entry = bfd_alloc (abfd, sizeof (*entry));
+      if (!entry)
+	return FALSE;
+
+      entry->abfd = abfd;
+      entry->symndx = symndx;
+      entry->ranges = NULL;
+      entry->num_pages = 0;
+      *loc = entry;
+    }
+
+  /* Skip over ranges whose maximum extent cannot share a page entry
+     with ADDEND.  */
+  range_ptr = &entry->ranges;
+  while (*range_ptr && addend > (*range_ptr)->max_addend + 0xffff)
+    range_ptr = &(*range_ptr)->next;
+
+  /* If we scanned to the end of the list, or found a range whose
+     minimum extent cannot share a page entry with ADDEND, create
+     a new singleton range.  */
+  range = *range_ptr;
+  if (!range || addend < range->min_addend - 0xffff)
+    {
+      range = bfd_alloc (abfd, sizeof (*range));
+      if (!range)
+	return FALSE;
+
+      range->next = *range_ptr;
+      range->min_addend = addend;
+      range->max_addend = addend;
+
+      *range_ptr = range;
+      entry->num_pages++;
+      g->page_gotno++;
+      return TRUE;
+    }
+
+  /* Remember how many pages the old range contributed.  */
+  old_pages = mips_elf_pages_for_range (range);
+
+  /* Update the ranges.  */
+  if (addend < range->min_addend)
+    range->min_addend = addend;
+  else if (addend > range->max_addend)
+    {
+      if (range->next && addend >= range->next->min_addend - 0xffff)
+	{
+	  old_pages += mips_elf_pages_for_range (range->next);
+	  range->max_addend = range->next->max_addend;
+	  range->next = range->next->next;
+	}
+      else
+	range->max_addend = addend;
+    }
+
+  /* Record any change in the total estimate.  */
+  new_pages = mips_elf_pages_for_range (range);
+  if (old_pages != new_pages)
+    {
+      entry->num_pages += new_pages - old_pages;
+      g->page_gotno += new_pages - old_pages;
+    }
+
+  return TRUE;
+}
 
 /* Compute the hash value of the bfd in a bfd2got hash entry.  */
 
@@ -3040,6 +3185,7 @@
       g->global_gotsym = NULL;
       g->global_gotno = 0;
       g->local_gotno = 0;
+      g->page_gotno = 0;
       g->assigned_gotno = -1;
       g->tls_gotno = 0;
       g->tls_assigned_gotno = 0;
@@ -3052,6 +3198,14 @@
 	  return 0;
 	}
 
+      g->got_page_entries = htab_try_create (1, mips_got_page_entry_hash,
+					     mips_got_page_entry_eq, NULL);
+      if (g->got_page_entries == NULL)
+	{
+	  arg->obfd = 0;
+	  return 0;
+	}
+
       g->bfd2got = NULL;
       g->next = NULL;
     }
@@ -3447,6 +3601,7 @@
       g->next->global_gotsym = NULL;
       g->next->global_gotno = 0;
       g->next->local_gotno = 0;
+      g->next->page_gotno = 0;
       g->next->tls_gotno = 0;
       g->next->assigned_gotno = 0;
       g->next->tls_assigned_gotno = 0;
@@ -3456,6 +3611,11 @@
 					      NULL);
       if (g->next->got_entries == NULL)
 	return FALSE;
+      g->next->got_page_entries = htab_try_create (1, mips_got_page_entry_hash,
+						   mips_got_page_entry_eq,
+						   NULL);
+      if (g->next->got_page_entries == NULL)
+	return FALSE;
       g->next->bfd2got = NULL;
     }
   else
@@ -3812,6 +3972,7 @@
   g->global_gotno = 0;
   g->tls_gotno = 0;
   g->local_gotno = MIPS_RESERVED_GOTNO (info);
+  g->page_gotno = 0;
   g->assigned_gotno = MIPS_RESERVED_GOTNO (info);
   g->bfd2got = NULL;
   g->next = NULL;
@@ -3820,6 +3981,10 @@
 				    mips_elf_got_entry_eq, NULL);
   if (g->got_entries == NULL)
     return FALSE;
+  g->got_page_entries = htab_try_create (1, mips_got_page_entry_hash,
+					 mips_got_page_entry_eq, NULL);
+  if (g->got_page_entries == NULL)
+    return FALSE;
   mips_elf_section_data (s)->u.got_info = g;
   mips_elf_section_data (s)->elf.this_hdr.sh_flags
     |= SHF_ALLOC | SHF_WRITE | SHF_MIPS_GPREL;
@@ -6111,6 +6276,127 @@
   return TRUE;
 }
 
+/* Return true if relocation REL against section SEC is a REL rather than
+   RELA relocation.  RELOCS is the first relocation in the section and
+   ABFD is the bfd that contains SEC.  */
+
+static bfd_boolean
+mips_elf_rel_relocation_p (bfd *abfd, asection *sec,
+			   const Elf_Internal_Rela *relocs,
+			   const Elf_Internal_Rela *rel)
+{
+  Elf_Internal_Shdr *rel_hdr;
+  const struct elf_backend_data *bed;
+
+  /* To determine which flavor or relocation this is, we depend on the
+     fact that the INPUT_SECTION's REL_HDR is read before its REL_HDR2.  */
+  rel_hdr = &elf_section_data (sec)->rel_hdr;
+  bed = get_elf_backend_data (abfd);
+  if ((size_t) (rel - relocs)
+      >= (NUM_SHDR_ENTRIES (rel_hdr) * bed->s->int_rels_per_ext_rel))
+    rel_hdr = elf_section_data (sec)->rel_hdr2;
+  return rel_hdr->sh_entsize == MIPS_ELF_REL_SIZE (abfd);
+}
+
+/* Read the addend for REL relocation REL, which belongs to bfd ABFD.
+   HOWTO is the relocation's howto and CONTENTS points to the contents
+   of the section that REL is against.  */
+
+static bfd_vma
+mips_elf_read_rel_addend (bfd *abfd, const Elf_Internal_Rela *rel,
+			  reloc_howto_type *howto, bfd_byte *contents)
+{
+  bfd_byte *location;
+  unsigned int r_type;
+  bfd_vma addend;
+
+  r_type = ELF_R_TYPE (abfd, rel->r_info);
+  location = contents + rel->r_offset;
+
+  /* Get the addend, which is stored in the input file.  */
+  _bfd_mips16_elf_reloc_unshuffle (abfd, r_type, FALSE, location);
+  addend = mips_elf_obtain_contents (howto, rel, abfd, contents);
+  _bfd_mips16_elf_reloc_shuffle (abfd, r_type, FALSE, location);
+
+  return addend & howto->src_mask;
+}
+
+/* REL is a relocation in ABFD that needs a partnering LO16 relocation
+   and *ADDEND is the addend for REL itself.  Look for the LO16 relocation
+   and update *ADDEND with the final addend.  Return true on success
+   or false if the LO16 could not be found.  RELEND is the exclusive
+   upper bound on the relocations for REL's section.  */
+
+static bfd_boolean
+mips_elf_add_lo16_rel_addend (bfd *abfd,
+			      const Elf_Internal_Rela *rel,
+			      const Elf_Internal_Rela *relend,
+			      bfd_byte *contents, bfd_vma *addend)
+{
+  unsigned int r_type, lo16_type;
+  const Elf_Internal_Rela *lo16_relocation;
+  reloc_howto_type *lo16_howto;
+  bfd_vma l;
+
+  r_type = ELF_R_TYPE (abfd, rel->r_info);
+  if (r_type == R_MIPS16_HI16)
+    lo16_type = R_MIPS16_LO16;
+  else
+    lo16_type = R_MIPS_LO16;
+
+  /* The combined value is the sum of the HI16 addend, left-shifted by
+     sixteen bits, and the LO16 addend, sign extended.  (Usually, the
+     code does a `lui' of the HI16 value, and then an `addiu' of the
+     LO16 value.)
+
+     Scan ahead to find a matching LO16 relocation.
+
+     According to the MIPS ELF ABI, the R_MIPS_LO16 relocation must
+     be immediately following.  However, for the IRIX6 ABI, the next
+     relocation may be a composed relocation consisting of several
+     relocations for the same address.  In that case, the R_MIPS_LO16
+     relocation may occur as one of these.  We permit a similar
+     extension in general, as that is useful for GCC.
+
+     In some cases GCC dead code elimination removes the LO16 but keeps
+     the corresponding HI16.  This is strictly speaking a violation of
+     the ABI but not immediately harmful.  */
+  lo16_relocation = mips_elf_next_relocation (abfd, lo16_type, rel, relend);
+  if (lo16_relocation == NULL)
+    return FALSE;
+
+  /* Obtain the addend kept there.  */
+  lo16_howto = MIPS_ELF_RTYPE_TO_HOWTO (abfd, lo16_type, FALSE);
+  l = mips_elf_read_rel_addend (abfd, lo16_relocation, lo16_howto, contents);
+
+  l <<= lo16_howto->rightshift;
+  l = _bfd_mips_elf_sign_extend (l, 16);
+
+  *addend <<= 16;
+  *addend += l;
+  return TRUE;
+}
+
+/* Try to read the contents of section SEC in bfd ABFD.  Return true and
+   store the contents in *CONTENTS on success.  Assume that *CONTENTS
+   already holds the contents if it is nonull on entry.  */
+
+static bfd_boolean
+mips_elf_get_section_contents (bfd *abfd, asection *sec, bfd_byte **contents)
+{
+  if (*contents)
+    return TRUE;
+
+  /* Get cached copy if it exists.  */
+  if (elf_section_data (sec)->this_hdr.contents != NULL)
+    {
+      *contents = elf_section_data (sec)->this_hdr.contents;
+      return TRUE;
+    }
+
+  return bfd_malloc_and_get_section (abfd, sec, contents);
+}
+
 /* Look through the relocs for a section during the first phase, and
    allocate space in the global offset table.  */
 
@@ -6130,6 +6416,9 @@
   asection *sreloc;
   const struct elf_backend_data *bed;
   struct mips_elf_link_hash_table *htab;
+  bfd_byte *contents;
+  bfd_vma addend;
+  reloc_howto_type *howto;
 
   if (info->relocatable)
     return TRUE;
@@ -6394,6 +6683,7 @@
   sreloc = NULL;
   bed = get_elf_backend_data (abfd);
   rel_end = relocs + sec->reloc_count * bed->s->int_rels_per_ext_rel;
+  contents = NULL;
   for (rel = relocs; rel < rel_end; ++rel)
     {
       unsigned long r_symndx;
@@ -6549,9 +6839,7 @@
 	case R_MIPS_GOT_PAGE:
 	  /* If this is a global, overridable symbol, GOT_PAGE will
 	     decay to GOT_DISP, so we'll need a GOT entry for it.  */
-	  if (h == NULL)
-	    break;
-	  else
+	  if (h)
 	    {
 	      struct mips_elf_link_hash_entry *hmips =
 		(struct mips_elf_link_hash_entry *) h;
@@ -6564,13 +6852,37 @@
 	      if (hmips->root.def_regular
 		  && ! (info->shared && ! info->symbolic
 			&& ! hmips->root.forced_local))
-		break;
+		h = NULL;
 	    }
 	  /* Fall through.  */
 
 	case R_MIPS_GOT16:
 	case R_MIPS_GOT_HI16:
 	case R_MIPS_GOT_LO16:
+	  if (!h)
+	    {
+	      /* This relocation needs a page entry in the GOT.  */
+	      if (mips_elf_rel_relocation_p (abfd, sec, relocs, rel))
+		{
+		  if (!mips_elf_get_section_contents (abfd, sec, &contents))
+		    return FALSE;
+		  howto = MIPS_ELF_RTYPE_TO_HOWTO (abfd, r_type, FALSE);
+		  addend = mips_elf_read_rel_addend (abfd, rel,
+						     howto, contents);
+		  if (r_type == R_MIPS_GOT16)
+		    mips_elf_add_lo16_rel_addend (abfd, rel, rel_end,
+						  contents, &addend);
+		  else
+		    addend <<= howto->rightshift;
+		}
+	      else
+		addend = rel->r_addend;
+	      if (!mips_elf_record_got_page_entry (abfd, r_symndx, addend, g))
+		return FALSE;
+	      break;
+	    }
+	  /* Fall through.  */
+
 	case R_MIPS_GOT_DISP:
 	  if (h && ! mips_elf_record_global_got_symbol (h, abfd, info, g, 0))
 	    return FALSE;
@@ -6873,17 +7185,8 @@
 	continue;
 
       /* Get the section contents if we haven't done so already.  */
-      if (contents == NULL)
-	{
-	  /* Get cached copy if it exists.  */
-	  if (elf_section_data (sec)->this_hdr.contents != NULL)
-	    contents = elf_section_data (sec)->this_hdr.contents;
-	  else
-	    {
-	      if (!bfd_malloc_and_get_section (abfd, sec, &contents))
-		goto relax_return;
-	    }
-	}
+      if (!mips_elf_get_section_contents (abfd, sec, &contents))
+	goto relax_return;
 
       instruction = bfd_get_32 (abfd, contents + irel->r_offset);
 
@@ -7198,7 +7501,7 @@
   struct mips_got_info *g;
   int i;
   bfd_size_type loadable_size = 0;
-  bfd_size_type local_gotno;
+  bfd_size_type page_gotno;
   bfd_size_type dynsymcount;
   bfd *sub;
   struct mips_elf_count_tls_arg count_tls_arg;
@@ -7279,13 +7582,18 @@
     /* There's no need to allocate page entries for VxWorks; R_MIPS_GOT16
        relocations against local symbols evaluate to "G", and the EABI does
        not include R_MIPS_GOT_PAGE.  */
-    local_gotno = 0;
+    page_gotno = 0;
   else
     /* Assume there are two loadable segments consisting of contiguous
        sections.  Is 5 enough?  */
-    local_gotno = (loadable_size >> 16) + 5;
+    page_gotno = (loadable_size >> 16) + 5;
+
+  /* Choose the smaller of the two estimates; both are intended to be
+     conservative.  */
+  if (page_gotno > g->page_gotno)
+    page_gotno = g->page_gotno;
 
-  g->local_gotno += local_gotno;
+  g->local_gotno += page_gotno;
   s->size += g->local_gotno * MIPS_ELF_GOT_SIZE (output_bfd);
 
   g->global_gotno = i;
@@ -7309,7 +7617,7 @@
      dynamic loader.  */
   if (!htab->is_vxworks && s->size > MIPS_ELF_GOT_MAX_SIZE (info))
     {
-      if (! mips_elf_multi_got (output_bfd, info, g, s, local_gotno))
+      if (! mips_elf_multi_got (output_bfd, info, g, s, page_gotno))
 	return FALSE;
     }
   else
@@ -7803,77 +8111,24 @@
 
       if (!use_saved_addend_p)
 	{
-	  Elf_Internal_Shdr *rel_hdr;
-
 	  /* If these relocations were originally of the REL variety,
 	     we must pull the addend out of the field that will be
 	     relocated.  Otherwise, we simply use the contents of the
-	     RELA relocation.  To determine which flavor or relocation
-	     this is, we depend on the fact that the INPUT_SECTION's
-	     REL_HDR is read before its REL_HDR2.  */
-	  rel_hdr = &elf_section_data (input_section)->rel_hdr;
-	  if ((size_t) (rel - relocs)
-	      >= (NUM_SHDR_ENTRIES (rel_hdr) * bed->s->int_rels_per_ext_rel))
-	    rel_hdr = elf_section_data (input_section)->rel_hdr2;
-	  if (rel_hdr->sh_entsize == MIPS_ELF_REL_SIZE (input_bfd))
+	     RELA relocation.  */
+	  if (mips_elf_rel_relocation_p (input_bfd, input_section,
+					 relocs, rel))
 	    {
-	      bfd_byte *location = contents + rel->r_offset;
-
-	      /* Note that this is a REL relocation.  */
 	      rela_relocation_p = FALSE;
-
-	      /* Get the addend, which is stored in the input file.  */
-	      _bfd_mips16_elf_reloc_unshuffle (input_bfd, r_type, FALSE,
-					       location);
-	      addend = mips_elf_obtain_contents (howto, rel, input_bfd,
-						 contents);
-	      _bfd_mips16_elf_reloc_shuffle(input_bfd, r_type, FALSE,
-					    location);
-
-	      addend &= howto->src_mask;
-
-	      /* For some kinds of relocations, the ADDEND is a
-		 combination of the addend stored in two different
-		 relocations.   */
-	      if (r_type == R_MIPS_HI16 || r_type == R_MIPS16_HI16
+	      addend = mips_elf_read_rel_addend (input_bfd, rel,
+						 howto, contents);
+	      if (r_type == R_MIPS_HI16
+		  || r_type == R_MIPS16_HI16
 		  || (r_type == R_MIPS_GOT16
 		      && mips_elf_local_relocation_p (input_bfd, rel,
 						      local_sections, FALSE)))
 		{
-		  const Elf_Internal_Rela *lo16_relocation;
-		  reloc_howto_type *lo16_howto;
-		  int lo16_type;
-
-		  if (r_type == R_MIPS16_HI16)
-		    lo16_type = R_MIPS16_LO16;
-		  else
-		    lo16_type = R_MIPS_LO16;
-
-		  /* The combined value is the sum of the HI16 addend,
-		     left-shifted by sixteen bits, and the LO16
-		     addend, sign extended.  (Usually, the code does
-		     a `lui' of the HI16 value, and then an `addiu' of
-		     the LO16 value.)
-
-		     Scan ahead to find a matching LO16 relocation.
-
-		     According to the MIPS ELF ABI, the R_MIPS_LO16
-		     relocation must be immediately following.
-		     However, for the IRIX6 ABI, the next relocation
-		     may be a composed relocation consisting of
-		     several relocations for the same address.  In
-		     that case, the R_MIPS_LO16 relocation may occur
-		     as one of these.  We permit a similar extension
-		     in general, as that is useful for GCC.
-
-		     In some cases GCC dead code elimination removes
-		     the LO16 but keeps the corresponding HI16.  This
-		     is strictly speaking a violation of the ABI but
-		     not immediately harmful.  */
-		  lo16_relocation = mips_elf_next_relocation (input_bfd,
-							      lo16_type,
-							      rel, relend);
-		  if (lo16_relocation == NULL)
+		  if (!mips_elf_add_lo16_rel_addend (input_bfd, rel, relend,
+						     contents, &addend))
 		    {
 		      const char *name;
 
@@ -7888,32 +8143,6 @@
 			 input_bfd, input_section, name, howto->name,
 			 rel->r_offset);
 		    }
-		  else
-		    {
-		      bfd_byte *lo16_location;
-		      bfd_vma l;
-
-		      lo16_location = contents + lo16_relocation->r_offset;
-
-		      /* Obtain the addend kept there.  */
-		      lo16_howto = MIPS_ELF_RTYPE_TO_HOWTO (input_bfd,
-							    lo16_type, FALSE);
-		      _bfd_mips16_elf_reloc_unshuffle (input_bfd, lo16_type,
-						       FALSE, lo16_location);
-		      l = mips_elf_obtain_contents (lo16_howto,
-						    lo16_relocation,
-						    input_bfd, contents);
-		      _bfd_mips16_elf_reloc_shuffle (input_bfd, lo16_type,
-						     FALSE, lo16_location);
-		      l &= lo16_howto->src_mask;
-		      l <<= lo16_howto->rightshift;
-		      l = _bfd_mips_elf_sign_extend (l, 16);
-
-		      addend <<= 16;
-
-		      /* Compute the combined addend.  */
-		      addend += l;
-		    }
 		}
 	      else
 		addend <<= howto->rightshift;
Index: ld/testsuite/ld-mips-elf/got-page-1.d
===================================================================
RCS file: ld/testsuite/ld-mips-elf/got-page-1.d
diff -N ld/testsuite/ld-mips-elf/got-page-1.d
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ld/testsuite/ld-mips-elf/got-page-1.d	17 Sep 2007 23:13:17 -0000
@@ -0,0 +1,10 @@
+#name: GOT page test 1
+#source: got-page-1.s
+#ld: -T got-page-1.ld -shared
+#readelf: -d
+#
+# There should be 10 page entries and 2 reserved entries
+#
+#...
+.* \(MIPS_LOCAL_GOTNO\) *12
+#pass
Index: ld/testsuite/ld-mips-elf/got-page-1.ld
===================================================================
RCS file: ld/testsuite/ld-mips-elf/got-page-1.ld
diff -N ld/testsuite/ld-mips-elf/got-page-1.ld
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ld/testsuite/ld-mips-elf/got-page-1.ld	17 Sep 2007 23:13:17 -0000
@@ -0,0 +1,31 @@
+SECTIONS
+{
+  . = 0x80000;
+  .interp : { *(.interp) }
+  .hash : { *(.hash) }
+  .dynsym : { *(.dynsym) }
+  .dynstr : { *(.dynstr) }
+
+  . = ALIGN (0x400);
+  .rel.dyn : { *(.rel.dyn) }
+
+  . = ALIGN (0x400);
+  .MIPS.stubs : { *(.MIPS.stubs) }
+
+  . = ALIGN (0x400);
+  .text : { *(.text) }
+
+  . = ALIGN (0x10000);
+  _gp = . + 0x7ff0;
+  .got : { *(.got) }
+
+  . = ALIGN (0x400);
+  .bss : { *(.bss .bss.*) }
+
+  /DISCARD/ : { *(.reginfo) }
+}
+
+VERSION
+{
+  { local: *; };
+}
Index: ld/testsuite/ld-mips-elf/got-page-1.s
===================================================================
RCS file: ld/testsuite/ld-mips-elf/got-page-1.s
diff -N ld/testsuite/ld-mips-elf/got-page-1.s
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ld/testsuite/ld-mips-elf/got-page-1.s	17 Sep 2007 23:13:17 -0000
@@ -0,0 +1,46 @@
+	# See below.
+	lw	$4,%got(foo+0x120000)($gp)
+	addiu	$4,$4,%lo(foo+0x120000)
+
+	# 2 pages
+	lw	$4,%got(foo-0x8000)($gp)
+	addiu	$4,$4,%lo(foo-0x8000)
+	lw	$4,%got(foo+0x800)($gp)
+	addiu	$4,$4,%lo(foo+0x8000)
+
+	# 2 pages
+	lw	$4,%got(foo-0x1000000)($gp)
+	addiu	$4,$4,%lo(foo-0x1000000)
+	lw	$4,%got(foo-0xffffff)($gp)
+	addiu	$4,$4,%lo(foo-0xffffff)
+
+	# 1 page
+	lw	$4,%got(foo+0x120000)($gp)
+	addiu	$4,$4,%lo(foo+0x120000)
+
+	# 5 pages
+	lw	$4,%got(bar)($gp)
+	addiu	$4,$4,%lo(bar)
+	lw	$4,%got(bar+0x20000)($gp)
+	addiu	$4,$4,%lo(bar+0x20000)
+	lw	$4,%got(bar+0x40000)($gp)
+	addiu	$4,$4,%lo(bar+0x40000)
+	lw	$4,%got(bar+0x30000)($gp)
+	addiu	$4,$4,%lo(bar+0x30000)
+	lw	$4,%got(bar+0x10000)($gp)
+	addiu	$4,$4,%lo(bar+0x10000)
+	lw	$4,%got(bar+0x38000)($gp)
+	addiu	$4,$4,%lo(bar+0x38000)
+	lw	$4,%got(bar+0x14000)($gp)
+	addiu	$4,$4,%lo(bar+0x14000)
+	lw	$4,%got(bar+0x2c000)($gp)
+	addiu	$4,$4,%lo(bar+0x2c000)
+	lw	$4,%got(bar+0x02000)($gp)
+	addiu	$4,$4,%lo(bar+0x02000)
+
+	.section .bss.foo,"aw",@nobits
+	.fill	0x800000
+foo:	.fill	0x800000
+
+	.section .bss.bar,"aw",@nobits
+bar:	.fill	0xc00000
Index: ld/testsuite/ld-mips-elf/mips-elf.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mips-elf/mips-elf.exp,v
retrieving revision 1.47
diff -u -r1.47 mips-elf.exp
--- ld/testsuite/ld-mips-elf/mips-elf.exp	13 Aug 2007 21:16:39 -0000	1.47
+++ ld/testsuite/ld-mips-elf/mips-elf.exp	17 Sep 2007 23:13:17 -0000
@@ -142,6 +142,7 @@
 
 if { $linux_gnu } {
     run_dump_test "textrel-1"
+    run_dump_test "got-page-1"
 }
 
 if $has_newabi {
Index: ld/testsuite/ld-mips-elf/multi-got-1.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mips-elf/multi-got-1.d,v
retrieving revision 1.10
diff -u -r1.10 multi-got-1.d
--- ld/testsuite/ld-mips-elf/multi-got-1.d	20 Oct 2006 07:58:17 -0000	1.10
+++ ld/testsuite/ld-mips-elf/multi-got-1.d	17 Sep 2007 23:13:17 -0000
@@ -19,7 +19,7 @@
  0x70000001 \(MIPS_RLD_VERSION\)           1
  0x70000005 \(MIPS_FLAGS\)                 NOTPOT
  0x70000006 \(MIPS_BASE_ADDRESS\)          0
- 0x7000000a \(MIPS_LOCAL_GOTNO\)           12
+ 0x7000000a \(MIPS_LOCAL_GOTNO\)           2
  0x70000011 \(MIPS_SYMTABNO\)              [0-9]+
  0x70000012 \(MIPS_UNREFEXTNO\)            [0-9]+
  0x70000013 \(MIPS_GOTSYM\)                0x[0-9a-f]+
Index: ld/testsuite/ld-mips-elf/multi-got-no-shared.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mips-elf/multi-got-no-shared.d,v
retrieving revision 1.3
diff -u -r1.3 multi-got-no-shared.d
--- ld/testsuite/ld-mips-elf/multi-got-no-shared.d	12 Jun 2006 11:35:45 -0000	1.3
+++ ld/testsuite/ld-mips-elf/multi-got-no-shared.d	17 Sep 2007 23:13:17 -0000
@@ -9,10 +9,10 @@
 
 Disassembly of section \.text:
 004000b0 <[^>]*> 3c1c0043 	lui	gp,0x43
-004000b4 <[^>]*> 279c9ff0 	addiu	gp,gp,-24592
+004000b4 <[^>]*> 279c9a00 	addiu	gp,gp,-26112
 004000b8 <[^>]*> afbc0008 	sw	gp,8\(sp\)
 #...
 00408d60 <[^>]*> 3c1c0044 	lui	gp,0x44
-00408d64 <[^>]*> 279cb960 	addiu	gp,gp,-18080
+00408d64 <[^>]*> 279cb348 	addiu	gp,gp,-19640
 00408d68 <[^>]*> afbc0008 	sw	gp,8\(sp\)
 #pass
Index: ld/testsuite/ld-mips-elf/tls-hidden2-got.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mips-elf/tls-hidden2-got.d,v
retrieving revision 1.1
diff -u -r1.1 tls-hidden2-got.d
--- ld/testsuite/ld-mips-elf/tls-hidden2-got.d	4 Feb 2006 08:29:58 -0000	1.1
+++ ld/testsuite/ld-mips-elf/tls-hidden2-got.d	17 Sep 2007 23:13:17 -0000
@@ -2,5 +2,4 @@
 .*file format.*
 
 Contents of section \.got:
- *[0-9a-f]* 00000000 80000000 00000000 00000000 *\..*
- *[0-9a-f]* 00000000 00000000 00000000 00000ba8 *\..*
+ *[0-9a-f]* 00000000 80000000 00000ba8          *\..*
Index: ld/testsuite/ld-mips-elf/tls-hidden2.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mips-elf/tls-hidden2.d,v
retrieving revision 1.1
diff -u -r1.1 tls-hidden2.d
--- ld/testsuite/ld-mips-elf/tls-hidden2.d	4 Feb 2006 08:29:58 -0000	1.1
+++ ld/testsuite/ld-mips-elf/tls-hidden2.d	17 Sep 2007 23:13:17 -0000
@@ -4,7 +4,7 @@
 Disassembly of section \.text:
 
 .* <.*>:
-.*:	8f82802c *	lw	v0,-32724\(gp\)
+.*:	8f828018 *	lw	v0,-32744\(gp\)
 	\.\.\.
-.*:	8f82802c *	lw	v0,-32724\(gp\)
+.*:	8f828018 *	lw	v0,-32744\(gp\)
 	\.\.\.
Index: ld/testsuite/ld-mips-elf/tls-hidden3.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mips-elf/tls-hidden3.d,v
retrieving revision 1.1
diff -u -r1.1 tls-hidden3.d
--- ld/testsuite/ld-mips-elf/tls-hidden3.d	27 Mar 2006 11:30:54 -0000	1.1
+++ ld/testsuite/ld-mips-elf/tls-hidden3.d	17 Sep 2007 23:13:17 -0000
@@ -14,11 +14,11 @@
 # Any order would be acceptable, but it must match the .got dump.
 #
 00080c00 <\.text>:
-   80c00:	8f848030 	lw	a0,-32720\(gp\)
-   80c04:	8f84803c 	lw	a0,-32708\(gp\)
-   80c08:	8f848034 	lw	a0,-32716\(gp\)
-   80c0c:	8f848038 	lw	a0,-32712\(gp\)
-   80c10:	8f848030 	lw	a0,-32720\(gp\)
-   80c14:	8f84803c 	lw	a0,-32708\(gp\)
-   80c18:	8f848034 	lw	a0,-32716\(gp\)
-   80c1c:	8f848038 	lw	a0,-32712\(gp\)
+   80c00:	8f84801c 	lw	a0,-32740\(gp\)
+   80c04:	8f848028 	lw	a0,-32728\(gp\)
+   80c08:	8f848020 	lw	a0,-32736\(gp\)
+   80c0c:	8f848024 	lw	a0,-32732\(gp\)
+   80c10:	8f84801c 	lw	a0,-32740\(gp\)
+   80c14:	8f848028 	lw	a0,-32728\(gp\)
+   80c18:	8f848020 	lw	a0,-32736\(gp\)
+   80c1c:	8f848024 	lw	a0,-32732\(gp\)
Index: ld/testsuite/ld-mips-elf/tls-hidden3.got
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mips-elf/tls-hidden3.got,v
retrieving revision 1.1
diff -u -r1.1 tls-hidden3.got
--- ld/testsuite/ld-mips-elf/tls-hidden3.got	27 Mar 2006 11:30:54 -0000	1.1
+++ ld/testsuite/ld-mips-elf/tls-hidden3.got	17 Sep 2007 23:13:17 -0000
@@ -19,6 +19,5 @@
 # Any order would be acceptable, but it must match the .d dump.
 #
 Contents of section \.got:
- 90000 00000000 80000000 00000000 00000000  .*
- 90010 00000000 00000000 00000000 00000000  .*
- 90020 0000abc0 0000abc8 0000abcc 0000abc4  .*
+ 90000 00000000 80000000 00000000 0000abc0  .*
+ 90010 0000abc8 0000abcc 0000abc4           .*
Index: ld/testsuite/ld-mips-elf/tls-hidden3.r
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mips-elf/tls-hidden3.r,v
retrieving revision 1.2
diff -u -r1.2 tls-hidden3.r
--- ld/testsuite/ld-mips-elf/tls-hidden3.r	19 Oct 2006 13:47:10 -0000	1.2
+++ ld/testsuite/ld-mips-elf/tls-hidden3.r	17 Sep 2007 23:13:17 -0000
@@ -6,8 +6,8 @@
 # The order of the next four entries doesn't matter.  The important thing
 # is that there is exactly one entry per GOT TLS slot.
 #
-00090020  0000002f R_MIPS_TLS_TPREL3
-00090024  0000002f R_MIPS_TLS_TPREL3
-00090028  0000002f R_MIPS_TLS_TPREL3
-0009002c  0000002f R_MIPS_TLS_TPREL3
-00090030  .*03 R_MIPS_REL32      00000000   undef
+0009000c  0000002f R_MIPS_TLS_TPREL3
+00090010  0000002f R_MIPS_TLS_TPREL3
+00090014  0000002f R_MIPS_TLS_TPREL3
+00090018  0000002f R_MIPS_TLS_TPREL3
+00090020  .*03 R_MIPS_REL32      00000000   undef
Index: ld/testsuite/ld-mips-elf/tls-hidden4.got
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mips-elf/tls-hidden4.got,v
retrieving revision 1.1
diff -u -r1.1 tls-hidden4.got
--- ld/testsuite/ld-mips-elf/tls-hidden4.got	27 Mar 2006 11:30:54 -0000	1.1
+++ ld/testsuite/ld-mips-elf/tls-hidden4.got	17 Sep 2007 23:13:17 -0000
@@ -15,7 +15,8 @@
 # entry for each symbol.
 #
 #...
- 1c4080 0000abc8 0000abcc 0000abc0 0000abc4  .*
+ 1c4010 00000000 00000000 0000abc8 0000abcc  .*
+ 1c4020 0000abc0 0000abc4 00000000 80000000  .*
 #
 # Likewise, but the order of the entries in this GOT is:
 #
@@ -24,5 +25,4 @@
 #     foo0
 #     foo1
 #...
- 1d00c0 00000000 00000000 00000000 0000abcc  .*
- 1d00d0 0000abc8 0000abc0 0000abc4           .*
+ 1d0030 0000abcc 0000abc8 0000abc0 0000abc4  .*
Index: ld/testsuite/ld-mips-elf/tls-hidden4.r
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mips-elf/tls-hidden4.r,v
retrieving revision 1.2
diff -u -r1.2 tls-hidden4.r
--- ld/testsuite/ld-mips-elf/tls-hidden4.r	19 Oct 2006 13:47:10 -0000	1.2
+++ ld/testsuite/ld-mips-elf/tls-hidden4.r	17 Sep 2007 23:13:17 -0000
@@ -7,13 +7,13 @@
 # important thing is that there is exactly one entry per GOT TLS slot
 # and that the addresses match those in the .got dump.
 #
-001c4080  0000002f R_MIPS_TLS_TPREL3
-001c4084  0000002f R_MIPS_TLS_TPREL3
-001c4088  0000002f R_MIPS_TLS_TPREL3
-001c408c  0000002f R_MIPS_TLS_TPREL3
-001d00cc  0000002f R_MIPS_TLS_TPREL3
-001d00d0  0000002f R_MIPS_TLS_TPREL3
-001d00d4  0000002f R_MIPS_TLS_TPREL3
-001d00d8  0000002f R_MIPS_TLS_TPREL3
+001c4018  0000002f R_MIPS_TLS_TPREL3
+001c401c  0000002f R_MIPS_TLS_TPREL3
+001c4020  0000002f R_MIPS_TLS_TPREL3
+001c4024  0000002f R_MIPS_TLS_TPREL3
+001d0030  0000002f R_MIPS_TLS_TPREL3
+001d0034  0000002f R_MIPS_TLS_TPREL3
+001d0038  0000002f R_MIPS_TLS_TPREL3
+001d003c  0000002f R_MIPS_TLS_TPREL3
 .* R_MIPS_REL32 .*
 #pass
Index: ld/testsuite/ld-mips-elf/tls-multi-got-1.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mips-elf/tls-multi-got-1.d,v
retrieving revision 1.1
diff -u -r1.1 tls-multi-got-1.d
--- ld/testsuite/ld-mips-elf/tls-multi-got-1.d	2 Mar 2005 21:22:57 -0000	1.1
+++ ld/testsuite/ld-mips-elf/tls-multi-got-1.d	17 Sep 2007 23:13:17 -0000
@@ -5,16 +5,16 @@
 
 #...
 [0-9a-f]+ <tls_bits_1>:
-   [0-9a-f]+:	27841c90 	addiu	a0,gp,7312
-   [0-9a-f]+:	27841c84 	addiu	a0,gp,7300
-   [0-9a-f]+:	24441c8c 	addiu	a0,v0,7308
+   [0-9a-f]+:	27841c64 	addiu	a0,gp,7268
+   [0-9a-f]+:	27841c58 	addiu	a0,gp,7256
+   [0-9a-f]+:	24441c60 	addiu	a0,v0,7264
    [0-9a-f]+:	00000000 	nop
 
 [0-9a-f]+ <sym_2_0000>:
 #...
 [0-9a-f]+ <tls_bits_2>:
-   [0-9a-f]+:	27841c90 	addiu	a0,gp,7312
-   [0-9a-f]+:	27841c84 	addiu	a0,gp,7300
-   [0-9a-f]+:	24441c8c 	addiu	a0,v0,7308
+   [0-9a-f]+:	27841c64 	addiu	a0,gp,7268
+   [0-9a-f]+:	27841c58 	addiu	a0,gp,7256
+   [0-9a-f]+:	24441c60 	addiu	a0,v0,7264
    [0-9a-f]+:	00000000 	nop
 #pass
Index: ld/testsuite/ld-mips-elf/tls-multi-got-1.got
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mips-elf/tls-multi-got-1.got,v
retrieving revision 1.8
diff -u -r1.8 tls-multi-got-1.got
--- ld/testsuite/ld-mips-elf/tls-multi-got-1.got	20 Oct 2006 07:58:17 -0000	1.8
+++ ld/testsuite/ld-mips-elf/tls-multi-got-1.got	17 Sep 2007 23:13:17 -0000
@@ -4,33 +4,33 @@
 DYNAMIC RELOCATION RECORDS
 OFFSET   TYPE              VALUE 
 00000000 R_MIPS_NONE       \*ABS\*
-0013f948 R_MIPS_TLS_DTPMOD32  \*ABS\*
-001495d0 R_MIPS_TLS_DTPMOD32  \*ABS\*
-0013f954 R_MIPS_TLS_DTPMOD32  tlsvar_gd
-0013f958 R_MIPS_TLS_DTPREL32  tlsvar_gd
-001495dc R_MIPS_TLS_DTPMOD32  tlsvar_gd
-001495e0 R_MIPS_TLS_DTPREL32  tlsvar_gd
-0013f950 R_MIPS_TLS_TPREL32  tlsvar_ie
-001495d8 R_MIPS_TLS_TPREL32  tlsvar_ie
-00143f7c R_MIPS_REL32      sym_1_9526
+0013f840 R_MIPS_TLS_DTPMOD32  \*ABS\*
+0014949c R_MIPS_TLS_DTPMOD32  \*ABS\*
+0013f84c R_MIPS_TLS_DTPMOD32  tlsvar_gd
+0013f850 R_MIPS_TLS_DTPREL32  tlsvar_gd
+001494a8 R_MIPS_TLS_DTPMOD32  tlsvar_gd
+001494ac R_MIPS_TLS_DTPREL32  tlsvar_gd
+0013f848 R_MIPS_TLS_TPREL32  tlsvar_ie
+001494a4 R_MIPS_TLS_TPREL32  tlsvar_ie
+00143e48 R_MIPS_REL32      sym_1_9526
 #...
-00139bd0 R_MIPS_REL32      sym_2_8654
+00139ac8 R_MIPS_REL32      sym_2_8654
 
 
 Contents of section .got:
- 122420 00000000 80000000 00000000 00000000  .*
- 122430 00000000 00000000 00000000 00000000  .*
- 122440 00000000 00000000 00000000 00000000  .*
- 122450 00000000 000d8048 000d66a4 000d2054  .*
+ 122370 00000000 80000000 000d7f98 000d65f4  .*
+ 122380 000d1fa4 000d6010 000d5a48 000d19c0  .*
 #...
- 13f930 00000000 00000000 00000000 00000000  .*
- 13f940 00000000 00000000 00000000 00000000  .*
- 13f950 00000000 00000000 00000000 00000000  .*
- 13f960 80000000 00000000 00000000 00000000  .*
+ 135bf0 000cf204 000e0e48 00000000 80000000  .*
+ 135c00 00000000 00000000 00000000 00000000  .*
 #...
- 1495a0 00000000 00000000 00000000 00000000  .*
- 1495b0 00000000 00000000 00000000 00000000  .*
- 1495c0 00000000 00000000 00000000 00000000  .*
- 1495d0 00000000 00000000 00000000 00000000  .*
- 1495e0 00000000                             .*
+ 13f830 00000000 00000000 00000000 00000000  .*
+ 13f840 00000000 00000000 00000000 00000000  .*
+ 13f850 00000000 00000000 80000000 00000000  .*
+#...
+ 149460 00000000 00000000 00000000 00000000  .*
+ 149470 00000000 00000000 00000000 00000000  .*
+ 149480 00000000 00000000 00000000 00000000  .*
+ 149490 00000000 00000000 00000000 00000000  .*
+ 1494a0 00000000 00000000 00000000 00000000  .*
 #pass
Index: ld/testsuite/ld-mips-elf/tls-multi-got-1.r
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mips-elf/tls-multi-got-1.r,v
retrieving revision 1.7
diff -u -r1.7 tls-multi-got-1.r
--- ld/testsuite/ld-mips-elf/tls-multi-got-1.r	20 Oct 2006 07:58:17 -0000	1.7
+++ ld/testsuite/ld-mips-elf/tls-multi-got-1.r	17 Sep 2007 23:13:17 -0000
@@ -6,14 +6,14 @@
  0x00000006 \(SYMTAB\).*
  0x0000000a \(STRSZ\)                      220091 \(bytes\)
  0x0000000b \(SYMENT\)                     16 \(bytes\)
- 0x00000003 \(PLTGOT\)                     0x122420
+ 0x00000003 \(PLTGOT\)                     0x122370
  0x00000011 \(REL\)                        0xa7978
  0x00000012 \(RELSZ\)                      160072 \(bytes\)
  0x00000013 \(RELENT\)                     8 \(bytes\)
  0x70000001 \(MIPS_RLD_VERSION\)           1
  0x70000005 \(MIPS_FLAGS\)                 NOTPOT
  0x70000006 \(MIPS_BASE_ADDRESS\)          0
- 0x7000000a \(MIPS_LOCAL_GOTNO\)           13
+ 0x7000000a \(MIPS_LOCAL_GOTNO\)           2
  0x70000011 \(MIPS_SYMTABNO\)              20013
  0x70000012 \(MIPS_UNREFEXTNO\)            11
  0x70000013 \(MIPS_GOTSYM\)                0xd
@@ -31,8 +31,8 @@
 [0-9a-f ]+R_MIPS_TLS_DTPREL 00000000   tlsvar_gd
 [0-9a-f ]+R_MIPS_TLS_TPREL3 00000004   tlsvar_ie
 [0-9a-f ]+R_MIPS_TLS_TPREL3 00000004   tlsvar_ie
-[0-9a-f ]+R_MIPS_REL32      000d8048   sym_1_9526
-[0-9a-f ]+R_MIPS_REL32      000d66a4   sym_1_7885
+[0-9a-f ]+R_MIPS_REL32      000d7f98   sym_1_9526
+[0-9a-f ]+R_MIPS_REL32      000d65f4   sym_1_7885
 #...
-[0-9a-f ]+R_MIPS_REL32      000cf2b4   sym_1_0465
-[0-9a-f ]+R_MIPS_REL32      000e0ef8   sym_2_8654
+[0-9a-f ]+R_MIPS_REL32      000cf204   sym_1_0465
+[0-9a-f ]+R_MIPS_REL32      000e0e48   sym_2_8654
Index: ld/testsuite/ld-mips-elf/tlsbin-o32.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mips-elf/tlsbin-o32.d,v
retrieving revision 1.1
diff -u -r1.1 tlsbin-o32.d
--- ld/testsuite/ld-mips-elf/tlsbin-o32.d	2 Mar 2005 21:22:57 -0000	1.1
+++ ld/testsuite/ld-mips-elf/tlsbin-o32.d	17 Sep 2007 23:13:17 -0000
@@ -10,14 +10,14 @@
   4000e0:	afbe0008 	sw	s8,8\(sp\)
   4000e4:	03a0f021 	move	s8,sp
   4000e8:	afbc0000 	sw	gp,0\(sp\)
-  4000ec:	8f99802c 	lw	t9,-32724\(gp\)
-  4000f0:	2784803c 	addiu	a0,gp,-32708
+  4000ec:	8f998018 	lw	t9,-32744\(gp\)
+  4000f0:	27848028 	addiu	a0,gp,-32728
   4000f4:	0320f809 	jalr	t9
   4000f8:	00000000 	nop
   4000fc:	8fdc0000 	lw	gp,0\(s8\)
   400100:	00000000 	nop
-  400104:	8f99802c 	lw	t9,-32724\(gp\)
-  400108:	27848034 	addiu	a0,gp,-32716
+  400104:	8f998018 	lw	t9,-32744\(gp\)
+  400108:	27848020 	addiu	a0,gp,-32736
   40010c:	0320f809 	jalr	t9
   400110:	00000000 	nop
   400114:	8fdc0000 	lw	gp,0\(s8\)
@@ -26,7 +26,7 @@
   400120:	24638000 	addiu	v1,v1,-32768
   400124:	00621821 	addu	v1,v1,v0
   400128:	7c02283b 	rdhwr	v0,\$5
-  40012c:	8f838030 	lw	v1,-32720\(gp\)
+  40012c:	8f83801c 	lw	v1,-32740\(gp\)
   400130:	00000000 	nop
   400134:	00621821 	addu	v1,v1,v0
   400138:	7c02283b 	rdhwr	v0,\$5
Index: ld/testsuite/ld-mips-elf/tlsbin-o32.got
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mips-elf/tlsbin-o32.got,v
retrieving revision 1.1
diff -u -r1.1 tlsbin-o32.got
--- ld/testsuite/ld-mips-elf/tlsbin-o32.got	2 Mar 2005 21:22:57 -0000	1.1
+++ ld/testsuite/ld-mips-elf/tlsbin-o32.got	17 Sep 2007 23:13:17 -0000
@@ -2,7 +2,5 @@
 .*:     file format elf32-tradbigmips
 
 Contents of section .got:
- 10000010 00000000 80000000 00000000 00000000  ................
- 10000020 00000000 00000000 00000000 00400158  .............@.X
- 10000030 ffff900c 00000001 00000000 00000001  ................
- 10000040 ffff8008                             ....            
+ 10000010 00000000 80000000 00400158 ffff900c  .........@.X....
+ 10000020 00000001 00000000 00000001 ffff8008  ................
Index: ld/testsuite/ld-mips-elf/tlsdyn-o32-1.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mips-elf/tlsdyn-o32-1.d,v
retrieving revision 1.4
diff -u -r1.4 tlsdyn-o32-1.d
--- ld/testsuite/ld-mips-elf/tlsdyn-o32-1.d	20 Oct 2006 07:57:02 -0000	1.4
+++ ld/testsuite/ld-mips-elf/tlsdyn-o32-1.d	17 Sep 2007 23:13:17 -0000
@@ -11,20 +11,20 @@
   .*:	afbe0008 	sw	s8,8\(sp\)
   .*:	03a0f021 	move	s8,sp
   .*:	afbc0000 	sw	gp,0\(sp\)
-  .*:	8f99802c 	lw	t9,-32724\(gp\)
-  .*:	27848044 	addiu	a0,gp,-32700
+  .*:	8f998018 	lw	t9,-32744\(gp\)
+  .*:	27848030 	addiu	a0,gp,-32720
   .*:	0320f809 	jalr	t9
   .*:	00000000 	nop
   .*:	8fdc0000 	lw	gp,0\(s8\)
   .*:	00000000 	nop
-  .*:	8f99802c 	lw	t9,-32724\(gp\)
-  .*:	27848038 	addiu	a0,gp,-32712
+  .*:	8f998018 	lw	t9,-32744\(gp\)
+  .*:	27848024 	addiu	a0,gp,-32732
   .*:	0320f809 	jalr	t9
   .*:	00000000 	nop
   .*:	8fdc0000 	lw	gp,0\(s8\)
   .*:	00000000 	nop
-  .*:	8f99802c 	lw	t9,-32724\(gp\)
-  .*:	27848030 	addiu	a0,gp,-32720
+  .*:	8f998018 	lw	t9,-32744\(gp\)
+  .*:	2784801c 	addiu	a0,gp,-32740
   .*:	0320f809 	jalr	t9
   .*:	00000000 	nop
   .*:	8fdc0000 	lw	gp,0\(s8\)
@@ -33,10 +33,10 @@
   .*:	24638000 	addiu	v1,v1,-32768
   .*:	00621821 	addu	v1,v1,v0
   .*:	7c02283b 	rdhwr	v0,\$5
-  .*:	8f83804c 	lw	v1,-32692\(gp\)
+  .*:	8f838038 	lw	v1,-32712\(gp\)
   .*:	00000000 	nop
   .*:	00621821 	addu	v1,v1,v0
-  .*:	8f838040 	lw	v1,-32704\(gp\)
+  .*:	8f83802c 	lw	v1,-32724\(gp\)
   .*:	00000000 	nop
   .*:	00621821 	addu	v1,v1,v0
   .*:	7c02283b 	rdhwr	v0,\$5
@@ -61,20 +61,20 @@
   .*:	afbe0008 	sw	s8,8\(sp\)
   .*:	03a0f021 	move	s8,sp
   .*:	afbc0000 	sw	gp,0\(sp\)
-  .*:	8f99802c 	lw	t9,-32724\(gp\)
-  .*:	27848044 	addiu	a0,gp,-32700
+  .*:	8f998018 	lw	t9,-32744\(gp\)
+  .*:	27848030 	addiu	a0,gp,-32720
   .*:	0320f809 	jalr	t9
   .*:	00000000 	nop
   .*:	8fdc0000 	lw	gp,0\(s8\)
   .*:	00000000 	nop
-  .*:	8f99802c 	lw	t9,-32724\(gp\)
-  .*:	27848038 	addiu	a0,gp,-32712
+  .*:	8f998018 	lw	t9,-32744\(gp\)
+  .*:	27848024 	addiu	a0,gp,-32732
   .*:	0320f809 	jalr	t9
   .*:	00000000 	nop
   .*:	8fdc0000 	lw	gp,0\(s8\)
   .*:	00000000 	nop
-  .*:	8f99802c 	lw	t9,-32724\(gp\)
-  .*:	27848030 	addiu	a0,gp,-32720
+  .*:	8f998018 	lw	t9,-32744\(gp\)
+  .*:	2784801c 	addiu	a0,gp,-32740
   .*:	0320f809 	jalr	t9
   .*:	00000000 	nop
   .*:	8fdc0000 	lw	gp,0\(s8\)
@@ -83,10 +83,10 @@
   .*:	24638000 	addiu	v1,v1,-32768
   .*:	00621821 	addu	v1,v1,v0
   .*:	7c02283b 	rdhwr	v0,\$5
-  .*:	8f83804c 	lw	v1,-32692\(gp\)
+  .*:	8f838038 	lw	v1,-32712\(gp\)
   .*:	00000000 	nop
   .*:	00621821 	addu	v1,v1,v0
-  .*:	8f838040 	lw	v1,-32704\(gp\)
+  .*:	8f83802c 	lw	v1,-32724\(gp\)
   .*:	00000000 	nop
   .*:	00621821 	addu	v1,v1,v0
   .*:	7c02283b 	rdhwr	v0,\$5
Index: ld/testsuite/ld-mips-elf/tlsdyn-o32-1.got
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mips-elf/tlsdyn-o32-1.got,v
retrieving revision 1.4
diff -u -r1.4 tlsdyn-o32-1.got
--- ld/testsuite/ld-mips-elf/tlsdyn-o32-1.got	20 Oct 2006 07:57:02 -0000	1.4
+++ ld/testsuite/ld-mips-elf/tlsdyn-o32-1.got	17 Sep 2007 23:13:17 -0000
@@ -4,16 +4,15 @@
 DYNAMIC RELOCATION RECORDS
 OFFSET   TYPE              VALUE 
 00000000 R_MIPS_NONE       \*ABS\*
-10000054 R_MIPS_TLS_DTPMOD32  tlsbin_gd
-10000058 R_MIPS_TLS_DTPREL32  tlsbin_gd
-10000048 R_MIPS_TLS_DTPMOD32  tlsvar_gd
-1000004c R_MIPS_TLS_DTPREL32  tlsvar_gd
-10000050 R_MIPS_TLS_TPREL32  tlsvar_ie
-1000005c R_MIPS_TLS_TPREL32  tlsbin_ie
+10000040 R_MIPS_TLS_DTPMOD32  tlsbin_gd
+10000044 R_MIPS_TLS_DTPREL32  tlsbin_gd
+10000034 R_MIPS_TLS_DTPMOD32  tlsvar_gd
+10000038 R_MIPS_TLS_DTPREL32  tlsvar_gd
+1000003c R_MIPS_TLS_TPREL32  tlsvar_ie
+10000048 R_MIPS_TLS_TPREL32  tlsbin_ie
 
 
 Contents of section .got:
- 10000020 00000000 80000000 00000000 00000000  ................
- 10000030 00000000 00000000 00000000 0040053c  .............@..
- 10000040 00000001 00000000 00000000 00000000  ................
- 10000050 00000000 00000000 00000000 00000000  ................
+ 10000020 00000000 80000000 0040053c 00000001  .........@......
+ 10000030 00000000 00000000 00000000 00000000  ................
+ 10000040 00000000 00000000 00000000           ............    
Index: ld/testsuite/ld-mips-elf/tlsdyn-o32-2.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mips-elf/tlsdyn-o32-2.d,v
retrieving revision 1.5
diff -u -r1.5 tlsdyn-o32-2.d
--- ld/testsuite/ld-mips-elf/tlsdyn-o32-2.d	13 Aug 2007 21:16:39 -0000	1.5
+++ ld/testsuite/ld-mips-elf/tlsdyn-o32-2.d	17 Sep 2007 23:13:17 -0000
@@ -11,20 +11,20 @@
   .*:	afbe0008 	sw	s8,8\(sp\)
   .*:	03a0f021 	move	s8,sp
   .*:	afbc0000 	sw	gp,0\(sp\)
-  .*:	8f99802c 	lw	t9,-32724\(gp\)
-  .*:	27848044 	addiu	a0,gp,-32700
+  .*:	8f998018 	lw	t9,-32744\(gp\)
+  .*:	27848030 	addiu	a0,gp,-32720
   .*:	0320f809 	jalr	t9
   .*:	00000000 	nop
   .*:	8fdc0000 	lw	gp,0\(s8\)
   .*:	00000000 	nop
-  .*:	8f99802c 	lw	t9,-32724\(gp\)
-  .*:	27848038 	addiu	a0,gp,-32712
+  .*:	8f998018 	lw	t9,-32744\(gp\)
+  .*:	27848024 	addiu	a0,gp,-32732
   .*:	0320f809 	jalr	t9
   .*:	00000000 	nop
   .*:	8fdc0000 	lw	gp,0\(s8\)
   .*:	00000000 	nop
-  .*:	8f99802c 	lw	t9,-32724\(gp\)
-  .*:	27848030 	addiu	a0,gp,-32720
+  .*:	8f998018 	lw	t9,-32744\(gp\)
+  .*:	2784801c 	addiu	a0,gp,-32740
   .*:	0320f809 	jalr	t9
   .*:	00000000 	nop
   .*:	8fdc0000 	lw	gp,0\(s8\)
@@ -33,10 +33,10 @@
   .*:	24638000 	addiu	v1,v1,-32768
   .*:	00621821 	addu	v1,v1,v0
   .*:	7c02283b 	rdhwr	v0,\$5
-  .*:	8f83804c 	lw	v1,-32692\(gp\)
+  .*:	8f838038 	lw	v1,-32712\(gp\)
   .*:	00000000 	nop
   .*:	00621821 	addu	v1,v1,v0
-  .*:	8f838040 	lw	v1,-32704\(gp\)
+  .*:	8f83802c 	lw	v1,-32724\(gp\)
   .*:	00000000 	nop
   .*:	00621821 	addu	v1,v1,v0
   .*:	7c02283b 	rdhwr	v0,\$5
@@ -61,20 +61,20 @@
   .*:	afbe0008 	sw	s8,8\(sp\)
   .*:	03a0f021 	move	s8,sp
   .*:	afbc0000 	sw	gp,0\(sp\)
-  .*:	8f99802c 	lw	t9,-32724\(gp\)
-  .*:	27848044 	addiu	a0,gp,-32700
+  .*:	8f998018 	lw	t9,-32744\(gp\)
+  .*:	27848030 	addiu	a0,gp,-32720
   .*:	0320f809 	jalr	t9
   .*:	00000000 	nop
   .*:	8fdc0000 	lw	gp,0\(s8\)
   .*:	00000000 	nop
-  .*:	8f99802c 	lw	t9,-32724\(gp\)
-  .*:	27848038 	addiu	a0,gp,-32712
+  .*:	8f998018 	lw	t9,-32744\(gp\)
+  .*:	27848024 	addiu	a0,gp,-32732
   .*:	0320f809 	jalr	t9
   .*:	00000000 	nop
   .*:	8fdc0000 	lw	gp,0\(s8\)
   .*:	00000000 	nop
-  .*:	8f99802c 	lw	t9,-32724\(gp\)
-  .*:	27848030 	addiu	a0,gp,-32720
+  .*:	8f998018 	lw	t9,-32744\(gp\)
+  .*:	2784801c 	addiu	a0,gp,-32740
   .*:	0320f809 	jalr	t9
   .*:	00000000 	nop
   .*:	8fdc0000 	lw	gp,0\(s8\)
@@ -83,10 +83,10 @@
   .*:	24638000 	addiu	v1,v1,-32768
   .*:	00621821 	addu	v1,v1,v0
   .*:	7c02283b 	rdhwr	v0,\$5
-  .*:	8f83804c 	lw	v1,-32692\(gp\)
+  .*:	8f838038 	lw	v1,-32712\(gp\)
   .*:	00000000 	nop
   .*:	00621821 	addu	v1,v1,v0
-  .*:	8f838040 	lw	v1,-32704\(gp\)
+  .*:	8f83802c 	lw	v1,-32724\(gp\)
   .*:	00000000 	nop
   .*:	00621821 	addu	v1,v1,v0
   .*:	7c02283b 	rdhwr	v0,\$5
Index: ld/testsuite/ld-mips-elf/tlsdyn-o32-2.got
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mips-elf/tlsdyn-o32-2.got,v
retrieving revision 1.5
diff -u -r1.5 tlsdyn-o32-2.got
--- ld/testsuite/ld-mips-elf/tlsdyn-o32-2.got	13 Aug 2007 21:16:39 -0000	1.5
+++ ld/testsuite/ld-mips-elf/tlsdyn-o32-2.got	17 Sep 2007 23:13:17 -0000
@@ -4,17 +4,16 @@
 DYNAMIC RELOCATION RECORDS
 OFFSET   TYPE              VALUE 
 00000000 R_MIPS_NONE       \*ABS\*
-10000054 R_MIPS_TLS_DTPMOD32  tlsbin_gd
-10000058 R_MIPS_TLS_DTPREL32  tlsbin_gd
-10000048 R_MIPS_TLS_DTPMOD32  tlsvar_gd
-1000004c R_MIPS_TLS_DTPREL32  tlsvar_gd
-10000050 R_MIPS_TLS_TPREL32  tlsvar_ie
-1000005c R_MIPS_TLS_TPREL32  tlsbin_ie
+10000040 R_MIPS_TLS_DTPMOD32  tlsbin_gd
+10000044 R_MIPS_TLS_DTPREL32  tlsbin_gd
+10000034 R_MIPS_TLS_DTPMOD32  tlsvar_gd
+10000038 R_MIPS_TLS_DTPREL32  tlsvar_gd
+1000003c R_MIPS_TLS_TPREL32  tlsvar_ie
+10000048 R_MIPS_TLS_TPREL32  tlsbin_ie
 
 
 Contents of section .got:
- 10000020 00000000 80000000 00000000 00000000  .*
- 10000030 00000000 00000000 00000000 0040053c  .*
- 10000040 00000001 00000000 00000000 00000000  .*
- 10000050 00000000 00000000 00000000 00000000  .*
- 10000060 00000000 00000000 00000000           .*
+ 10000020 00000000 80000000 0040053c 00000001  .*
+ 10000030 00000000 00000000 00000000 00000000  .*
+ 10000040 00000000 00000000 00000000 00000000  .*
+ 10000050 00000000 00000000                    .*
Index: ld/testsuite/ld-mips-elf/tlsdyn-o32-3.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mips-elf/tlsdyn-o32-3.d,v
retrieving revision 1.5
diff -u -r1.5 tlsdyn-o32-3.d
--- ld/testsuite/ld-mips-elf/tlsdyn-o32-3.d	13 Aug 2007 21:16:39 -0000	1.5
+++ ld/testsuite/ld-mips-elf/tlsdyn-o32-3.d	17 Sep 2007 23:13:17 -0000
@@ -11,20 +11,20 @@
   .*:	afbe0008 	sw	s8,8\(sp\)
   .*:	03a0f021 	move	s8,sp
   .*:	afbc0000 	sw	gp,0\(sp\)
-  .*:	8f99802c 	lw	t9,-32724\(gp\)
-  .*:	27848044 	addiu	a0,gp,-32700
+  .*:	8f998018 	lw	t9,-32744\(gp\)
+  .*:	27848030 	addiu	a0,gp,-32720
   .*:	0320f809 	jalr	t9
   .*:	00000000 	nop
   .*:	8fdc0000 	lw	gp,0\(s8\)
   .*:	00000000 	nop
-  .*:	8f99802c 	lw	t9,-32724\(gp\)
-  .*:	27848038 	addiu	a0,gp,-32712
+  .*:	8f998018 	lw	t9,-32744\(gp\)
+  .*:	27848024 	addiu	a0,gp,-32732
   .*:	0320f809 	jalr	t9
   .*:	00000000 	nop
   .*:	8fdc0000 	lw	gp,0\(s8\)
   .*:	00000000 	nop
-  .*:	8f99802c 	lw	t9,-32724\(gp\)
-  .*:	27848030 	addiu	a0,gp,-32720
+  .*:	8f998018 	lw	t9,-32744\(gp\)
+  .*:	2784801c 	addiu	a0,gp,-32740
   .*:	0320f809 	jalr	t9
   .*:	00000000 	nop
   .*:	8fdc0000 	lw	gp,0\(s8\)
@@ -33,10 +33,10 @@
   .*:	24638000 	addiu	v1,v1,-32768
   .*:	00621821 	addu	v1,v1,v0
   .*:	7c02283b 	rdhwr	v0,\$5
-  .*:	8f83804c 	lw	v1,-32692\(gp\)
+  .*:	8f838038 	lw	v1,-32712\(gp\)
   .*:	00000000 	nop
   .*:	00621821 	addu	v1,v1,v0
-  .*:	8f838040 	lw	v1,-32704\(gp\)
+  .*:	8f83802c 	lw	v1,-32724\(gp\)
   .*:	00000000 	nop
   .*:	00621821 	addu	v1,v1,v0
   .*:	7c02283b 	rdhwr	v0,\$5
@@ -57,20 +57,20 @@
   .*:	afbe0008 	sw	s8,8\(sp\)
   .*:	03a0f021 	move	s8,sp
   .*:	afbc0000 	sw	gp,0\(sp\)
-  .*:	8f99802c 	lw	t9,-32724\(gp\)
-  .*:	27848044 	addiu	a0,gp,-32700
+  .*:	8f998018 	lw	t9,-32744\(gp\)
+  .*:	27848030 	addiu	a0,gp,-32720
   .*:	0320f809 	jalr	t9
   .*:	00000000 	nop
   .*:	8fdc0000 	lw	gp,0\(s8\)
   .*:	00000000 	nop
-  .*:	8f99802c 	lw	t9,-32724\(gp\)
-  .*:	27848038 	addiu	a0,gp,-32712
+  .*:	8f998018 	lw	t9,-32744\(gp\)
+  .*:	27848024 	addiu	a0,gp,-32732
   .*:	0320f809 	jalr	t9
   .*:	00000000 	nop
   .*:	8fdc0000 	lw	gp,0\(s8\)
   .*:	00000000 	nop
-  .*:	8f99802c 	lw	t9,-32724\(gp\)
-  .*:	27848030 	addiu	a0,gp,-32720
+  .*:	8f998018 	lw	t9,-32744\(gp\)
+  .*:	2784801c 	addiu	a0,gp,-32740
   .*:	0320f809 	jalr	t9
   .*:	00000000 	nop
   .*:	8fdc0000 	lw	gp,0\(s8\)
@@ -79,10 +79,10 @@
   .*:	24638000 	addiu	v1,v1,-32768
   .*:	00621821 	addu	v1,v1,v0
   .*:	7c02283b 	rdhwr	v0,\$5
-  .*:	8f83804c 	lw	v1,-32692\(gp\)
+  .*:	8f838038 	lw	v1,-32712\(gp\)
   .*:	00000000 	nop
   .*:	00621821 	addu	v1,v1,v0
-  .*:	8f838040 	lw	v1,-32704\(gp\)
+  .*:	8f83802c 	lw	v1,-32724\(gp\)
   .*:	00000000 	nop
   .*:	00621821 	addu	v1,v1,v0
   .*:	7c02283b 	rdhwr	v0,\$5
Index: ld/testsuite/ld-mips-elf/tlsdyn-o32-3.got
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mips-elf/tlsdyn-o32-3.got,v
retrieving revision 1.5
diff -u -r1.5 tlsdyn-o32-3.got
--- ld/testsuite/ld-mips-elf/tlsdyn-o32-3.got	13 Aug 2007 21:16:39 -0000	1.5
+++ ld/testsuite/ld-mips-elf/tlsdyn-o32-3.got	17 Sep 2007 23:13:17 -0000
@@ -4,17 +4,16 @@
 DYNAMIC RELOCATION RECORDS
 OFFSET   TYPE              VALUE 
 00000000 R_MIPS_NONE       \*ABS\*
-10000054 R_MIPS_TLS_DTPMOD32  tlsbin_gd
-10000058 R_MIPS_TLS_DTPREL32  tlsbin_gd
-10000048 R_MIPS_TLS_DTPMOD32  tlsvar_gd
-1000004c R_MIPS_TLS_DTPREL32  tlsvar_gd
-10000050 R_MIPS_TLS_TPREL32  tlsvar_ie
-1000005c R_MIPS_TLS_TPREL32  tlsbin_ie
+10000040 R_MIPS_TLS_DTPMOD32  tlsbin_gd
+10000044 R_MIPS_TLS_DTPREL32  tlsbin_gd
+10000034 R_MIPS_TLS_DTPMOD32  tlsvar_gd
+10000038 R_MIPS_TLS_DTPREL32  tlsvar_gd
+1000003c R_MIPS_TLS_TPREL32  tlsvar_ie
+10000048 R_MIPS_TLS_TPREL32  tlsbin_ie
 
 
 Contents of section .got:
- 10000020 00000000 80000000 00000000 00000000  .*
- 10000030 00000000 00000000 00000000 004005ec  .*
- 10000040 00000001 00000000 00000000 00000000  .*
- 10000050 00000000 00000000 00000000 00000000  .*
- 10000060 00000000 00000000 00000000           .*
+ 10000020 00000000 80000000 004005ec 00000001  .*
+ 10000030 00000000 00000000 00000000 00000000  .*
+ 10000040 00000000 00000000 00000000 00000000  .*
+ 10000050 00000000 00000000                    .*
Index: ld/testsuite/ld-mips-elf/tlsdyn-o32.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mips-elf/tlsdyn-o32.d,v
retrieving revision 1.4
diff -u -r1.4 tlsdyn-o32.d
--- ld/testsuite/ld-mips-elf/tlsdyn-o32.d	20 Oct 2006 07:57:02 -0000	1.4
+++ ld/testsuite/ld-mips-elf/tlsdyn-o32.d	17 Sep 2007 23:13:17 -0000
@@ -11,20 +11,20 @@
   .*:	afbe0008 	sw	s8,8\(sp\)
   .*:	03a0f021 	move	s8,sp
   .*:	afbc0000 	sw	gp,0\(sp\)
-  .*:	8f99802c 	lw	t9,-32724\(gp\)
-  .*:	27848038 	addiu	a0,gp,-32712
+  .*:	8f998018 	lw	t9,-32744\(gp\)
+  .*:	27848024 	addiu	a0,gp,-32732
   .*:	0320f809 	jalr	t9
   .*:	00000000 	nop
   .*:	8fdc0000 	lw	gp,0\(s8\)
   .*:	00000000 	nop
-  .*:	8f99802c 	lw	t9,-32724\(gp\)
-  .*:	27848048 	addiu	a0,gp,-32696
+  .*:	8f998018 	lw	t9,-32744\(gp\)
+  .*:	27848034 	addiu	a0,gp,-32716
   .*:	0320f809 	jalr	t9
   .*:	00000000 	nop
   .*:	8fdc0000 	lw	gp,0\(s8\)
   .*:	00000000 	nop
-  .*:	8f99802c 	lw	t9,-32724\(gp\)
-  .*:	27848030 	addiu	a0,gp,-32720
+  .*:	8f998018 	lw	t9,-32744\(gp\)
+  .*:	2784801c 	addiu	a0,gp,-32740
   .*:	0320f809 	jalr	t9
   .*:	00000000 	nop
   .*:	8fdc0000 	lw	gp,0\(s8\)
@@ -33,10 +33,10 @@
   .*:	24638000 	addiu	v1,v1,-32768
   .*:	00621821 	addu	v1,v1,v0
   .*:	7c02283b 	rdhwr	v0,\$5
-  .*:	8f838044 	lw	v1,-32700\(gp\)
+  .*:	8f838030 	lw	v1,-32720\(gp\)
   .*:	00000000 	nop
   .*:	00621821 	addu	v1,v1,v0
-  .*:	8f838040 	lw	v1,-32704\(gp\)
+  .*:	8f83802c 	lw	v1,-32724\(gp\)
   .*:	00000000 	nop
   .*:	00621821 	addu	v1,v1,v0
   .*:	7c02283b 	rdhwr	v0,\$5
Index: ld/testsuite/ld-mips-elf/tlsdyn-o32.got
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mips-elf/tlsdyn-o32.got,v
retrieving revision 1.4
diff -u -r1.4 tlsdyn-o32.got
--- ld/testsuite/ld-mips-elf/tlsdyn-o32.got	20 Oct 2006 07:57:02 -0000	1.4
+++ ld/testsuite/ld-mips-elf/tlsdyn-o32.got	17 Sep 2007 23:13:17 -0000
@@ -4,16 +4,15 @@
 DYNAMIC RELOCATION RECORDS
 OFFSET   TYPE              VALUE 
 00000000 R_MIPS_NONE       \*ABS\*
-10000048 R_MIPS_TLS_DTPMOD32  tlsbin_gd
-1000004c R_MIPS_TLS_DTPREL32  tlsbin_gd
-10000058 R_MIPS_TLS_DTPMOD32  tlsvar_gd
-1000005c R_MIPS_TLS_DTPREL32  tlsvar_gd
-10000054 R_MIPS_TLS_TPREL32  tlsbin_ie
-10000050 R_MIPS_TLS_TPREL32  tlsvar_ie
+10000034 R_MIPS_TLS_DTPMOD32  tlsbin_gd
+10000038 R_MIPS_TLS_DTPREL32  tlsbin_gd
+10000044 R_MIPS_TLS_DTPMOD32  tlsvar_gd
+10000048 R_MIPS_TLS_DTPREL32  tlsvar_gd
+10000040 R_MIPS_TLS_TPREL32  tlsbin_ie
+1000003c R_MIPS_TLS_TPREL32  tlsvar_ie
 
 
 Contents of section .got:
- 10000020 00000000 80000000 00000000 00000000  ................
- 10000030 00000000 00000000 00000000 0040051c  ................
- 10000040 00000001 00000000 00000000 00000000  ................
- 10000050 00000000 00000000 00000000 00000000  ................
+ 10000020 00000000 80000000 0040051c 00000001  ................
+ 10000030 00000000 00000000 00000000 00000000  ................
+ 10000040 00000000 00000000 00000000           ............    
Index: ld/testsuite/ld-mips-elf/tlslib-o32-hidden.got
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mips-elf/tlslib-o32-hidden.got,v
retrieving revision 1.6
diff -u -r1.6 tlslib-o32-hidden.got
--- ld/testsuite/ld-mips-elf/tlslib-o32-hidden.got	20 Oct 2006 07:57:03 -0000	1.6
+++ ld/testsuite/ld-mips-elf/tlslib-o32-hidden.got	17 Sep 2007 23:13:17 -0000
@@ -4,13 +4,11 @@
 DYNAMIC RELOCATION RECORDS
 OFFSET   TYPE              VALUE 
 00000000 R_MIPS_NONE       \*ABS\*
-000403d0 R_MIPS_TLS_TPREL32  \*ABS\*
-000403d4 R_MIPS_TLS_DTPMOD32  \*ABS\*
-000403dc R_MIPS_TLS_DTPMOD32  \*ABS\*
+000403bc R_MIPS_TLS_TPREL32  \*ABS\*
+000403c0 R_MIPS_TLS_DTPMOD32  \*ABS\*
+000403c8 R_MIPS_TLS_DTPMOD32  \*ABS\*
 
 
 Contents of section .got:
- 403b0 00000000 80000000 00000000 00000000  ................
- 403c0 00000000 00000000 00000000 00000380  ................
- 403d0 00000008 00000000 00000000 00000000  ................
- 403e0 ffff8004                             ....            
+ 403b0 00000000 80000000 00000380 00000008  ................
+ 403c0 00000000 00000000 00000000 ffff8004  ................
Index: ld/testsuite/ld-mips-elf/tlslib-o32-ver.got
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mips-elf/tlslib-o32-ver.got,v
retrieving revision 1.5
diff -u -r1.5 tlslib-o32-ver.got
--- ld/testsuite/ld-mips-elf/tlslib-o32-ver.got	20 Oct 2006 07:57:03 -0000	1.5
+++ ld/testsuite/ld-mips-elf/tlslib-o32-ver.got	17 Sep 2007 23:13:17 -0000
@@ -4,14 +4,12 @@
 DYNAMIC RELOCATION RECORDS
 OFFSET   TYPE              VALUE 
 00000000 R_MIPS_NONE       \*ABS\*
-00040534 R_MIPS_TLS_DTPMOD32  \*ABS\*
-0004053c R_MIPS_TLS_DTPMOD32  tlsvar_gd
-00040540 R_MIPS_TLS_DTPREL32  tlsvar_gd
-00040530 R_MIPS_TLS_TPREL32  tlsvar_ie
+00040520 R_MIPS_TLS_DTPMOD32  \*ABS\*
+00040528 R_MIPS_TLS_DTPMOD32  tlsvar_gd
+0004052c R_MIPS_TLS_DTPREL32  tlsvar_gd
+0004051c R_MIPS_TLS_TPREL32  tlsvar_ie
 
 
 Contents of section .got:
- 40510 00000000 80000000 00000000 00000000  ................
- 40520 00000000 00000000 00000000 000004e0  ................
- 40530 00000000 00000000 00000000 00000000  ................
- 40540 00000000                             ....            
+ 40510 00000000 80000000 000004e0 00000000  ................
+ 40520 00000000 00000000 00000000 00000000  ................
Index: ld/testsuite/ld-mips-elf/tlslib-o32.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mips-elf/tlslib-o32.d,v
retrieving revision 1.1
diff -u -r1.1 tlslib-o32.d
--- ld/testsuite/ld-mips-elf/tlslib-o32.d	2 Mar 2005 21:22:57 -0000	1.1
+++ ld/testsuite/ld-mips-elf/tlslib-o32.d	17 Sep 2007 23:13:17 -0000
@@ -11,14 +11,14 @@
  .*:	afbe0008 	sw	s8,8\(sp\)
  .*:	03a0f021 	move	s8,sp
  .*:	afbc0000 	sw	gp,0\(sp\)
- .*:	8f99802c 	lw	t9,-32724\(gp\)
- .*:	2784803c 	addiu	a0,gp,-32708
+ .*:	8f998018 	lw	t9,-32744\(gp\)
+ .*:	27848028 	addiu	a0,gp,-32728
  .*:	0320f809 	jalr	t9
  .*:	00000000 	nop
  .*:	8fdc0000 	lw	gp,0\(s8\)
  .*:	00000000 	nop
- .*:	8f99802c 	lw	t9,-32724\(gp\)
- .*:	27848034 	addiu	a0,gp,-32716
+ .*:	8f998018 	lw	t9,-32744\(gp\)
+ .*:	27848020 	addiu	a0,gp,-32736
  .*:	0320f809 	jalr	t9
  .*:	00000000 	nop
  .*:	8fdc0000 	lw	gp,0\(s8\)
@@ -27,7 +27,7 @@
  .*:	24638000 	addiu	v1,v1,-32768
  .*:	00621821 	addu	v1,v1,v0
  .*:	7c02283b 	rdhwr	v0,\$5
- .*:	8f838030 	lw	v1,-32720\(gp\)
+ .*:	8f83801c 	lw	v1,-32740\(gp\)
  .*:	00000000 	nop
  .*:	00621821 	addu	v1,v1,v0
  .*:	03c0e821 	move	sp,s8
Index: ld/testsuite/ld-mips-elf/tlslib-o32.got
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mips-elf/tlslib-o32.got,v
retrieving revision 1.5
diff -u -r1.5 tlslib-o32.got
--- ld/testsuite/ld-mips-elf/tlslib-o32.got	20 Oct 2006 07:57:03 -0000	1.5
+++ ld/testsuite/ld-mips-elf/tlslib-o32.got	17 Sep 2007 23:13:17 -0000
@@ -4,14 +4,12 @@
 DYNAMIC RELOCATION RECORDS
 OFFSET   TYPE              VALUE 
 00000000 R_MIPS_NONE       \*ABS\*
-00040494 R_MIPS_TLS_DTPMOD32  \*ABS\*
-0004049c R_MIPS_TLS_DTPMOD32  tlsvar_gd
-000404a0 R_MIPS_TLS_DTPREL32  tlsvar_gd
-00040490 R_MIPS_TLS_TPREL32  tlsvar_ie
+00040480 R_MIPS_TLS_DTPMOD32  \*ABS\*
+00040488 R_MIPS_TLS_DTPMOD32  tlsvar_gd
+0004048c R_MIPS_TLS_DTPREL32  tlsvar_gd
+0004047c R_MIPS_TLS_TPREL32  tlsvar_ie
 
 
 Contents of section .got:
- 40470 00000000 80000000 00000000 00000000  ................
- 40480 00000000 00000000 00000000 00000440  ................
- 40490 00000000 00000000 00000000 00000000  ................
- 404a0 00000000                             ....            
+ 40470 00000000 80000000 00000440 00000000  ................
+ 40480 00000000 00000000 00000000 00000000  ................

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]