bfd/
authorRichard Sandiford <rdsandiford@googlemail.com>
Mon, 11 Feb 2013 17:29:35 +0000 (17:29 +0000)
committerRichard Sandiford <rdsandiford@googlemail.com>
Mon, 11 Feb 2013 17:29:35 +0000 (17:29 +0000)
* 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.

bfd/ChangeLog
bfd/elfxx-mips.c
ld/testsuite/ChangeLog
ld/testsuite/ld-mips-elf/tlsdyn-o32-2.got
ld/testsuite/ld-mips-elf/tlsdyn-o32-3.got

index 6347d83fbe89cb7375f167867db93931a2b2f2be..67707ed5fb5070ff5b6d9cfa9655fcb40cfe7c88 100644 (file)
@@ -1,3 +1,11 @@
+2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       * 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.
+
 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * elfxx-mips.c (mips_elf_sort_hash_table_f): Remove asserts.
index f3259f4205606358b5a87f2e5c1ee3d7c3ad33c0..3073f526d1f9b79af3778600ba9da96f50486359 100644 (file)
@@ -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;
index c031a5edd3aba8b2e3a91f29df2ffff3e88854e8..b1bc8f3a95330e7511b8cfadd83668b532cebead 100644 (file)
@@ -1,3 +1,8 @@
+2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       * ld-mips-elf/tlsdyn-o32-2.got, ld-mips-elf/tlsdyn-o32-3.got: Remove
+       unused GOT entries.
+
 2013-02-07  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR ld/15107
index a0fbb8c6e82f26b45a366358ab12ddd5f8e8ada5..f43f312579952ca6bf8a85bc25a6e31fa7ae586b 100644 (file)
@@ -15,5 +15,4 @@ OFFSET   TYPE              VALUE
 Contents of section .got:
  10000020 00000000 80000000 004004ac 00000000  .*
  10000030 00000000 00000000 00000000 00000000  .*
- 10000040 00000001 00000000 00000000 00000000  .*
- 10000050 00000000 00000000                    .*
+ 10000040 00000001 00000000 00000000           .*
index aaf67714fb00f0211b3a50eac1da60e154ab0c77..7da535c26df3af9987cc0bd5859e984f980c25f7 100644 (file)
@@ -15,5 +15,4 @@ OFFSET   TYPE              VALUE
 Contents of section .got:
  10000020 00000000 80000000 0040055c 00000000  .*
  10000030 00000000 00000000 00000000 00000000  .*
- 10000040 00000001 00000000 00000000 00000000  .*
- 10000050 00000000 00000000                    .*
+ 10000040 00000001 00000000 00000000           .*
This page took 0.032818 seconds and 4 git commands to generate.