]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
bfd/
authorRichard Sandiford <rdsandiford@googlemail.com>
Sat, 4 Feb 2006 08:29:58 +0000 (08:29 +0000)
committerRichard Sandiford <rdsandiford@googlemail.com>
Sat, 4 Feb 2006 08:29:58 +0000 (08:29 +0000)
* elfxx-mips.c (mips_elf_initialize_tls_index): If a TLS symbol
has already been assigned a GOT index, copy that index to the
current hash table entry.

ld/testsuite/
* ld-mips-elf/tls-hidden2a.s, ld-mips-elf/tls-hidden2b.s,
* ld/testsuite/ld-mips-elf/tls-hidden2.d,
* ld/testsuite/ld-mips-elf/tls-hidden2-got.d: New test.
* ld-mips-elf/mips-elf.exp: Run it.

bfd/ChangeLog
bfd/elfxx-mips.c
ld/testsuite/ChangeLog
ld/testsuite/ld-mips-elf/mips-elf.exp
ld/testsuite/ld-mips-elf/tls-hidden2-got.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/tls-hidden2.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/tls-hidden2a.s [new file with mode: 0644]
ld/testsuite/ld-mips-elf/tls-hidden2b.s [new file with mode: 0644]

index 5bd1e341ac00c6024080763cf2e369fc1b6d1bd9..f2ca17dcf4845ef6e587416c51a4691d4d72c01d 100644 (file)
@@ -1,3 +1,9 @@
+2006-02-04  Richard Sandiford  <richard@codesourcery.com>
+
+       * elfxx-mips.c (mips_elf_initialize_tls_index): If a TLS symbol
+       has already been assigned a GOT index, copy that index to the
+       current hash table entry.
+
 2006-02-01  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
        * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Reinstate bypass
index 99a0def3b9daaf8a252e4f18dd01f67e574998b9..2675ee08a1062f73517045507d16fd0e4b3439fe 100644 (file)
@@ -2994,7 +2994,10 @@ mips_elf_initialize_tls_index (void **entryp, void *p)
       if (g->next == NULL)
        {
          if (entry->d.h->tls_type & GOT_TLS_OFFSET_DONE)
-           return 1;
+           {
+             entry->gotidx = entry->d.h->tls_got_offset;
+             return 1;
+           }
          entry->d.h->tls_type |= GOT_TLS_OFFSET_DONE;
        }
     }
index ac9aaddef4de5e89ca11585b95d12f0e76d31a18..f7e13cdf4fedc03e9cda3f947b5ad5c0719cadfd 100644 (file)
@@ -1,3 +1,10 @@
+2006-02-04  Richard Sandiford  <richard@codesourcery.com>
+
+       * ld-mips-elf/tls-hidden2a.s, ld-mips-elf/tls-hidden2b.s,
+       * ld/testsuite/ld-mips-elf/tls-hidden2.d,
+       * ld/testsuite/ld-mips-elf/tls-hidden2-got.d: New test.
+       * ld-mips-elf/mips-elf.exp: Run it.
+
 2006-02-04  Richard Sandiford  <richard@codesourcery.com>
 
        * ld-mips-elf/rel32-n32.d: Adjust for changes in linker behaviour.
index 81f24b86761aa4f3bfa27c6c6b8bea9d248d16c1..da278ae452eb9f8de815d64f5aa06c1c96dddecc 100644 (file)
@@ -162,6 +162,11 @@ set mips_tls_tests {
      "-EB -march=mips1 -32 -KPIC" {tlslib-o32.s}
      {{objdump {-dr -m mips:isa32r2} tlslib-o32.d} {objdump -Rsj.got tlslib-o32-hidden.got}}
      "tlslib-o32-hidden.so"}
+    {"Shared library with TLS and hidden symbols (2)"
+     "-shared -melf32btsmip -T mips-lib.ld"
+     "-EB -march=mips1 -32 -KPIC" {tls-hidden2a.s tls-hidden2b.s}
+     {{objdump -drj.text tls-hidden2.d} {objdump -sj.got tls-hidden2-got.d}}
+     "tls-hidden2.so"}
 }
 
 if {[istarget mips*-*-linux*]} {
diff --git a/ld/testsuite/ld-mips-elf/tls-hidden2-got.d b/ld/testsuite/ld-mips-elf/tls-hidden2-got.d
new file mode 100644 (file)
index 0000000..69c0982
--- /dev/null
@@ -0,0 +1,6 @@
+
+.*file format.*
+
+Contents of section \.got:
+ *[0-9a-f]* 00000000 80000000 00000000 00000000 *\..*
+ *[0-9a-f]* 00000000 00000000 00000000 00000ba8 *\..*
diff --git a/ld/testsuite/ld-mips-elf/tls-hidden2.d b/ld/testsuite/ld-mips-elf/tls-hidden2.d
new file mode 100644 (file)
index 0000000..e6322ca
--- /dev/null
@@ -0,0 +1,10 @@
+
+.*file format.*
+
+Disassembly of section \.text:
+
+.* <.*>:
+.*:    8f82802c *      lw      v0,-32724\(gp\)
+       \.\.\.
+.*:    8f82802c *      lw      v0,-32724\(gp\)
+       \.\.\.
diff --git a/ld/testsuite/ld-mips-elf/tls-hidden2a.s b/ld/testsuite/ld-mips-elf/tls-hidden2a.s
new file mode 100644 (file)
index 0000000..91a0b9e
--- /dev/null
@@ -0,0 +1,11 @@
+       .text
+       lw      $2,%gottprel(tls_hidden)($28)
+
+       .section .tdata,"awT"
+       .globl  tls_hidden
+       .hidden tls_hidden
+       .type   tls_hidden,@object
+       .size   tls_hidden,4
+       .space  0xba8
+tls_hidden:
+       .word   1
diff --git a/ld/testsuite/ld-mips-elf/tls-hidden2b.s b/ld/testsuite/ld-mips-elf/tls-hidden2b.s
new file mode 100644 (file)
index 0000000..6a8e190
--- /dev/null
@@ -0,0 +1,2 @@
+       .text
+       lw      $2,%gottprel(tls_hidden)($28)