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]

[6/20] MIPS GOT: Move global_gotsym


There is only one global_gotsym per link, so I think it should go in the
"hash table" rather than in the per-GOT info.

Richard


bfd/
	* elfxx-mips.c (mips_got_info): Move global_gotsym to...
	(mips_elf_link_hash_table): ...here.  Update rest of file accordingly.

Index: bfd/elfxx-mips.c
===================================================================
--- bfd/elfxx-mips.c	2013-02-11 14:06:31.820153685 +0000
+++ bfd/elfxx-mips.c	2013-02-11 14:06:32.336157676 +0000
@@ -142,9 +142,6 @@ struct mips_got_page_entry
 
 struct mips_got_info
 {
-  /* The global symbol in the GOT with the lowest index in the dynamic
-     symbol table.  */
-  struct elf_link_hash_entry *global_gotsym;
   /* The number of global .got entries.  */
   unsigned int global_gotno;
   /* The number of global .got entries that are in the GGA_RELOC_ONLY area.  */
@@ -460,6 +457,10 @@ struct mips_elf_link_hash_table
   /* The master GOT information.  */
   struct mips_got_info *got_info;
 
+  /* The global symbol in the GOT with the lowest index in the dynamic
+     symbol table.  */
+  struct elf_link_hash_entry *global_gotsym;
+
   /* The size of the PLT header in bytes.  */
   bfd_vma plt_header_size;
 
@@ -3334,8 +3335,8 @@ mips_elf_global_got_index (bfd *abfd, bf
 	}
     }
 
-  if (gg->global_gotsym != NULL)
-    global_got_dynindx = gg->global_gotsym->dynindx;
+  if (htab->global_gotsym != NULL)
+    global_got_dynindx = htab->global_gotsym->dynindx;
 
   if (TLS_RELOC_P (r_type))
     {
@@ -3622,7 +3623,7 @@ mips_elf_sort_hash_table (bfd *abfd, str
 
   /* Now we know which dynamic symbol has the lowest dynamic symbol
      table index in the GOT.  */
-  g->global_gotsym = hsd.low;
+  htab->global_gotsym = hsd.low;
 
   return TRUE;
 }
@@ -4161,7 +4162,6 @@ mips_elf_get_got_for_bfd (struct htab *b
       bfdgot->bfd = input_bfd;
       bfdgot->g = g;
 
-      g->global_gotsym = NULL;
       g->global_gotno = 0;
       g->reloc_only_gotno = 0;
       g->local_gotno = 0;
@@ -4461,8 +4461,6 @@ mips_elf_set_global_got_offset (void **e
     {
       if (g)
 	{
-	  BFD_ASSERT (g->global_gotsym == NULL);
-
 	  entry->gotidx = arg->value * (long) g->assigned_gotno++;
 	  if (arg->info->shared
 	      || (elf_hash_table (arg->info)->dynamic_sections_created
@@ -4590,7 +4588,6 @@ mips_elf_multi_got (bfd *abfd, struct bf
       if (g->next == NULL)
 	return FALSE;
 
-      g->next->global_gotsym = NULL;
       g->next->global_gotno = 0;
       g->next->reloc_only_gotno = 0;
       g->next->local_gotno = 0;
@@ -4941,7 +4938,6 @@ mips_elf_create_got_section (bfd *abfd,
   g = bfd_alloc (abfd, amt);
   if (g == NULL)
     return FALSE;
-  g->global_gotsym = NULL;
   g->global_gotno = 0;
   g->reloc_only_gotno = 0;
   g->tls_gotno = 0;
@@ -10657,9 +10653,9 @@ _bfd_mips_elf_finish_dynamic_sections (b
 	      break;
 
 	    case DT_MIPS_GOTSYM:
-	      if (gg->global_gotsym)
+	      if (htab->global_gotsym)
 		{
-		  dyn.d_un.d_val = gg->global_gotsym->dynindx;
+		  dyn.d_un.d_val = htab->global_gotsym->dynindx;
 		  break;
 		}
 	      /* In case if we don't have global got symbols we default


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