summaryrefslogtreecommitdiff
path: root/bfd/elfxx-mips.c
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@nildram.co.uk>2013-02-11 17:25:23 +0000
committerRichard Sandiford <rsandifo@nildram.co.uk>2013-02-11 17:25:23 +0000
commitd20ebe28d0e961fca74e7723c0fde61f4679e80f (patch)
treea438d1bfb1a791198c26fcf1ec829e76e6fc283c /bfd/elfxx-mips.c
parentfeb1a67662c58fd953b1d82051a153c9674f7ae1 (diff)
downloadbinutils-redhat-d20ebe28d0e961fca74e7723c0fde61f4679e80f.tar.gz
bfd/
* elfxx-mips.c (mips_elf_merge_got_with): Only use arg->global_count if there are TLS relocations.
Diffstat (limited to 'bfd/elfxx-mips.c')
-rw-r--r--bfd/elfxx-mips.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index 9a92e2dd2c..abf2156dc5 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -4275,10 +4275,10 @@ mips_elf_merge_got_with (struct mips_elf_bfd2got_hash *bfd2got,
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;