= (struct mips_elf_link_hash_entry *) arg1;
struct mips_elf_count_tls_arg *arg = arg2;
+ if (hm->root.root.type == bfd_link_hash_indirect
+ || hm->root.root.type == bfd_link_hash_warning)
+ return 1;
+
if (hm->tls_type & GOT_TLS_GD)
arg->needed += 2;
if (hm->tls_type & GOT_TLS_IE)
= (struct mips_elf_link_hash_entry *) arg1;
struct mips_elf_count_tls_arg *arg = arg2;
+ if (hm->root.root.type == bfd_link_hash_indirect
+ || hm->root.root.type == bfd_link_hash_warning)
+ return 1;
+
arg->needed += mips_tls_got_relocs (arg->info, hm->tls_type, &hm->root);
return 1;
break;
case GGA_NORMAL:
- BFD_ASSERT (h->tls_type == GOT_NORMAL);
-
h->root.dynindx = --hsd->min_got_dynindx;
hsd->low = (struct elf_link_hash_entry *) h;
break;
case GGA_RELOC_ONLY:
- BFD_ASSERT (h->tls_type == GOT_NORMAL);
-
if (hsd->max_unref_got_dynindx == hsd->min_got_dynindx)
hsd->low = (struct elf_link_hash_entry *) h;
h->root.dynindx = hsd->max_unref_got_dynindx++;
}
if (*slot == NULL)
*slot = entry;
- else
- free (entry);
return 1;
}
if (new_got == NULL)
return FALSE;
- /* Each entry in g->got_entries has either been copied to new_got
- or freed. Now delete the hash table itself. */
htab_delete (g->got_entries);
g->got_entries = new_got;
}
estimate += from->local_gotno + to->local_gotno;
estimate += from->tls_gotno + to->tls_gotno;
- /* If we're merging with the primary got, we will always have
- the full set of global entries. Otherwise estimate those
+ /* If we're merging with the primary got, any TLS relocations will
+ come after the full set of global entries. Otherwise estimate those
conservatively as well. */
- if (to == arg->primary)
+ if (to == arg->primary && from->tls_gotno + to->tls_gotno)
estimate += arg->global_count;
else
estimate += from->global_gotno + to->global_gotno;
all non-TLS entries. */
g->tls_assigned_gotno = g->local_gotno + g->global_gotno;
htab_traverse (g->got_entries, mips_elf_initialize_tls_index, g);
+ BFD_ASSERT (g->tls_assigned_gotno == assign);
/* Move onto the next GOT. It will be a secondary GOT if nonull. */
g = gn;
/* Set up TLS entries. */
g->tls_assigned_gotno = g->global_gotno + g->local_gotno;
htab_traverse (g->got_entries, mips_elf_initialize_tls_index, g);
+ BFD_ASSERT (g->tls_assigned_gotno
+ == g->global_gotno + g->local_gotno + g->tls_gotno);
/* Allocate room for the TLS relocations. */
arg.info = info;