diff options
author | Richard Sandiford <rdsandiford@googlemail.com> | 2013-02-11 17:29:35 +0000 |
---|---|---|
committer | Richard Sandiford <rdsandiford@googlemail.com> | 2013-02-11 17:29:35 +0000 |
commit | 1fd20d7055267ce7d56a8adcdd1fbf80847300f3 (patch) | |
tree | 79d104b913272e4edf5c90e7c86b4ed2eb0edd0a /bfd/elfxx-mips.c | |
parent | 7d94b3191af0c590142ee723b5822f7ceb1ebf2d (diff) | |
download | gdb-1fd20d7055267ce7d56a8adcdd1fbf80847300f3.zip gdb-1fd20d7055267ce7d56a8adcdd1fbf80847300f3.tar.gz gdb-1fd20d7055267ce7d56a8adcdd1fbf80847300f3.tar.bz2 |
bfd/
* elfxx-mips.c (mips_elf_count_global_tls_entries)
(mips_elf_count_global_tls_relocs): Don't count indirect or
warning symbols.
(mips_elf_multi_got, mips_elf_lay_out_got): Assert that the right
number of TLS entries were allocated.
ld/testsuite/
* ld-mips-elf/tlsdyn-o32-2.got, ld-mips-elf/tlsdyn-o32-3.got: Remove
unused GOT entries.
Diffstat (limited to 'bfd/elfxx-mips.c')
-rw-r--r-- | bfd/elfxx-mips.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index f3259f4..3073f52 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -2982,6 +2982,10 @@ mips_elf_count_global_tls_entries (void *arg1, void *arg2) = (struct mips_elf_link_hash_entry *) arg1; struct mips_elf_count_tls_arg *arg = arg2; + if (hm->root.root.type == bfd_link_hash_indirect + || hm->root.root.type == bfd_link_hash_warning) + return 1; + if (hm->tls_type & GOT_TLS_GD) arg->needed += 2; if (hm->tls_type & GOT_TLS_IE) @@ -3000,6 +3004,10 @@ mips_elf_count_global_tls_relocs (void *arg1, void *arg2) = (struct mips_elf_link_hash_entry *) arg1; struct mips_elf_count_tls_arg *arg = arg2; + if (hm->root.root.type == bfd_link_hash_indirect + || hm->root.root.type == bfd_link_hash_warning) + return 1; + arg->needed += mips_tls_got_relocs (arg->info, hm->tls_type, &hm->root); return 1; @@ -4688,6 +4696,7 @@ mips_elf_multi_got (bfd *abfd, struct bfd_link_info *info, all non-TLS entries. */ g->tls_assigned_gotno = g->local_gotno + g->global_gotno; htab_traverse (g->got_entries, mips_elf_initialize_tls_index, g); + BFD_ASSERT (g->tls_assigned_gotno == assign); /* Move onto the next GOT. It will be a secondary GOT if nonull. */ g = gn; @@ -8956,6 +8965,8 @@ mips_elf_lay_out_got (bfd *output_bfd, struct bfd_link_info *info) /* Set up TLS entries. */ g->tls_assigned_gotno = g->global_gotno + g->local_gotno; htab_traverse (g->got_entries, mips_elf_initialize_tls_index, g); + BFD_ASSERT (g->tls_assigned_gotno + == g->global_gotno + g->local_gotno + g->tls_gotno); /* Allocate room for the TLS relocations. */ arg.info = info; |