2010-12-21 Kai Tietz <kai.tietz@onevision.com>
authorKai Tietz <kai.tietz@onevision.com>
Tue, 21 Dec 2010 15:24:39 +0000 (15:24 +0000)
committerKai Tietz <kai.tietz@onevision.com>
Tue, 21 Dec 2010 15:24:39 +0000 (15:24 +0000)
        * peXXigen.c (_bfd_XXi_final_link_postscript): Use
        bfd_get_symbol_leading_char to determine "_tls_used" name.

2010-12-21  Kai Tietz  <kai.tietz@onevision.com>

* ld-pe/pe.exp: Add TLS directory test.
* ld-pe/tlssec.s: New.
* ld-pe/tlssec64.d: New.
* ld-pe/tlssec32.d: New.

bfd/ChangeLog
bfd/peXXigen.c
ld/testsuite/ChangeLog
ld/testsuite/ld-pe/pe.exp
ld/testsuite/ld-pe/tlssec.s [new file with mode: 0755]
ld/testsuite/ld-pe/tlssec32.d [new file with mode: 0755]
ld/testsuite/ld-pe/tlssec64.d [new file with mode: 0755]

index c86371552b8c4fc2e5a55c13c33764bd2f752978..7b8ca30d2cd83fb3758683c1721199f38ae4251e 100644 (file)
@@ -1,3 +1,8 @@
+2010-12-21  Kai Tietz  <kai.tietz@onevision.com>
+
+       * peXXigen.c (_bfd_XXi_final_link_postscript): Use
+       bfd_get_symbol_leading_char to determine "_tls_used" name.
+
 2010-12-21  Pierre Muller  <muller@ics.u-strasbg.fr>
 
        * peXXigen.c (_bfd_XXi_final_link_postscript): Use correct size
index 825229aab930a158ca0d20c7d8d88955ebdb2ecd..322c5ea8e45946a0538efb08fa6f4c781b98d11d 100644 (file)
@@ -2418,7 +2418,9 @@ _bfd_XXi_final_link_postscript (bfd * abfd, struct coff_final_link_info *pfinfo)
     }
 
   h1 = coff_link_hash_lookup (coff_hash_table (info),
-                             "__tls_used", FALSE, FALSE, TRUE);
+                             (bfd_get_symbol_leading_char(abfd) != 0
+                              ? "__tls_used" : "_tls_used"),
+                             FALSE, FALSE, TRUE);
   if (h1 != NULL)
     {
       if ((h1->root.type == bfd_link_hash_defined
index 90ff589d51dd4c954775b762ce86f112a469170b..78537d3047e81408f43b4b6e85623535e8f73377 100644 (file)
@@ -1,3 +1,10 @@
+2010-12-21  Kai Tietz  <kai.tietz@onevision.com>
+
+       * ld-pe/pe.exp: Add TLS directory test.
+       * ld-pe/tlssec.s: New.
+       * ld-pe/tlssec64.d: New.
+       * ld-pe/tlssec32.d: New.
+
 2010-12-20  Alan Modra  <amodra@gmail.com>
 
        * ld-bootstrap/bootstrap.exp: Fix misplaced comment.
index dd4b9f70d0bcf4257268c154044b2d88f7f0184c..183c5c6a4e43a88a9c3ae936ab6543e8d11ba484 100644 (file)
@@ -38,6 +38,8 @@ if {[istarget i*86-*-cygwin*]
         {{objdump -s secrel_64.d}} "secrel.x"}
        {"Empty export table" "" "" "exports.s"
         {{objdump -p exports64.d}} "exports.dll"}
+       {"TLS directory entry" "" "" "tlssec.s"
+        {{objdump -p tlssec64.d}} "tlssec.dll"}
       }
     } elseif {[istarget i*86-*-cygwin*] } {
       set pe_tests {
@@ -45,6 +47,8 @@ if {[istarget i*86-*-cygwin*]
         {{objdump -s secrel.d}} "secrel.x"}
        {"Empty export table" "" "" "exports.s"
         {{objdump -p exports.d}} "exports.dll"}
+       {"TLS directory entry" "" "" "tlssec.s"
+        {{objdump -p tlssec32.d}} "tlssec.dll"}
       }
     } else {
       set pe_tests {
@@ -52,6 +56,8 @@ if {[istarget i*86-*-cygwin*]
         {{objdump -s secrel.d}} "secrel.x"}
        {"Empty export table" "" "" "exports.s"
         {{objdump -p exports.d}} "exports.dll"}
+       {"TLS directory entry" "" "" "tlssec.s"
+        {{objdump -p tlssec32.d}} "tlssec.dll"}
       }
     }
 
diff --git a/ld/testsuite/ld-pe/tlssec.s b/ld/testsuite/ld-pe/tlssec.s
new file mode 100755 (executable)
index 0000000..ba14881
--- /dev/null
@@ -0,0 +1,20 @@
+.global _tls_used
+.global __tls_used
+.global _start
+.global start
+.global _mainCRTStartup
+.global mainCRTStartup
+
+.text
+_start:
+mainCRTStartup:
+_mainCRTStartup:
+        .byte 1
+
+.section .tls
+_tls_used:
+__tls_used:
+.long 1,2,3,4,5,6,7,8,9,10
+.long 11,12,13,14,15,16,17,18,19,20
+.long 21,22,23,24,25,26,27,28,29,30
+
diff --git a/ld/testsuite/ld-pe/tlssec32.d b/ld/testsuite/ld-pe/tlssec32.d
new file mode 100755 (executable)
index 0000000..0114064
--- /dev/null
@@ -0,0 +1,3 @@
+#...
+Entry 9 00003000 00000018 Thread Storage Directory \[\.tls\]
+#...
diff --git a/ld/testsuite/ld-pe/tlssec64.d b/ld/testsuite/ld-pe/tlssec64.d
new file mode 100755 (executable)
index 0000000..692d9e4
--- /dev/null
@@ -0,0 +1,3 @@
+#...
+Entry 9 0000000000003000 00000028 Thread Storage Directory \[\.tls\]
+#...