diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 67707ed5fb..1b51b61ca6 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2013-02-11 Richard Sandiford + + * elfxx-mips.c (mips_got_info): Move global_gotsym to... + (mips_elf_link_hash_table): ...here. Update rest of file accordingly. + 2013-02-11 Richard Sandiford * elfxx-mips.c (mips_elf_count_global_tls_entries) diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 3073f526d1..4a4e061544 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -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, bfd *ibfd, struct elf_link_hash_entry *h, } } - 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, struct bfd_link_info *info) /* 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 *bfd2got, bfd *output_bfd, 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 **entryp, void *p) { 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 bfd_link_info *info, 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, struct bfd_link_info *info) 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 (bfd *output_bfd, 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