diff options
author | Alan Modra <amodra@gmail.com> | 2011-03-23 15:25:06 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2011-03-23 15:25:06 +0000 |
commit | 663a1470e1a7af58a3d0691f480bc5621bd0c54f (patch) | |
tree | eb7a84aef9f6d307fdb4f8472b0e1759b04f6625 /ld | |
parent | 6f8a4444ff2b2239ccc23fb175f89d8c5fc4435f (diff) | |
download | gdb-663a1470e1a7af58a3d0691f480bc5621bd0c54f.zip gdb-663a1470e1a7af58a3d0691f480bc5621bd0c54f.tar.gz gdb-663a1470e1a7af58a3d0691f480bc5621bd0c54f.tar.bz2 |
bfd/
* elf32-ppc.c (ppc_elf_tls_optimize): Catch more cases where
old-style __tls_get_addr calls without marker relocs don't match
their arg setup insn one for one. If such mismatches are found
report the reloc and don't do any tls optimization.
* elf64-ppc.c (ppc64_elf_tls_optimize): Likewise.
ld/testsuite/
* ld-powerpc/tlsmark.s: Delete non-optimizable section.
* ld-powerpc/tlsmark32.s: Likewise.
* ld-powerpc/tlsmark.d: Adjust to suit.
* ld-powerpc/tlsmark32.d: Likewise.
* ld-powerpc/tlsopt1.d, * ld-powerpc/tlsopt1.s: New.
* ld-powerpc/tlsopt2.d, * ld-powerpc/tlsopt2.s: New.
* ld-powerpc/tlsopt3.d, * ld-powerpc/tlsopt3.s: New.
* ld-powerpc/tlsopt4.d, * ld-powerpc/tlsopt4.s: New.
* ld-powerpc/tlsopt1_32.d, * ld-powerpc/tlsopt1_32.s: New.
* ld-powerpc/tlsopt2_32.d, * ld-powerpc/tlsopt2_32.s: New.
* ld-powerpc/tlsopt3_32.d, * ld-powerpc/tlsopt3_32.s: New.
* ld-powerpc/tlsopt4_32.d, * ld-powerpc/tlsopt4_32.s: New.
* ld-powerpc/powerpc.exp: Run new tests.
Diffstat (limited to 'ld')
22 files changed, 440 insertions, 31 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index dafac0a..6a824e3 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,19 @@ +2011-03-24 Alan Modra <amodra@gmail.com> + + * ld-powerpc/tlsmark.s: Delete non-optimizable section. + * ld-powerpc/tlsmark32.s: Likewise. + * ld-powerpc/tlsmark.d: Adjust to suit. + * ld-powerpc/tlsmark32.d: Likewise. + * ld-powerpc/tlsopt1.d, * ld-powerpc/tlsopt1.s: New. + * ld-powerpc/tlsopt2.d, * ld-powerpc/tlsopt2.s: New. + * ld-powerpc/tlsopt3.d, * ld-powerpc/tlsopt3.s: New. + * ld-powerpc/tlsopt4.d, * ld-powerpc/tlsopt4.s: New. + * ld-powerpc/tlsopt1_32.d, * ld-powerpc/tlsopt1_32.s: New. + * ld-powerpc/tlsopt2_32.d, * ld-powerpc/tlsopt2_32.s: New. + * ld-powerpc/tlsopt3_32.d, * ld-powerpc/tlsopt3_32.s: New. + * ld-powerpc/tlsopt4_32.d, * ld-powerpc/tlsopt4_32.s: New. + * ld-powerpc/powerpc.exp: Run new tests. + 2011-03-15 Mike Frysinger <vapier@gentoo.org> * ld-elfvers/vers.exp (vers19): Add -Wl,-rpath-link,. to linker flags. diff --git a/ld/testsuite/ld-powerpc/powerpc.exp b/ld/testsuite/ld-powerpc/powerpc.exp index 6cb797e..ef0a6e1 100644 --- a/ld/testsuite/ld-powerpc/powerpc.exp +++ b/ld/testsuite/ld-powerpc/powerpc.exp @@ -1,5 +1,6 @@ # Expect script for ld-powerpc tests -# Copyright 2002, 2003, 2005, 2006, 2007, 2008, 2009 Free Software Foundation +# Copyright 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 +# Free Software Foundation # # This file is part of the GNU Binutils. # @@ -123,6 +124,18 @@ set ppcelftests { {"TLS32 markers" "-melf32ppc" "-a32" {tlsmark32.s tlslib32.s} {{objdump -dr tlsmark32.d}} "tlsmark32"} + {"TLS32 opt 1" "-melf32ppc" "-a32" {tlsopt1_32.s tlslib32.s} + {{objdump -dr tlsopt1_32.d}} + "tlsopt1_32"} + {"TLS32 opt 2" "-melf32ppc" "-a32" {tlsopt2_32.s tlslib32.s} + {{objdump -dr tlsopt2_32.d}} + "tlsopt2_32"} + {"TLS32 opt 3" "-melf32ppc" "-a32" {tlsopt3_32.s tlslib32.s} + {{objdump -dr tlsopt3_32.d}} + "tlsopt3_32"} + {"TLS32 opt 4" "-melf32ppc" "-a32" {tlsopt4_32.s tlslib32.s} + {{objdump -dr tlsopt4_32.d}} + "tlsopt4_32"} {"Shared library with global symbol" "-shared -melf32ppc" "-a32" {sdalib.s} {} "sdalib.so"} {"Dynamic application with SDA" "-melf32ppc tmpdir/sdalib.so" "-a32" {sdadyn.s} @@ -176,6 +189,18 @@ set ppc64elftests { {"TLS markers" "-melf64ppc" "-a64" {tlsmark.s tlslib.s} {{objdump -dr tlsmark.d}} "tlsmark"} + {"TLS opt 1" "-melf64ppc" "-a64" {tlsopt1.s tlslib.s} + {{objdump -dr tlsopt1.d}} + "tlsopt1"} + {"TLS opt 2" "-melf64ppc" "-a64" {tlsopt2.s tlslib.s} + {{objdump -dr tlsopt2.d}} + "tlsopt2"} + {"TLS opt 3" "-melf64ppc" "-a64" {tlsopt3.s tlslib.s} + {{objdump -dr tlsopt3.d}} + "tlsopt3"} + {"TLS opt 4" "-melf64ppc" "-a64" {tlsopt4.s tlslib.s} + {{objdump -dr tlsopt4.d}} + "tlsopt4"} {"sym@tocbase" "-shared -melf64ppc" "-a64" {symtocbase-1.s symtocbase-2.s} {{objdump -dj.data symtocbase.d}} "symtocbase.so"} {"TOC opt" "-melf64ppc" "-a64" {tocopt.s} diff --git a/ld/testsuite/ld-powerpc/tlsmark.d b/ld/testsuite/ld-powerpc/tlsmark.d index 8ba350e..d892f34 100644 --- a/ld/testsuite/ld-powerpc/tlsmark.d +++ b/ld/testsuite/ld-powerpc/tlsmark.d @@ -32,11 +32,6 @@ Disassembly of section \.text: 10000134: 60 00 00 00 nop 10000138: 38 63 10 00 addi r3,r3,4096 1000013c: e8 a3 80 04 ld r5,-32764\(r3\) - 10000140: 38 62 80 28 addi r3,r2,-32728 - 10000144: 3f a0 10 01 lis r29,4097 - 10000148: 3b bd 01 68 addi r29,r29,360 - 1000014c: 48 00 00 09 bl 10000154 <\.__tls_get_addr> - 10000150: 60 00 00 00 nop -0+10000154 <\.__tls_get_addr>: - 10000154: 4e 80 00 20 blr +0+10000140 <\.__tls_get_addr>: + 10000140: 4e 80 00 20 blr diff --git a/ld/testsuite/ld-powerpc/tlsmark.s b/ld/testsuite/ld-powerpc/tlsmark.s index dc42327..1bda55c 100644 --- a/ld/testsuite/ld-powerpc/tlsmark.s +++ b/ld/testsuite/ld-powerpc/tlsmark.s @@ -44,12 +44,3 @@ _start: bl .__tls_get_addr(.LC1@tlsld) nop ld 5,y@dtprel(3) - - - .section ".text.no","ax",@progbits - .p2align 2 - addi 3,2,gd@got@tlsgd - lis 29,__tls_get_addr@ha - addi 29,29,__tls_get_addr@l - bl __tls_get_addr - nop diff --git a/ld/testsuite/ld-powerpc/tlsmark32.d b/ld/testsuite/ld-powerpc/tlsmark32.d index 74b74e3..548c1d5 100644 --- a/ld/testsuite/ld-powerpc/tlsmark32.d +++ b/ld/testsuite/ld-powerpc/tlsmark32.d @@ -19,11 +19,7 @@ Disassembly of section \.text: 18000ac: 4b ff ff ec b 1800098 <_start\+0x4> 18000b0: 38 63 10 00 addi r3,r3,4096 18000b4: 80 83 80 00 lwz r4,-32768\(r3\) - 18000b8: 38 7f ff f4 addi r3,r31,-12 - 18000bc: 3f a0 01 80 lis r29,384 - 18000c0: 3b bd 00 c8 addi r29,r29,200 - 18000c4: 48 00 00 05 bl 18000c8 <__tls_get_addr> -0+18000c8 <__tls_get_addr>: - 18000c8: 4e 80 00 20 blr +0+18000b8 <__tls_get_addr>: + 18000b8: 4e 80 00 20 blr #pass
\ No newline at end of file diff --git a/ld/testsuite/ld-powerpc/tlsmark32.s b/ld/testsuite/ld-powerpc/tlsmark32.s index 2fa48ae..966d1b3 100644 --- a/ld/testsuite/ld-powerpc/tlsmark32.s +++ b/ld/testsuite/ld-powerpc/tlsmark32.s @@ -17,11 +17,3 @@ _start: .L3: bl __tls_get_addr(x@tlsld) lwz 4,x@dtprel(3) - - - .section ".text.no","ax",@progbits - .p2align 2 - addi 3,31,gd@got@tlsgd - lis 29,__tls_get_addr@ha - addi 29,29,__tls_get_addr@l - bl __tls_get_addr diff --git a/ld/testsuite/ld-powerpc/tlsopt1.d b/ld/testsuite/ld-powerpc/tlsopt1.d new file mode 100644 index 0000000..ab1e1f7 --- /dev/null +++ b/ld/testsuite/ld-powerpc/tlsopt1.d @@ -0,0 +1,25 @@ +#source: tlsopt1.s +#source: tlslib.s +#as: -a64 +#ld: -melf64ppc +#objdump: -dr +#target: powerpc64*-*-* + +.*: +file format elf64-powerpc + +Disassembly of section \.text: + +0+100000e8 <\.__tls_get_addr>: + 100000e8: 4e 80 00 20 blr + +Disassembly of section \.no_opt1: + +0+100000ec <\.no_opt1>: + 100000ec: 38 62 80 08 addi r3,r2,-32760 + 100000f0: 2c 24 00 00 cmpdi r4,0 + 100000f4: 41 82 00 10 beq- .* + 100000f8: 4b ff ff f1 bl 100000e8 <\.__tls_get_addr> + 100000fc: 60 00 00 00 nop + 10000100: 48 00 00 0c b .* + 10000104: 4b ff ff e5 bl 100000e8 <\.__tls_get_addr> + 10000108: 60 00 00 00 nop diff --git a/ld/testsuite/ld-powerpc/tlsopt1.s b/ld/testsuite/ld-powerpc/tlsopt1.s new file mode 100644 index 0000000..e66e315 --- /dev/null +++ b/ld/testsuite/ld-powerpc/tlsopt1.s @@ -0,0 +1,14 @@ + .section ".no_opt1", "ax", %progbits +# this section should not be optimised since we have old-style +# __tls_get_addr without marker relocs, and the arg setup insn +# is shared with two __tls_get_addr calls. + addi 3,2,gd@got@tlsgd + cmpdi 4,0 + beq 0f + bl __tls_get_addr + nop + b 1f +0: + bl __tls_get_addr + nop +1: diff --git a/ld/testsuite/ld-powerpc/tlsopt1_32.d b/ld/testsuite/ld-powerpc/tlsopt1_32.d new file mode 100644 index 0000000..ae77639 --- /dev/null +++ b/ld/testsuite/ld-powerpc/tlsopt1_32.d @@ -0,0 +1,24 @@ +#source: tlsopt1_32.s +#source: tlslib32.s +#as: -a32 +#ld: -melf32ppc +#objdump: -dr +#target: powerpc*-*-* + +.*: +file format elf32-powerpc + +Disassembly of section \.text: + +0+1800094 <__tls_get_addr>: + 1800094: 4e 80 00 20 blr + +Disassembly of section \.no_opt1: + +0+1800098 <\.no_opt1>: + 1800098: 38 6d ff f4 addi r3,r13,-12 + 180009c: 2c 04 00 00 cmpwi r4,0 + 18000a0: 41 82 00 0c beq- .* + 18000a4: 4b ff ff f1 bl 1800094 <__tls_get_addr> + 18000a8: 48 00 00 08 b .* + 18000ac: 4b ff ff e9 bl 1800094 <__tls_get_addr> +#pass diff --git a/ld/testsuite/ld-powerpc/tlsopt1_32.s b/ld/testsuite/ld-powerpc/tlsopt1_32.s new file mode 100644 index 0000000..aba2bbc --- /dev/null +++ b/ld/testsuite/ld-powerpc/tlsopt1_32.s @@ -0,0 +1,12 @@ + .section ".no_opt1", "ax", %progbits +# this section should not be optimised since we have old-style +# __tls_get_addr without marker relocs, and the arg setup insn +# is shared with two __tls_get_addr calls. + addi 3,13,gd@got@tlsgd + cmpwi 4,0 + beq 0f + bl __tls_get_addr + b 1f +0: + bl __tls_get_addr +1: diff --git a/ld/testsuite/ld-powerpc/tlsopt2.d b/ld/testsuite/ld-powerpc/tlsopt2.d new file mode 100644 index 0000000..097e8a4 --- /dev/null +++ b/ld/testsuite/ld-powerpc/tlsopt2.d @@ -0,0 +1,23 @@ +#source: tlsopt2.s +#source: tlslib.s +#as: -a64 +#ld: -melf64ppc +#objdump: -dr +#target: powerpc64*-*-* + +.*: +file format elf64-powerpc + +Disassembly of section \.text: + +0+100000e8 <\.__tls_get_addr>: + 100000e8: 4e 80 00 20 blr + +Disassembly of section \.no_opt2: + +0+100000ec <\.no_opt2>: + 100000ec: 38 62 80 08 addi r3,r2,-32760 + 100000f0: 2c 24 00 00 cmpdi r4,0 + 100000f4: 41 82 00 08 beq- .* + 100000f8: 38 62 80 08 addi r3,r2,-32760 + 100000fc: 4b ff ff ed bl 100000e8 <\.__tls_get_addr> + 10000100: 60 00 00 00 nop diff --git a/ld/testsuite/ld-powerpc/tlsopt2.s b/ld/testsuite/ld-powerpc/tlsopt2.s new file mode 100644 index 0000000..adfbfa8 --- /dev/null +++ b/ld/testsuite/ld-powerpc/tlsopt2.s @@ -0,0 +1,11 @@ + .section ".no_opt2", "ax", %progbits +# this section should not be optimised since we have old-style +# __tls_get_addr without marker relocs, and two arg setup insns +# feed into one __tls_get_addr call. + addi 3,2,gd@got@tlsgd + cmpdi 4,0 + beq 0f + addi 3,2,gd@got@tlsgd +0: + bl __tls_get_addr + nop diff --git a/ld/testsuite/ld-powerpc/tlsopt2_32.d b/ld/testsuite/ld-powerpc/tlsopt2_32.d new file mode 100644 index 0000000..5121f74 --- /dev/null +++ b/ld/testsuite/ld-powerpc/tlsopt2_32.d @@ -0,0 +1,23 @@ +#source: tlsopt2_32.s +#source: tlslib32.s +#as: -a32 +#ld: -melf32ppc +#objdump: -dr +#target: powerpc*-*-* + +.*: +file format elf32-powerpc + +Disassembly of section \.text: + +0+1800094 <__tls_get_addr>: + 1800094: 4e 80 00 20 blr + +Disassembly of section \.no_opt2: + +0+1800098 <\.no_opt2>: + 1800098: 38 6d ff f4 addi r3,r13,-12 + 180009c: 2c 04 00 00 cmpwi r4,0 + 18000a0: 41 82 00 08 beq- .* + 18000a4: 38 6d ff f4 addi r3,r13,-12 + 18000a8: 4b ff ff ed bl 1800094 <__tls_get_addr> +#pass diff --git a/ld/testsuite/ld-powerpc/tlsopt2_32.s b/ld/testsuite/ld-powerpc/tlsopt2_32.s new file mode 100644 index 0000000..bca1247 --- /dev/null +++ b/ld/testsuite/ld-powerpc/tlsopt2_32.s @@ -0,0 +1,10 @@ + .section ".no_opt2", "ax", %progbits +# this section should not be optimised since we have old-style +# __tls_get_addr without marker relocs, and two arg setup insns +# feed into one __tls_get_addr call. + addi 3,13,gd@got@tlsgd + cmpwi 4,0 + beq 0f + addi 3,13,gd@got@tlsgd +0: + bl __tls_get_addr diff --git a/ld/testsuite/ld-powerpc/tlsopt3.d b/ld/testsuite/ld-powerpc/tlsopt3.d new file mode 100644 index 0000000..dee9b66 --- /dev/null +++ b/ld/testsuite/ld-powerpc/tlsopt3.d @@ -0,0 +1,26 @@ +#source: tlsopt3.s +#source: tlslib.s +#as: -a64 +#ld: -melf64ppc +#objdump: -dr +#target: powerpc64*-*-* + +.*: +file format elf64-powerpc + +Disassembly of section \.text: + +00000000100000e8 <\.__tls_get_addr>: + 100000e8: 4e 80 00 20 blr + +Disassembly of section \.no_opt3: + +00000000100000ec <\.no_opt3>: + 100000ec: 38 62 80 08 addi r3,r2,-32760 + 100000f0: 48 00 00 0c b .* + 100000f4: 38 62 80 18 addi r3,r2,-32744 + 100000f8: 48 00 00 10 b .* + 100000fc: 4b ff ff ed bl 100000e8 <\.__tls_get_addr> + 10000100: 60 00 00 00 nop + 10000104: 48 00 00 0c b .* + 10000108: 4b ff ff e1 bl 100000e8 <\.__tls_get_addr> + 1000010c: 60 00 00 00 nop diff --git a/ld/testsuite/ld-powerpc/tlsopt3.s b/ld/testsuite/ld-powerpc/tlsopt3.s new file mode 100644 index 0000000..9730ceb --- /dev/null +++ b/ld/testsuite/ld-powerpc/tlsopt3.s @@ -0,0 +1,19 @@ + .section ".tbss","awT",@nobits + .global gd0 + .align 3 +gd0: .space 8 + + .section ".no_opt3", "ax", %progbits +# this section should also not be optimised + addi 3,2,gd@got@tlsgd + b 0f + addi 3,2,gd0@got@tlsgd + b 1f +0: + bl __tls_get_addr + nop + b 2f +1: + bl __tls_get_addr + nop +2: diff --git a/ld/testsuite/ld-powerpc/tlsopt3_32.d b/ld/testsuite/ld-powerpc/tlsopt3_32.d new file mode 100644 index 0000000..eba96d9 --- /dev/null +++ b/ld/testsuite/ld-powerpc/tlsopt3_32.d @@ -0,0 +1,25 @@ +#source: tlsopt3_32.s +#source: tlslib32.s +#as: -a32 +#ld: -melf32ppc +#objdump: -dr +#target: powerpc*-*-* + +.*: +file format elf32-powerpc + +Disassembly of section \.text: + +0+1800094 <__tls_get_addr>: + 1800094: 4e 80 00 20 blr + +Disassembly of section \.no_opt3: + +0+1800098 <\.no_opt3>: + 1800098: 38 6d ff ec addi r3,r13,-20 + 180009c: 48 00 00 0c b .* + 18000a0: 38 6d ff f4 addi r3,r13,-12 + 18000a4: 48 00 00 0c b .* + 18000a8: 4b ff ff ed bl 1800094 <__tls_get_addr> + 18000ac: 48 00 00 08 b .* + 18000b0: 4b ff ff e5 bl 1800094 <__tls_get_addr> +#pass diff --git a/ld/testsuite/ld-powerpc/tlsopt3_32.s b/ld/testsuite/ld-powerpc/tlsopt3_32.s new file mode 100644 index 0000000..6432c24 --- /dev/null +++ b/ld/testsuite/ld-powerpc/tlsopt3_32.s @@ -0,0 +1,17 @@ + .section ".tbss","awT",@nobits + .global gd0 + .align 3 +gd0: .space 8 + + .section ".no_opt3", "ax", %progbits +# this section should also not be optimised + addi 3,13,gd@got@tlsgd + b 0f + addi 3,13,gd0@got@tlsgd + b 1f +0: + bl __tls_get_addr + b 2f +1: + bl __tls_get_addr +2: diff --git a/ld/testsuite/ld-powerpc/tlsopt4.d b/ld/testsuite/ld-powerpc/tlsopt4.d new file mode 100644 index 0000000..cb81abe --- /dev/null +++ b/ld/testsuite/ld-powerpc/tlsopt4.d @@ -0,0 +1,48 @@ +#source: tlsopt4.s +#source: tlslib.s +#as: -a64 +#ld: -melf64ppc +#objdump: -dr +#target: powerpc64*-*-* + +.*: +file format elf64-powerpc + +Disassembly of section \.text: + +0+100000e8 <\.__tls_get_addr>: + 100000e8: 4e 80 00 20 blr + +Disassembly of section \.opt1: + +0+100000ec <\.opt1>: + 100000ec: 3c 6d 00 00 addis r3,r13,0 + 100000f0: 2c 24 00 00 cmpdi r4,0 + 100000f4: 41 82 00 10 beq- .* + 100000f8: 60 00 00 00 nop + 100000fc: 38 63 90 10 addi r3,r3,-28656 + 10000100: 48 00 00 0c b .* + 10000104: 60 00 00 00 nop + 10000108: 38 63 90 10 addi r3,r3,-28656 + +Disassembly of section \.opt2: + +0+1000010c <\.opt2>: + 1000010c: 3c 6d 00 00 addis r3,r13,0 + 10000110: 2c 24 00 00 cmpdi r4,0 + 10000114: 41 82 00 08 beq- .* + 10000118: 3c 6d 00 00 addis r3,r13,0 + 1000011c: 60 00 00 00 nop + 10000120: 38 63 90 10 addi r3,r3,-28656 + +Disassembly of section \.opt3: + +0+10000124 <\.opt3>: + 10000124: 3c 6d 00 00 addis r3,r13,0 + 10000128: 48 00 00 0c b .* + 1000012c: 3c 6d 00 00 addis r3,r13,0 + 10000130: 48 00 00 10 b .* + 10000134: 60 00 00 00 nop + 10000138: 38 63 90 10 addi r3,r3,-28656 + 1000013c: 48 00 00 0c b .* + 10000140: 60 00 00 00 nop + 10000144: 38 63 90 08 addi r3,r3,-28664 diff --git a/ld/testsuite/ld-powerpc/tlsopt4.s b/ld/testsuite/ld-powerpc/tlsopt4.s new file mode 100644 index 0000000..f84dee5 --- /dev/null +++ b/ld/testsuite/ld-powerpc/tlsopt4.s @@ -0,0 +1,39 @@ + .section ".tbss","awT",@nobits + .global gd0 + .align 3 +gd0: .space 8 + + .section ".opt1", "ax", %progbits + addi 3,2,gd@got@tlsgd + cmpdi 4,0 + beq 0f + bl __tls_get_addr(gd@tlsgd) + nop + b 1f +0: + bl __tls_get_addr(gd@tlsgd) + nop +1: + + .section ".opt2", "ax", %progbits + addi 3,2,gd@got@tlsgd + cmpdi 4,0 + beq 0f + addi 3,2,gd@got@tlsgd +0: + bl __tls_get_addr(gd@tlsgd) + nop + + .section ".opt3", "ax", %progbits + addi 3,2,gd@got@tlsgd + b 0f + addi 3,2,gd0@got@tlsgd + b 1f +0: + bl __tls_get_addr(gd@tlsgd) + nop + b 2f +1: + bl __tls_get_addr(gd0@tlsgd) + nop +2: diff --git a/ld/testsuite/ld-powerpc/tlsopt4_32.d b/ld/testsuite/ld-powerpc/tlsopt4_32.d new file mode 100644 index 0000000..4b667f6 --- /dev/null +++ b/ld/testsuite/ld-powerpc/tlsopt4_32.d @@ -0,0 +1,44 @@ +#source: tlsopt4_32.s +#source: tlslib32.s +#as: -a32 +#ld: -melf32ppc +#objdump: -dr +#target: powerpc*-*-* + +.*: +file format elf32-powerpc + +Disassembly of section \.text: + +0+1800094 <__tls_get_addr>: + 1800094: 4e 80 00 20 blr + +Disassembly of section \.opt1: + +0+1800098 <\.opt1>: + 1800098: 3c 62 00 00 addis r3,r2,0 + 180009c: 2c 04 00 00 cmpwi r4,0 + 18000a0: 41 82 00 0c beq- .* + 18000a4: 38 63 90 10 addi r3,r3,-28656 + 18000a8: 48 00 00 08 b .* + 18000ac: 38 63 90 10 addi r3,r3,-28656 + +Disassembly of section \.opt2: + +0+18000b0 <\.opt2>: + 18000b0: 3c 62 00 00 addis r3,r2,0 + 18000b4: 2c 04 00 00 cmpwi r4,0 + 18000b8: 41 82 00 08 beq- .* + 18000bc: 3c 62 00 00 addis r3,r2,0 + 18000c0: 38 63 90 10 addi r3,r3,-28656 + +Disassembly of section \.opt3: + +0+18000c4 <\.opt3>: + 18000c4: 3c 62 00 00 addis r3,r2,0 + 18000c8: 48 00 00 0c b .* + 18000cc: 3c 62 00 00 addis r3,r2,0 + 18000d0: 48 00 00 0c b .* + 18000d4: 38 63 90 10 addi r3,r3,-28656 + 18000d8: 48 00 00 08 b .* + 18000dc: 38 63 90 08 addi r3,r3,-28664 +#pass diff --git a/ld/testsuite/ld-powerpc/tlsopt4_32.s b/ld/testsuite/ld-powerpc/tlsopt4_32.s new file mode 100644 index 0000000..9643fcb --- /dev/null +++ b/ld/testsuite/ld-powerpc/tlsopt4_32.s @@ -0,0 +1,34 @@ + .section ".tbss","awT",@nobits + .global gd0 + .align 3 +gd0: .space 8 + + .section ".opt1", "ax", %progbits + addi 3,13,gd@got@tlsgd + cmpwi 4,0 + beq 0f + bl __tls_get_addr(gd@tlsgd) + b 1f +0: + bl __tls_get_addr(gd@tlsgd) +1: + + .section ".opt2", "ax", %progbits + addi 3,13,gd@got@tlsgd + cmpwi 4,0 + beq 0f + addi 3,13,gd@got@tlsgd +0: + bl __tls_get_addr(gd@tlsgd) + + .section ".opt3", "ax", %progbits + addi 3,13,gd@got@tlsgd + b 0f + addi 3,13,gd0@got@tlsgd + b 1f +0: + bl __tls_get_addr(gd@tlsgd) + b 2f +1: + bl __tls_get_addr(gd0@tlsgd) +2: |