From: nobody <> Date: Wed, 23 Mar 2011 15:25:07 +0000 (+0000) Subject: This commit was manufactured by cvs2svn to create branch 'binutils- X-Git-Tag: binutils-2_21_1~136 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2d3a87e3d3295279f82e55cf4efc07313dd3875c;p=thirdparty%2Fbinutils-gdb.git This commit was manufactured by cvs2svn to create branch 'binutils- 2_21-branch'. Cherrypick from master 2011-03-23 15:25:06 UTC Alan Modra 'bfd/': ld/testsuite/ld-powerpc/tlsopt1.d ld/testsuite/ld-powerpc/tlsopt1.s ld/testsuite/ld-powerpc/tlsopt1_32.d ld/testsuite/ld-powerpc/tlsopt1_32.s ld/testsuite/ld-powerpc/tlsopt2.d ld/testsuite/ld-powerpc/tlsopt2.s ld/testsuite/ld-powerpc/tlsopt2_32.d ld/testsuite/ld-powerpc/tlsopt2_32.s ld/testsuite/ld-powerpc/tlsopt3.d ld/testsuite/ld-powerpc/tlsopt3.s ld/testsuite/ld-powerpc/tlsopt3_32.d ld/testsuite/ld-powerpc/tlsopt3_32.s ld/testsuite/ld-powerpc/tlsopt4.d ld/testsuite/ld-powerpc/tlsopt4.s ld/testsuite/ld-powerpc/tlsopt4_32.d ld/testsuite/ld-powerpc/tlsopt4_32.s --- diff --git a/ld/testsuite/ld-powerpc/tlsopt1.d b/ld/testsuite/ld-powerpc/tlsopt1.d new file mode 100644 index 00000000000..ab1e1f778c0 --- /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 00000000000..e66e315c2fc --- /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 00000000000..ae77639cb8c --- /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 00000000000..aba2bbcaaae --- /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 00000000000..097e8a43217 --- /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 00000000000..adfbfa87c64 --- /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 00000000000..5121f748772 --- /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 00000000000..bca12476d30 --- /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 00000000000..dee9b662a3d --- /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 00000000000..9730ceb68f0 --- /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 00000000000..eba96d97249 --- /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 00000000000..6432c241561 --- /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 00000000000..cb81abeb755 --- /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 00000000000..f84dee5ac77 --- /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 00000000000..4b667f6d208 --- /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 00000000000..9643fcb202c --- /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: