From: Richard Sandiford Date: Mon, 11 Feb 2013 17:25:23 +0000 (+0000) Subject: bfd/ X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=172149374ec64b82f39a3d572211bfe92e62b182;p=binutils-gdb.git bfd/ * elfxx-mips.c (mips_elf_merge_got_with): Only use arg->global_count if there are TLS relocations. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 79c410227af..be33a475425 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2013-02-11 Richard Sandiford + + * elfxx-mips.c (mips_elf_merge_got_with): Only use arg->global_count + if there are TLS relocations. + 2013-02-11 Richard Sandiford * elfxx-mips.c (mips_elf_recreate_got): Remove free. diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 9a92e2dd2cb..abf2156dc52 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;