aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-x86-64
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2007-08-24 19:39:19 +0000
committerH.J. Lu <hjl.tools@gmail.com>2007-08-24 19:39:19 +0000
commitdd1093aa2c82bcd88a4d16cb7fa7884733583f5e (patch)
tree2396ba330b67e198fdead4adfb18e5651ce5f98f /ld/testsuite/ld-x86-64
parent495bde8ec4ea55e74afc44cc1ae01d98d0c4a28f (diff)
downloadgdb-dd1093aa2c82bcd88a4d16cb7fa7884733583f5e.zip
gdb-dd1093aa2c82bcd88a4d16cb7fa7884733583f5e.tar.gz
gdb-dd1093aa2c82bcd88a4d16cb7fa7884733583f5e.tar.bz2
2007-08-24 H.J. Lu <hongjiu.lu@intel.com>
* ld-i386/i386.exp (i386tests): Add a test for TLS IE->LE transition. Run tlsie2, tlsie3, tlsie4 and tlsie5. * ld-i386/tlsie1.dd: New file. * ld-i386/tlsie1.s: Likewise. * ld-i386/tlsie2.d: Likewise. * ld-i386/tlsie2.s: Likewise. * ld-i386/tlsie3.d: Likewise. * ld-i386/tlsie3.s: Likewise. * ld-i386/tlsie4.d: Likewise. * ld-i386/tlsie4.s: Likewise. * ld-i386/tlsie5.d: Likewise. * ld-i386/tlsie5.s: Likewise. * ld-x86-64/tlsgd2.d: Likewise. * ld-x86-64/tlsgd2.s: Likewise. * ld-x86-64/tlsgd3.d: Likewise. * ld-x86-64/tlsgd3.s: Likewise. * ld-x86-64/tlsie1.dd: Likewise. * ld-x86-64/tlsie1.s: Likewise. * ld-x86-64/tlsie2.d: Likewise. * ld-x86-64/tlsie2.s: Likewise. * ld-x86-64/tlsie3.d: Likewise. * ld-x86-64/tlsie3.s: Likewise. * ld-x86-64/x86-64.exp (x86_64tests): Add a test for TLS LD->LE transition. Run tlsgd2, tlsgd3, tlsie2 and tlsie3.
Diffstat (limited to 'ld/testsuite/ld-x86-64')
-rw-r--r--ld/testsuite/ld-x86-64/tlsgd2.d4
-rw-r--r--ld/testsuite/ld-x86-64/tlsgd2.s5
-rw-r--r--ld/testsuite/ld-x86-64/tlsgd3.d4
-rw-r--r--ld/testsuite/ld-x86-64/tlsgd3.s11
-rw-r--r--ld/testsuite/ld-x86-64/tlsie1.dd16
-rw-r--r--ld/testsuite/ld-x86-64/tlsie1.s14
-rw-r--r--ld/testsuite/ld-x86-64/tlsie2.d4
-rw-r--r--ld/testsuite/ld-x86-64/tlsie2.s12
-rw-r--r--ld/testsuite/ld-x86-64/tlsie3.d4
-rw-r--r--ld/testsuite/ld-x86-64/tlsie3.s12
-rw-r--r--ld/testsuite/ld-x86-64/x86-64.exp7
11 files changed, 93 insertions, 0 deletions
diff --git a/ld/testsuite/ld-x86-64/tlsgd2.d b/ld/testsuite/ld-x86-64/tlsgd2.d
new file mode 100644
index 0000000..494560b
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/tlsgd2.d
@@ -0,0 +1,4 @@
+#name: TLS GD->IE transition check
+#as: --64
+#ld: -melf_x86_64
+#error: .*TLS transition from R_X86_64_TLSGD to R_X86_64_GOTTPOFF against `foo'.*failed.*
diff --git a/ld/testsuite/ld-x86-64/tlsgd2.s b/ld/testsuite/ld-x86-64/tlsgd2.s
new file mode 100644
index 0000000..f583c85
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/tlsgd2.s
@@ -0,0 +1,5 @@
+ .text
+ .globl _start
+_start:
+ leaq foo@TLSGD(%rip), %rdi
+ call __tls_get_addr
diff --git a/ld/testsuite/ld-x86-64/tlsgd3.d b/ld/testsuite/ld-x86-64/tlsgd3.d
new file mode 100644
index 0000000..40f8e3d
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/tlsgd3.d
@@ -0,0 +1,4 @@
+#name: TLS GD->LE transition check
+#as: --64
+#ld: -melf_x86_64
+#error: .*TLS transition from R_X86_64_TLSGD to R_X86_64_TPOFF32 against `a local symbol'.*failed.*
diff --git a/ld/testsuite/ld-x86-64/tlsgd3.s b/ld/testsuite/ld-x86-64/tlsgd3.s
new file mode 100644
index 0000000..e1e7e60
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/tlsgd3.s
@@ -0,0 +1,11 @@
+ .text
+ .globl _start
+_start:
+ leaq foo@TLSGD(%rip), %rdi
+ call __tls_get_addr
+ .section .tdata,"awT",@progbits
+ .align 4
+ .type foo, @object
+ .size foo, 4
+foo:
+ .long 100
diff --git a/ld/testsuite/ld-x86-64/tlsie1.dd b/ld/testsuite/ld-x86-64/tlsie1.dd
new file mode 100644
index 0000000..74dc39b
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/tlsie1.dd
@@ -0,0 +1,16 @@
+#source: tlsie1.s
+#as: --64
+#ld: -melf_x86_64 tmpdir/tlsie1
+#objdump: -drw
+#target: x86_64-*-linux*
+
+.*: +file format .*
+
+Disassembly of section .text:
+
+[a-f0-9]+ <_start>:
+[ ]*[a-f0-9]+: 48 c7 c0 fc ff ff ff mov \$0xfffffffffffffffc,%rax
+[ ]*[a-f0-9]+: 48 8d 80 fc ff ff ff lea -0x4\(%rax\),%rax
+[ ]*[a-f0-9]+: 49 c7 c4 fc ff ff ff mov \$0xfffffffffffffffc,%r12
+[ ]*[a-f0-9]+: 49 81 c4 fc ff ff ff add \$0xfffffffffffffffc,%r12
+#pass
diff --git a/ld/testsuite/ld-x86-64/tlsie1.s b/ld/testsuite/ld-x86-64/tlsie1.s
new file mode 100644
index 0000000..c7722b1
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/tlsie1.s
@@ -0,0 +1,14 @@
+ .text
+ .globl _start
+_start:
+ movq foo@GOTTPOFF(%rip), %rax
+ addq foo@GOTTPOFF(%rip), %rax
+ movq foo@GOTTPOFF(%rip), %r12
+ addq foo@GOTTPOFF(%rip), %r12
+ .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/tlsie2.d b/ld/testsuite/ld-x86-64/tlsie2.d
new file mode 100644
index 0000000..97dcc28
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/tlsie2.d
@@ -0,0 +1,4 @@
+#name: TLS IE->LE transition check
+#as: --64
+#ld: -melf_x86_64
+#error: .*TLS transition from R_X86_64_GOTTPOFF to R_X86_64_TPOFF32 against `foo'.*failed.*
diff --git a/ld/testsuite/ld-x86-64/tlsie2.s b/ld/testsuite/ld-x86-64/tlsie2.s
new file mode 100644
index 0000000..c9b9bfb
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/tlsie2.s
@@ -0,0 +1,12 @@
+ .text
+ .globl _start
+_start:
+ leaq foo@GOTTPOFF(%rip), %rax
+ movq (%rax), %rax
+ .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/tlsie3.d b/ld/testsuite/ld-x86-64/tlsie3.d
new file mode 100644
index 0000000..8c982a6
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/tlsie3.d
@@ -0,0 +1,4 @@
+#name: TLS IE->LE transition check (%r12)
+#as: --64
+#ld: -melf_x86_64
+#error: .*TLS transition from R_X86_64_GOTTPOFF to R_X86_64_TPOFF32 against `foo'.*failed.*
diff --git a/ld/testsuite/ld-x86-64/tlsie3.s b/ld/testsuite/ld-x86-64/tlsie3.s
new file mode 100644
index 0000000..13faf34
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/tlsie3.s
@@ -0,0 +1,12 @@
+ .text
+ .globl _start
+_start:
+ leaq foo@GOTTPOFF(%rip), %r12
+ movq (%r12), %r12
+ .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 3d25129..cd26091 100644
--- a/ld/testsuite/ld-x86-64/x86-64.exp
+++ b/ld/testsuite/ld-x86-64/x86-64.exp
@@ -72,6 +72,9 @@ set x86_64tests {
{"TLS LD->LE transition" "-melf_x86_64"
"--64" {tlsld1.s}
{{objdump -dwr tlsld1.dd}} "tlsld1"}
+ {"TLS IE->LE transition" "-melf_x86_64"
+ "--64" {tlsie1.s}
+ {{objdump -dwr tlsie1.dd}} "tlsie1"}
}
run_ld_link_tests $x86_64tests
@@ -79,3 +82,7 @@ run_ld_link_tests $x86_64tests
run_dump_test "abs"
run_dump_test "pcrel8"
run_dump_test "pcrel16"
+run_dump_test "tlsgd2"
+run_dump_test "tlsgd3"
+run_dump_test "tlsie2"
+run_dump_test "tlsie3"