+2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * elfxx-mips.c (mips_elf_merge_got_with): Only use arg->global_count
+ if there are TLS relocations.
+
2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
* elfxx-mips.c (mips_elf_recreate_got): Remove free.
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;