aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2011-03-12 14:38:31 +0000
committerH.J. Lu <hjl.tools@gmail.com>2011-03-12 14:38:31 +0000
commit52bc799a91cd19a56cb59a9ecd29c0f63153c302 (patch)
tree9758117f87054ed61dcb91856653af377acef75d /ld/testsuite
parentdbc6760729c24524100f30592d0c0df31b2b41c8 (diff)
downloadgdb-52bc799a91cd19a56cb59a9ecd29c0f63153c302.zip
gdb-52bc799a91cd19a56cb59a9ecd29c0f63153c302.tar.gz
gdb-52bc799a91cd19a56cb59a9ecd29c0f63153c302.tar.bz2
Support TLS x32 GD->IE, GD->LE and LD->LE transitions.
bfd/ 2011-03-12 H.J. Lu <hongjiu.lu@intel.com> * elf64-x86-64.c (elf_x86_64_check_tls_transition): Supprt TLS x32 GD->IE and GD->LE transitions. (elf_x86_64_relocate_section): Supprt TLS x32 GD->IE, GD->LE and LD->LE transitions. ld/testsuite/ 2011-03-12 H.J. Lu <hongjiu.lu@intel.com> * ld-x86-64/tlsgd4.dd: New. * ld-x86-64/tlsgd4.s: Likewise. * ld-x86-64/tlsgd5.dd: Likewise. * ld-x86-64/tlsgd5a.s: Likewise. * ld-x86-64/tlsgd5b.s: Likewise. * ld-x86-64/tlsgd6.dd: Likewise. * ld-x86-64/tlsgd6a.s: Likewise. * ld-x86-64/tlsgd6b.s: Likewise. * ld-x86-64/tlsld2.dd: Likewise. * ld-x86-64/tlsld2.s: Likewise. * ld-x86-64/x86-64.exp (x86_64tests): Add tlsgd4, libtlsgd5.so, tlsgd5, libtlsgd6.so, tlsgd6 and tlsld2.
Diffstat (limited to 'ld/testsuite')
-rw-r--r--ld/testsuite/ChangeLog16
-rw-r--r--ld/testsuite/ld-x86-64/tlsgd4.dd10
-rw-r--r--ld/testsuite/ld-x86-64/tlsgd4.s14
-rw-r--r--ld/testsuite/ld-x86-64/tlsgd5.dd14
-rw-r--r--ld/testsuite/ld-x86-64/tlsgd5a.s8
-rw-r--r--ld/testsuite/ld-x86-64/tlsgd5b.s7
-rw-r--r--ld/testsuite/ld-x86-64/tlsgd6.dd14
-rw-r--r--ld/testsuite/ld-x86-64/tlsgd6a.s7
-rw-r--r--ld/testsuite/ld-x86-64/tlsgd6b.s7
-rw-r--r--ld/testsuite/ld-x86-64/tlsld2.dd14
-rw-r--r--ld/testsuite/ld-x86-64/tlsld2.s12
-rw-r--r--ld/testsuite/ld-x86-64/x86-64.exp16
12 files changed, 139 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index c5bad13..603089c 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,19 @@
+2011-03-12 H.J. Lu <hongjiu.lu@intel.com>
+
+ * ld-x86-64/tlsgd4.dd: New.
+ * ld-x86-64/tlsgd4.s: Likewise.
+ * ld-x86-64/tlsgd5.dd: Likewise.
+ * ld-x86-64/tlsgd5a.s: Likewise.
+ * ld-x86-64/tlsgd5b.s: Likewise.
+ * ld-x86-64/tlsgd6.dd: Likewise.
+ * ld-x86-64/tlsgd6a.s: Likewise.
+ * ld-x86-64/tlsgd6b.s: Likewise.
+ * ld-x86-64/tlsld2.dd: Likewise.
+ * ld-x86-64/tlsld2.s: Likewise.
+
+ * ld-x86-64/x86-64.exp (x86_64tests): Add tlsgd4, libtlsgd5.so,
+ tlsgd5, libtlsgd6.so, tlsgd6 and tlsld2.
+
2011-03-03 H.J. Lu <hongjiu.lu@intel.com>
* ld-x86-64/tlsie4.dd: New.
diff --git a/ld/testsuite/ld-x86-64/tlsgd4.dd b/ld/testsuite/ld-x86-64/tlsgd4.dd
new file mode 100644
index 0000000..b8a99c8
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/tlsgd4.dd
@@ -0,0 +1,10 @@
+#target: x86_64-*-linux*
+
+.*: +file format .*
+
+Disassembly of section .text:
+
+[a-f0-9]+ <_start>:
+[ ]*[a-f0-9]+: 64 8b 04 25 00 00 00 00 mov %fs:0x0,%eax
+[ ]*[a-f0-9]+: 48 8d 80 fc ff ff ff lea -0x4\(%rax\),%rax
+#pass
diff --git a/ld/testsuite/ld-x86-64/tlsgd4.s b/ld/testsuite/ld-x86-64/tlsgd4.s
new file mode 100644
index 0000000..037ce25
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/tlsgd4.s
@@ -0,0 +1,14 @@
+ .text
+ .globl _start
+_start:
+ leaq foo@TLSGD(%rip), %rdi
+ .word 0x6666
+ rex64
+ call __tls_get_addr
+ .globl foo
+ .section .tdata,"awT",@progbits
+ .align 4
+ .type foo, @object
+ .size foo, 4
+foo:
+ .long 100
diff --git a/ld/testsuite/ld-x86-64/tlsgd5.dd b/ld/testsuite/ld-x86-64/tlsgd5.dd
new file mode 100644
index 0000000..7ca953a
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/tlsgd5.dd
@@ -0,0 +1,14 @@
+#source: tlsgd5a.s
+#as: --64
+#ld: -melf_x86_64 tmpdir/tlsgd5
+#objdump: -drw
+#target: x86_64-*-linux*
+
+.*: +file format .*
+
+Disassembly of section .text:
+
+[a-f0-9]+ <_start>:
+[ ]*[a-f0-9]+: 64 48 8b 04 25 00 00 00 00 mov %fs:0x0,%rax
+[ ]*[a-f0-9]+: 48 03 05 00 01 20 00 add 0x200100\(%rip\),%rax # 600368 <_DYNAMIC\+0x100>
+#pass
diff --git a/ld/testsuite/ld-x86-64/tlsgd5a.s b/ld/testsuite/ld-x86-64/tlsgd5a.s
new file mode 100644
index 0000000..b0f3fb2
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/tlsgd5a.s
@@ -0,0 +1,8 @@
+ .text
+ .globl _start
+_start:
+ .byte 0x66
+ leaq foo@TLSGD(%rip), %rdi
+ .word 0x6666
+ rex64
+ call __tls_get_addr
diff --git a/ld/testsuite/ld-x86-64/tlsgd5b.s b/ld/testsuite/ld-x86-64/tlsgd5b.s
new file mode 100644
index 0000000..eb7fd5a
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/tlsgd5b.s
@@ -0,0 +1,7 @@
+ .globl foo
+ .section .tdata,"awT",@progbits
+ .align 4
+ .type foo, @object
+ .size foo, 4
+foo:
+ .long 100
diff --git a/ld/testsuite/ld-x86-64/tlsgd6.dd b/ld/testsuite/ld-x86-64/tlsgd6.dd
new file mode 100644
index 0000000..e1d8238
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/tlsgd6.dd
@@ -0,0 +1,14 @@
+#source: tlsgd6a.s
+#as: --x32
+#ld: -melf32_x86_64 tmpdir/tlsgd6
+#objdump: -drw
+#target: x86_64-*-linux*
+
+.*: +file format .*
+
+Disassembly of section .text:
+
+[a-f0-9]+ <_start>:
+[ ]*[a-f0-9]+: 64 8b 04 25 00 00 00 00 mov %fs:0x0,%eax
+[ ]*[a-f0-9]+: 48 03 05 81 00 20 00 add 0x200081\(%rip\),%rax # 60022c <_DYNAMIC\+0x80>
+#pass
diff --git a/ld/testsuite/ld-x86-64/tlsgd6a.s b/ld/testsuite/ld-x86-64/tlsgd6a.s
new file mode 100644
index 0000000..a0a8069
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/tlsgd6a.s
@@ -0,0 +1,7 @@
+ .text
+ .globl _start
+_start:
+ leaq foo@TLSGD(%rip), %rdi
+ .word 0x6666
+ rex64
+ call __tls_get_addr
diff --git a/ld/testsuite/ld-x86-64/tlsgd6b.s b/ld/testsuite/ld-x86-64/tlsgd6b.s
new file mode 100644
index 0000000..eb7fd5a
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/tlsgd6b.s
@@ -0,0 +1,7 @@
+ .globl foo
+ .section .tdata,"awT",@progbits
+ .align 4
+ .type foo, @object
+ .size foo, 4
+foo:
+ .long 100
diff --git a/ld/testsuite/ld-x86-64/tlsld2.dd b/ld/testsuite/ld-x86-64/tlsld2.dd
new file mode 100644
index 0000000..3dbe3a8
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/tlsld2.dd
@@ -0,0 +1,14 @@
+#source: tlsld2.s
+#as: --x32
+#ld: -melf32_x86_64 tmpdir/tlsld2
+#objdump: -drw
+#target: x86_64-*-linux*
+
+.*: +file format .*
+
+Disassembly of section .text:
+
+[a-f0-9]+ <_start>:
+[ ]*[a-f0-9]+: 0f 1f 40 00 nopl 0x0\(%rax\)
+[ ]*[a-f0-9]+: 64 8b 04 25 00 00 00 00 mov %fs:0x0,%eax
+#pass
diff --git a/ld/testsuite/ld-x86-64/tlsld2.s b/ld/testsuite/ld-x86-64/tlsld2.s
new file mode 100644
index 0000000..6dcdd69
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/tlsld2.s
@@ -0,0 +1,12 @@
+ .text
+ .globl _start
+_start:
+ leaq foo@TLSLD(%rip), %rdi
+ call __tls_get_addr
+ .globl foo
+ .section .tdata,"awT",@progbits
+ .align 4
+ .type foo, @object
+ .size foo, 4
+foo:
+ .long 100
diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp
index 43b9c39..8e97729 100644
--- a/ld/testsuite/ld-x86-64/x86-64.exp
+++ b/ld/testsuite/ld-x86-64/x86-64.exp
@@ -90,6 +90,22 @@ set x86_64tests {
{"TLS X32 IE->LE transition" "-melf32_x86_64"
"--x32" {tlsie4.s}
{{objdump -dwr tlsie4.dd}} "tlsie4"}
+ {"TLS X32 GD->LE transition" "-melf32_x86_64"
+ "--x32" {tlsgd4.s}
+ {{objdump -dwr tlsgd4.dd}} "tlsgd4"}
+ {"Helper TLS GD->IE transition DSO" "-shared -melf_x86_64"
+ "--64" {tlsgd5b.s} {} "libtlsgd5.so"}
+ {"TLS GD->IE transition" "-melf_x86_64 tmpdir/libtlsgd5.so"
+ "--64" {tlsgd5a.s}
+ {{objdump -dwr tlsgd5.dd}} "tlsgd5"}
+ {"Helper TLS X32 GD->IE transition DSO" "-shared -melf32_x86_64"
+ "--x32" {tlsgd6b.s} {} "libtlsgd6.so"}
+ {"TLS X32 GD->IE transition" "-melf32_x86_64 tmpdir/libtlsgd6.so"
+ "--x32" {tlsgd6a.s}
+ {{objdump -dwr tlsgd6.dd}} "tlsgd6"}
+ {"TLS X32 LD->LE transition" "-melf32_x86_64"
+ "--x32" {tlsld2.s}
+ {{objdump -dwr tlsld2.dd}} "tlsld2"}
}
run_ld_link_tests $x86_64tests