aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog15
-rw-r--r--ld/testsuite/ld-i386/i386.exp6
-rw-r--r--ld/testsuite/ld-i386/tlsgd1.dd14
-rw-r--r--ld/testsuite/ld-i386/tlsgd1.s12
-rw-r--r--ld/testsuite/ld-i386/tlsld1.dd15
-rw-r--r--ld/testsuite/ld-i386/tlsld1.s12
-rw-r--r--ld/testsuite/ld-x86-64/tlsgd1.dd14
-rw-r--r--ld/testsuite/ld-x86-64/tlsgd1.s15
-rw-r--r--ld/testsuite/ld-x86-64/tlsld1.dd13
-rw-r--r--ld/testsuite/ld-x86-64/tlsld1.s12
-rw-r--r--ld/testsuite/ld-x86-64/x86-64.exp6
11 files changed, 134 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 5e0310f..b9931ce 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,18 @@
+2007-08-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/4918
+ * ld-i386/i386.exp (i386tests): Add tlsgd1 and tlsld1 tests.
+ * ld-x86-64/x86-64.exp (x86_64tests): Likewise.
+
+ * ld-i386/tlsgd1.dd: New file.
+ * ld-i386/tlsgd1.s: Likewise.
+ * ld-i386/tlsld1.dd: Likewise.
+ * ld-i386/tlsld1.s: Likewise.
+ * ld-x86-64/tlsgd1.dd: Likewise.
+ * ld-x86-64/tlsgd1.s: Likewise.
+ * ld-x86-64/tlsld1.dd: Likewise.
+ * ld-x86-64/tlsld1.s: Likewise.
+
2007-08-13 Richard Sandiford <richard@codesourcery.com>
* ld-mips-elf/vxworks-forced-local-1.d,
diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp
index 6b98519..2c7c14b 100644
--- a/ld/testsuite/ld-i386/i386.exp
+++ b/ld/testsuite/ld-i386/i386.exp
@@ -109,6 +109,12 @@ set i386tests {
{emit-relocs.s} {{readelf --relocs emit-relocs.d}} "emit-relocs.so"}
{"-z combreloc relocation sections" "-shared -melf_i386 -z combreloc"
"--32" {combreloc.s} {{readelf -r combreloc.d}} "combreloc.so"}
+ {"TLS GD->LE transition" "-melf_i386"
+ "--32" {tlsgd1.s}
+ {{objdump -dwr tlsgd1.dd}} "tlsgd1"}
+ {"TLS LD->LE transition" "-melf_i386"
+ "--32" {tlsld1.s}
+ {{objdump -dwr tlsld1.dd}} "tlsld1"}
}
run_ld_link_tests $i386tests
diff --git a/ld/testsuite/ld-i386/tlsgd1.dd b/ld/testsuite/ld-i386/tlsgd1.dd
new file mode 100644
index 0000000..54d7416
--- /dev/null
+++ b/ld/testsuite/ld-i386/tlsgd1.dd
@@ -0,0 +1,14 @@
+#source: tlsgd1.s
+#as: --32
+#ld: -melf_i386 tmpdir/tlsgd1
+#objdump: -drw
+#target: i?86-*-linux*
+
+.*: +file format .*
+
+Disassembly of section .text:
+
+[a-f0-9]+ <_start>:
+[ ]*[a-f0-9]+: 65 a1 00 00 00 00 mov %gs:0x0,%eax
+[ ]*[a-f0-9]+: 81 e8 04 00 00 00 sub \$0x4,%eax
+#pass
diff --git a/ld/testsuite/ld-i386/tlsgd1.s b/ld/testsuite/ld-i386/tlsgd1.s
new file mode 100644
index 0000000..2b3ed0e
--- /dev/null
+++ b/ld/testsuite/ld-i386/tlsgd1.s
@@ -0,0 +1,12 @@
+ .text
+ .globl _start
+_start:
+ leal foo@TLSGD(,%ebx,1), %eax
+ 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-i386/tlsld1.dd b/ld/testsuite/ld-i386/tlsld1.dd
new file mode 100644
index 0000000..782eb5a
--- /dev/null
+++ b/ld/testsuite/ld-i386/tlsld1.dd
@@ -0,0 +1,15 @@
+#source: tlsld1.s
+#as: --32
+#ld: -melf_i386 tmpdir/tlsld1
+#objdump: -drw
+#target: i?86-*-linux*
+
+.*: +file format .*
+
+Disassembly of section .text:
+
+[a-f0-9]+ <_start>:
+[ ]*[a-f0-9]+: 65 a1 00 00 00 00 mov %gs:0x0,%eax
+[ ]*[a-f0-9]+: 90 nop
+[ ]*[a-f0-9]+: 8d 74 26 00 lea 0x0\(%esi\),%esi
+#pass
diff --git a/ld/testsuite/ld-i386/tlsld1.s b/ld/testsuite/ld-i386/tlsld1.s
new file mode 100644
index 0000000..5d57e35
--- /dev/null
+++ b/ld/testsuite/ld-i386/tlsld1.s
@@ -0,0 +1,12 @@
+ .text
+ .globl _start
+_start:
+ leal foo@TLSLDM(%ebx), %eax
+ 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/tlsgd1.dd b/ld/testsuite/ld-x86-64/tlsgd1.dd
new file mode 100644
index 0000000..b4f3c99
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/tlsgd1.dd
@@ -0,0 +1,14 @@
+#source: tlsgd1.s
+#as: --64
+#ld: -melf_x86_64 tmpdir/tlsgd1
+#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 8d 80 fc ff ff ff lea -0x4\(%rax\),%rax
+#pass
diff --git a/ld/testsuite/ld-x86-64/tlsgd1.s b/ld/testsuite/ld-x86-64/tlsgd1.s
new file mode 100644
index 0000000..e5f52ed
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/tlsgd1.s
@@ -0,0 +1,15 @@
+ .text
+ .globl _start
+_start:
+ .byte 0x66
+ 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/tlsld1.dd b/ld/testsuite/ld-x86-64/tlsld1.dd
new file mode 100644
index 0000000..c10f7ff
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/tlsld1.dd
@@ -0,0 +1,13 @@
+#source: tlsld1.s
+#as: --64
+#ld: -melf_x86_64 tmpdir/tlsld1
+#objdump: -drw
+#target: x86_64-*-linux*
+
+.*: +file format .*
+
+Disassembly of section .text:
+
+[a-f0-9]+ <_start>:
+[ ]*[a-f0-9]+: 66 66 66 64 48 8b 04 25 00 00 00 00 mov %fs:0x0,%rax
+#pass
diff --git a/ld/testsuite/ld-x86-64/tlsld1.s b/ld/testsuite/ld-x86-64/tlsld1.s
new file mode 100644
index 0000000..6dcdd69
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/tlsld1.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 75c5273..3d25129 100644
--- a/ld/testsuite/ld-x86-64/x86-64.exp
+++ b/ld/testsuite/ld-x86-64/x86-64.exp
@@ -66,6 +66,12 @@ set x86_64tests {
{"TLS in debug sections" "-melf_x86_64"
"--64" {tlsg.s}
{{objdump -sj.debug_foobar tlsg.sd}} "tlsg"}
+ {"TLS GD->LE transition" "-melf_x86_64"
+ "--64" {tlsgd1.s}
+ {{objdump -dwr tlsgd1.dd}} "tlsgd1"}
+ {"TLS LD->LE transition" "-melf_x86_64"
+ "--64" {tlsld1.s}
+ {{objdump -dwr tlsld1.dd}} "tlsld1"}
}
run_ld_link_tests $x86_64tests