aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfxx-mips.c
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2011-04-10 11:10:30 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2011-04-10 11:10:30 +0000
commite2ece73c64432d4c43522de5d1a633ca12cc9155 (patch)
treefde2f566bf86e5d2a2a9c99ea23f67832717c5c5 /bfd/elfxx-mips.c
parenta9f20cdf6f12f06ce1dd51fb31c01870e6652bdf (diff)
downloadfsf-binutils-gdb-e2ece73c64432d4c43522de5d1a633ca12cc9155.zip
fsf-binutils-gdb-e2ece73c64432d4c43522de5d1a633ca12cc9155.tar.gz
fsf-binutils-gdb-e2ece73c64432d4c43522de5d1a633ca12cc9155.tar.bz2
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.
Diffstat (limited to 'bfd/elfxx-mips.c')
-rw-r--r--bfd/elfxx-mips.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index d5e99bb..b804eea 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)