* ld-sh/tlstpoff-1.d: New.
authorKaz Kojima <kkojima@rr.iij4u.or.jp>
Mon, 10 Feb 2003 22:19:26 +0000 (22:19 +0000)
committerKaz Kojima <kkojima@rr.iij4u.or.jp>
Mon, 10 Feb 2003 22:19:26 +0000 (22:19 +0000)
* ld-sh/tlstpoff-2.d: New.
* ld-sh/tlstpoff1.s: New.
* ld-sh/tlstpoff2.s: New.

ld/testsuite/ChangeLog
ld/testsuite/ld-sh/tlstpoff-1.d [new file with mode: 0644]
ld/testsuite/ld-sh/tlstpoff-2.d [new file with mode: 0644]
ld/testsuite/ld-sh/tlstpoff1.s [new file with mode: 0644]
ld/testsuite/ld-sh/tlstpoff2.s [new file with mode: 0644]

index 3b3e19aebc51f8fba00a43bedbd922bf82a1319c..b49ce0c4df93c245450a7fbf36d1285d16c69c9f 100644 (file)
@@ -1,3 +1,10 @@
+2003-02-10  Kaz kojima  <kkojima@rr.iij4u.or.jp>
+
+       * ld-sh/tlstpoff-1.d: New.
+       * ld-sh/tlstpoff-2.d: New.
+       * ld-sh/tlstpoff1.s: New.
+       * ld-sh/tlstpoff2.s: New.
+
 2003-02-09  Alan Modra  <amodra@bigpond.net.au>
 
        * ld-powerpc/tlslib.s: Give .__tls_get_addr function type.
diff --git a/ld/testsuite/ld-sh/tlstpoff-1.d b/ld/testsuite/ld-sh/tlstpoff-1.d
new file mode 100644 (file)
index 0000000..2364b1e
--- /dev/null
@@ -0,0 +1,31 @@
+#source: tlstpoff1.s
+#source: tlstpoff2.s
+#as: -little
+#ld: -EL -e foo
+#objdump: -drj.text
+#target: sh*-*-linux* sh*-*-netbsd*
+
+.*: +file format elf32-sh.*
+
+Disassembly of section \.text:
+
+[0-9a-f]+ <foo>:
+  [0-9a-f]+:   c6 2f           mov.l   r12,@-r15
+  [0-9a-f]+:   07 c7           mova    [0-9a-f]+ <foo\+0x20>,r0
+  [0-9a-f]+:   06 dc           mov.l   [0-9a-f]+ <foo\+0x20>,r12       ! 0x[0-9a-f]+
+  [0-9a-f]+:   0c 3c           add     r0,r12
+  [0-9a-f]+:   02 d0           mov.l   [0-9a-f]+ <foo\+0x14>,r0        ! 0xc
+  [0-9a-f]+:   12 01           stc     gbr,r1
+  [0-9a-f]+:   ce 00           mov.l   @\(r0,r12\),r0
+  [0-9a-f]+:   03 a0           bra     [0-9a-f]+ <foo\+0x18>
+  [0-9a-f]+:   0c 31           add     r0,r1
+  [0-9a-f]+:   09 00           nop     
+  [0-9a-f]+:   0c 00           .*[     ]*.*
+  [0-9a-f]+:   00 00           .*[     ]*.*
+  [0-9a-f]+:   12 60           mov.l   @r1,r0
+  [0-9a-f]+:   0b 00           rts     
+  [0-9a-f]+:   f6 6c           mov.l   @r15\+,r12
+  [0-9a-f]+:   09 00           nop     
+  [0-9a-f]+:   [0-9a-f]+ [0-9a-f]+             .*[     ]*.*
+  [0-9a-f]+:   [0-9a-f]+ [0-9a-f]+             .*[     ]*.*
+#pass
diff --git a/ld/testsuite/ld-sh/tlstpoff-2.d b/ld/testsuite/ld-sh/tlstpoff-2.d
new file mode 100644 (file)
index 0000000..ee928fd
--- /dev/null
@@ -0,0 +1,12 @@
+#source: tlstpoff1.s
+#source: tlstpoff2.s
+#as: -little
+#ld: -EL -e foo
+#readelf: -r
+#target: sh*-*-linux* sh*-*-netbsd*
+
+Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 2 entries:
+ Offset +Info +Type +Sym\.Value +Sym\. Name \+ Addend
+0+[0-9a-f]+  00000097 R_SH_TLS_TPOFF32 +0+04
+0+[0-9a-f]+  00000097 R_SH_TLS_TPOFF32 +0+04
+
diff --git a/ld/testsuite/ld-sh/tlstpoff1.s b/ld/testsuite/ld-sh/tlstpoff1.s
new file mode 100644 (file)
index 0000000..754f3c1
--- /dev/null
@@ -0,0 +1,23 @@
+       .text
+       .align 5
+       .global foo
+       .type   foo, @function
+foo:
+       mov.l   r12,@-r15
+       mova    .L1,r0
+       mov.l   .L1,r12
+       add     r0,r12
+       mov.l   1f,r0
+       stc     gbr,r1
+       mov.l   @(r0,r12),r0
+       bra     2f
+        add    r0,r1
+       .align 2
+1:     .long   x@GOTTPOFF
+2:     
+       mov.l   @r1,r0
+       rts     
+       mov.l   @r15+,r12
+
+       .align 2
+.L1:   .long   _GLOBAL_OFFSET_TABLE_
diff --git a/ld/testsuite/ld-sh/tlstpoff2.s b/ld/testsuite/ld-sh/tlstpoff2.s
new file mode 100644 (file)
index 0000000..6ae9e92
--- /dev/null
@@ -0,0 +1,26 @@
+       .section .tbss,"awT",@nobits
+       .global x
+y:     .space  4
+x:     .space  4
+
+       .section barfn,"ax",@progbits
+       .align  1
+       .type   bar, @function
+bar:   
+       mova    .L1,r0
+       mov.l   .L1,r12
+       add     r0,r12
+       mov.l   1f,r0
+       stc     gbr,r1
+       mov.l   @(r0,r12),r0
+       bra     2f
+       add     r0,r1
+       .align  2
+1:     .long   x@GOTTPOFF
+2:
+       mov.l   @r1,r0
+       rts     
+       mov.l   @r15+,r12
+
+       .align 2
+.L1:   .long   _GLOBAL_OFFSET_TABLE_