From: Richard Sandiford Date: Sun, 15 May 2011 19:04:20 +0000 (+0000) Subject: bfd/ X-Git-Tag: binutils-2_21_1~59 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d355688f042bd57abb0cb53be107912032656412;p=thirdparty%2Fbinutils-gdb.git 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. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index b9d811fbb64..dea69f59d04 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2011-05-15 Richard Sandiford + + 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 Apply 2011-04-17 Jan Kratochvil diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 2939af49156..ea3b53f4889 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)