summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@nildram.co.uk>2011-05-15 19:04:20 +0000
committerRichard Sandiford <rsandifo@nildram.co.uk>2011-05-15 19:04:20 +0000
commitf2cc39fbf4c54ef4d6eead79d4587dc2bd049f64 (patch)
tree4815071ef5a836947a4639f30eac9e925bade617
parent1d0e873a71a28ac05e80042b5dcce69c697ac643 (diff)
downloadbinutils-redhat-f2cc39fbf4c54ef4d6eead79d4587dc2bd049f64.tar.gz
bfd/
PR ld/12637 * elfxx-mips.c (mips_elf_merge_got_with): Use arg->global_count as the number of global entries when merging with the primary GOT.
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elfxx-mips.c18
2 files changed, 17 insertions, 7 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index b9d811fbb6..dea69f59d0 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2011-05-15 Richard Sandiford <rdsandiford@googlemail.com>
+
+ PR ld/12637
+ * elfxx-mips.c (mips_elf_merge_got_with): Use arg->global_count
+ as the number of global entries when merging with the primary GOT.
+
2011-05-13 Alan Modra <amodra@gmail.com>
Apply 2011-04-17 Jan Kratochvil <jan.kratochvil@redhat.com>
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index 2939af4915..ea3b53f488 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -4080,14 +4080,18 @@ mips_elf_merge_got_with (struct mips_elf_bfd2got_hash *bfd2got,
if (estimate >= from->page_gotno + to->page_gotno)
estimate = from->page_gotno + to->page_gotno;
- /* And conservatively estimate how many local, global and TLS entries
+ /* And conservatively estimate how many local and TLS entries
would be needed. */
- estimate += (from->local_gotno
- + from->global_gotno
- + from->tls_gotno
- + to->local_gotno
- + to->global_gotno
- + to->tls_gotno);
+ 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
+ conservatively as well. */
+ if (to == arg->primary)
+ estimate += arg->global_count;
+ else
+ estimate += from->global_gotno + to->global_gotno;
/* Bail out if the combined GOT might be too big. */
if (estimate > arg->max_count)