diff options
author | Nick Clifton <nickc@redhat.com> | 2009-08-26 13:35:37 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2009-08-26 13:35:37 +0000 |
commit | e5f2b1de7c60e55d86dab61eaa3750eca33ef367 (patch) | |
tree | 4bc2c1e39f020277f9bdd4e5dad6a0580e54ed53 /ld | |
parent | f7922329bf858a53e75d0affc239ce08bea43fb8 (diff) | |
download | gdb-e5f2b1de7c60e55d86dab61eaa3750eca33ef367.zip gdb-e5f2b1de7c60e55d86dab61eaa3750eca33ef367.tar.gz gdb-e5f2b1de7c60e55d86dab61eaa3750eca33ef367.tar.bz2 |
* elf32-m68k.c (elf_m68k_copy_indirect_symbol): Propagate non_got_ref
value.
(elf_m68k_check_relocs): Handle dynamic TLS relocations.
Handle non_got_ref field.
(elf_m68k_adjust_dynamic_symbol): Handle non_got_ref field.
* tls-def-1.s, tls-def-1.d, tls-gd-1.d2, tls-gd-1.d3, tls-main-1.s,
* tls-main-1.d: New files.
* m68k.exp: Run new TLS tests.
Diffstat (limited to 'ld')
-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 |