diff options
Diffstat (limited to 'ld/testsuite')
-rw-r--r-- | ld/testsuite/ChangeLog | 10 | ||||
-rw-r--r-- | ld/testsuite/ld-m68k/m68k.exp | 18 | ||||
-rw-r--r-- | ld/testsuite/ld-m68k/tls-def-1.d | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-m68k/tls-def-1.s | 9 | ||||
-rw-r--r-- | ld/testsuite/ld-m68k/tls-gd-1.d2 | 5 | ||||
-rw-r--r-- | ld/testsuite/ld-m68k/tls-gd-1.d3 | 13 | ||||
-rw-r--r-- | ld/testsuite/ld-m68k/tls-main-1.d | 15 | ||||
-rw-r--r-- | ld/testsuite/ld-m68k/tls-main-1.s | 19 |
8 files changed, 92 insertions, 1 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index d57d2f0..aafb869 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,13 @@ +2009-08-26 Maxim Kuvyrkov <maxim@codesourcery.com> + + * ld-m68k/tls-def-1.s: New file. + * ld-m68k/tls-def-1.d: New file. + * ld-m68k/tls-gd-1.d2: New file. + * ld-m68k/tls-gd-1.d3: New file. + * ld-m68k/tls-main-1.s: New file. + * ld-m68k/tls-main-1.d: New file. + * ld-m68k/m68k.exp: Run new TLS tests. + 2009-08-23 Andreas Schwab <schwab@linux-m68k.org> * ld-powerpc/powerpc.exp: Move relaxing and relocatable relaxing diff --git a/ld/testsuite/ld-m68k/m68k.exp b/ld/testsuite/ld-m68k/m68k.exp index 214c640..198a5e2 100644 --- a/ld/testsuite/ld-m68k/m68k.exp +++ b/ld/testsuite/ld-m68k/m68k.exp @@ -1,5 +1,5 @@ # Expect script for run_dump_test based ld-m68k tests. -# Copyright 2006, 2007, 2008 Free Software Foundation, Inc. +# Copyright 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # @@ -74,4 +74,20 @@ if { [istarget m68k-*-linux*] } then { run_dump_test "tls-ie-1" run_dump_test "tls-ld-1" run_dump_test "tls-ld-2" + + set m68k_tls_tests { + {"TLS definition" + "-shared" "" {tls-def-1.s} + {{nm -ngD tls-def-1.d}} + "tls-def-1.so"} + {"TLS direct symbol use" + "-shared tmpdir/tls-def-1.so" "" {tls-gd-1.s} + {{nm -ngD tls-gd-1.d2} {readelf -d tls-gd-1.d3}} + "tls-gd-1.so"} + {"TLS indirect symbol use" + "tmpdir/tls-gd-1.so -rpath-link ./" "" {tls-main-1.s} + {{readelf -d tls-main-1.d}} + "tls-main-1"}} + + run_ld_link_tests $m68k_tls_tests } diff --git a/ld/testsuite/ld-m68k/tls-def-1.d b/ld/testsuite/ld-m68k/tls-def-1.d new file mode 100644 index 0000000..59b4397 --- /dev/null +++ b/ld/testsuite/ld-m68k/tls-def-1.d @@ -0,0 +1,4 @@ +00000000 B x +.* +.* +.* diff --git a/ld/testsuite/ld-m68k/tls-def-1.s b/ld/testsuite/ld-m68k/tls-def-1.s new file mode 100644 index 0000000..3d758a9 --- /dev/null +++ b/ld/testsuite/ld-m68k/tls-def-1.s @@ -0,0 +1,9 @@ +#NO_APP + .globl x + .section .tbss,"awT",@nobits + .align 2 + .type x, @object + .size x, 4 +x: + .zero 4 + .section .note.GNU-stack,"",@progbits diff --git a/ld/testsuite/ld-m68k/tls-gd-1.d2 b/ld/testsuite/ld-m68k/tls-gd-1.d2 new file mode 100644 index 0000000..b6167e3 --- /dev/null +++ b/ld/testsuite/ld-m68k/tls-gd-1.d2 @@ -0,0 +1,5 @@ +.* U x +.* +.* +.* +.* diff --git a/ld/testsuite/ld-m68k/tls-gd-1.d3 b/ld/testsuite/ld-m68k/tls-gd-1.d3 new file mode 100644 index 0000000..4b835d3 --- /dev/null +++ b/ld/testsuite/ld-m68k/tls-gd-1.d3 @@ -0,0 +1,13 @@ + +Dynamic section at offset .* contains .*: + * Tag * Type * Name/Value + 0x00000001 \(NEEDED\) * Shared library: \[tmpdir/tls-def-1.so\] + 0x00000004 \(HASH\) .* + 0x00000005 \(STRTAB\) .* + 0x00000006 \(SYMTAB\) .* + 0x0000000a \(STRSZ\) .* + 0x0000000b \(SYMENT\) .* + 0x00000007 \(RELA\) .* + 0x00000008 \(RELASZ\) .* + 0x00000009 \(RELAENT\) .* + 0x00000000 \(NULL\) .* diff --git a/ld/testsuite/ld-m68k/tls-main-1.d b/ld/testsuite/ld-m68k/tls-main-1.d new file mode 100644 index 0000000..7da24ab --- /dev/null +++ b/ld/testsuite/ld-m68k/tls-main-1.d @@ -0,0 +1,15 @@ + +Dynamic section at offset .* contains .*: + * Tag * Type * Name/Value + 0x00000001 \(NEEDED\) * Shared library: \[tmpdir/tls-gd-1.so\] + 0x00000001 \(NEEDED\) * Shared library: \[tls-def-1.so\] + 0x00000004 \(HASH\) .* + 0x00000005 \(STRTAB\) .* + 0x00000006 \(SYMTAB\) .* + 0x0000000a \(STRSZ\) .* + 0x0000000b \(SYMENT\) .* + 0x00000015 \(DEBUG\) .* + 0x00000007 \(RELA\) .* + 0x00000008 \(RELASZ\) .* + 0x00000009 \(RELAENT\) .* + 0x00000000 \(NULL\) .* diff --git a/ld/testsuite/ld-m68k/tls-main-1.s b/ld/testsuite/ld-m68k/tls-main-1.s new file mode 100644 index 0000000..75fb6d6 --- /dev/null +++ b/ld/testsuite/ld-m68k/tls-main-1.s @@ -0,0 +1,19 @@ +#NO_APP + .text + .align 2 + .globl main + .type main, @function + .globl _start + .type _start, @function +main: +_start: + link.w %fp,#0 + move.l %a5,-(%sp) + move.l #_GLOBAL_OFFSET_TABLE_@GOTPC, %a5 + lea (-6, %pc, %a5), %a5 + move.l x@TLSIE(%a5),%a0 + move.l -4(%fp),%a5 + unlk %fp + rts + .size main, .-main + .section .note.GNU-stack,"",@progbits |