From b835768ec27c24254456120e69631f236fac1423 Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Mon, 23 Sep 2002 22:13:40 +0000 Subject: [PATCH] 2002-09-23 Daniel Jacobowitz Merge from mainline: 2002-09-19 Jakub Jelinek * gas/i386/tlspic.s: Add tests. * gas/i386/tlspic.d: Regenerated. * gas/i386/tlsnopic.s: Add tests. * gas/i386/tlsnopic.d: Regenerated. 2002-09-16 Chris Demetriou * gas/mips/mips-abi32-pic2.s: New file. * gas/mips/mips-abi32-pic2.d: New file. * gas/mips/mips.exp: Run new test. 2002-08-20 Richard Sandiford * gas/mips/rol.s: Add rotate by zero tests. * gas/mips/rol.d: Update accordingly. * gas/mips/rol64.d: Expect rotates by zero to use dsrl. 2002-08-13 Stephen Clarke * gas/sh/sh64/datal32-3.d: Formatting change to match the current output of objdump. 2002-08-12 Richard Sandiford * gas/mips/elf-consthilo.[sd]: New test. * gas/mips/mips.exp: Run it. 2002-08-06 Alan Modra * gas/ppc/altivec_xcoff64.d: Adjust for aix5 target. * gas/ppc/booke_xcoff64.d: Likewise. Also fix relocs. 2002-08-03 Jakub Jelinek * testsuite/gas/i386/gotpc.s: New. * testsuite/gas/i386/gotpc.d: New. * testsuite/gas/i386/i386.exp: Add gotpc test. --- gas/testsuite/ChangeLog | 36 ++++++++++++ gas/testsuite/gas/i386/i386.exp | 1 + gas/testsuite/gas/i386/tlsnopic.d | 8 ++- gas/testsuite/gas/i386/tlsnopic.s | 31 ++++++---- gas/testsuite/gas/i386/tlspic.d | 13 ++++- gas/testsuite/gas/i386/tlspic.s | 14 ++++- gas/testsuite/gas/mips/mips.exp | 2 + gas/testsuite/gas/mips/rol.d | 31 +++++----- gas/testsuite/gas/mips/rol.s | 3 + gas/testsuite/gas/mips/rol64.d | 78 +++++++++++++------------ gas/testsuite/gas/ppc/altivec_xcoff64.d | 2 +- gas/testsuite/gas/ppc/booke_xcoff64.d | 10 ++-- gas/testsuite/gas/sh/sh64/datal32-3.d | 2 +- 13 files changed, 157 insertions(+), 74 deletions(-) diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 1389184d5b2..a510cfe968f 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,39 @@ +2002-09-23 Daniel Jacobowitz + + Merge from mainline: + 2002-09-19 Jakub Jelinek + * gas/i386/tlspic.s: Add tests. + * gas/i386/tlspic.d: Regenerated. + * gas/i386/tlsnopic.s: Add tests. + * gas/i386/tlsnopic.d: Regenerated. + + 2002-09-16 Chris Demetriou + * gas/mips/mips-abi32-pic2.s: New file. + * gas/mips/mips-abi32-pic2.d: New file. + * gas/mips/mips.exp: Run new test. + + 2002-08-20 Richard Sandiford + * gas/mips/rol.s: Add rotate by zero tests. + * gas/mips/rol.d: Update accordingly. + * gas/mips/rol64.d: Expect rotates by zero to use dsrl. + + 2002-08-13 Stephen Clarke + * gas/sh/sh64/datal32-3.d: Formatting change to match the current + output of objdump. + + 2002-08-12 Richard Sandiford + * gas/mips/elf-consthilo.[sd]: New test. + * gas/mips/mips.exp: Run it. + + 2002-08-06 Alan Modra + * gas/ppc/altivec_xcoff64.d: Adjust for aix5 target. + * gas/ppc/booke_xcoff64.d: Likewise. Also fix relocs. + + 2002-08-03 Jakub Jelinek + * testsuite/gas/i386/gotpc.s: New. + * testsuite/gas/i386/gotpc.d: New. + * testsuite/gas/i386/i386.exp: Add gotpc test. + 2002-08-26 Alan Modra * gas/m68k/all.exp: xfail non-ELF targets on pcrel test. diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp index e45056a4c08..da4454cb66f 100644 --- a/gas/testsuite/gas/i386/i386.exp +++ b/gas/testsuite/gas/i386/i386.exp @@ -76,6 +76,7 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_32_check]] && ![istarget *-*-linux*oldld*]) } then { run_dump_test "relax" + run_dump_test "gotpc" run_dump_test "tlsd" run_dump_test "tlspic" run_dump_test "tlsnopic" diff --git a/gas/testsuite/gas/i386/tlsnopic.d b/gas/testsuite/gas/i386/tlsnopic.d index 64ec6e60d2c..68a25838f6b 100644 --- a/gas/testsuite/gas/i386/tlsnopic.d +++ b/gas/testsuite/gas/i386/tlsnopic.d @@ -28,4 +28,10 @@ Disassembly of section .text: 40: 90 [ ]*nop 41: 8d 91 00 00 00 00 lea 0x0\(%ecx\),%edx [ ]+43: R_386_TLS_LE var2 - 47: c3 [ ]*ret[ ]* + 47: a1 00 00 00 00 [ ]*mov 0x0,%eax +[ ]+48: R_386_TLS_IE foo + 4c: 65 8b 00 [ ]*mov %gs:\(%eax\),%eax + 4f: 65 a1 00 00 00 00 [ ]*mov %gs:0x0,%eax + 55: 03 05 00 00 00 00 [ ]*add 0x0,%eax + 57: R_386_TLS_IE foo + 5b: c3 [ ]*ret[ ]* diff --git a/gas/testsuite/gas/i386/tlsnopic.s b/gas/testsuite/gas/i386/tlsnopic.s index 1b51b3663e8..3a8b794195d 100644 --- a/gas/testsuite/gas/i386/tlsnopic.s +++ b/gas/testsuite/gas/i386/tlsnopic.s @@ -11,35 +11,44 @@ var2: .long 33 .globl fn .type fn,@function fn: - /* Main binary, no PIC */ + /* Main binary, no PIC. */ 1: movl 1b, %edx addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx - /* foo can be anywhere in startup TLS */ + /* foo can be anywhere in startup TLS. */ movl %gs:0, %eax subl foo@GOTTPOFF(%edx), %eax - /* %eax now contains &foo */ + /* %eax now contains &foo. */ - /* bar only in the main program */ + /* bar only in the main program. */ movl %gs:0, %eax subl $bar@TPOFF, %eax - /* %eax now contains &bar */ + /* %eax now contains &bar. */ - /* baz only in the main program */ + /* baz only in the main program. */ movl %gs:0, %ecx - /* Arbitrary instructions in between */ + /* Arbitrary instructions in between. */ nop subl $baz@TPOFF, %ecx - /* %ecx now contains &baz */ + /* %ecx now contains &baz. */ - /* var and var2 only in the main program */ + /* var and var2 only in the main program. */ movl %gs:0, %ecx - /* Arbitrary instructions in between */ + /* Arbitrary instructions in between. */ nop nop leal var@NTPOFF(%ecx), %eax - /* Arbitrary instructions in between */ + /* Arbitrary instructions in between. */ nop leal var2@NTPOFF(%ecx), %edx + /* foo can be anywhere in startup TLS. */ + movl foo@INDNTPOFF, %eax + movl %gs:(%eax), %eax + /* %eax now contains foo. */ + + movl %gs:0, %eax + addl foo@INDNTPOFF, %eax + /* %eax now contains &foo. */ + ret diff --git a/gas/testsuite/gas/i386/tlspic.d b/gas/testsuite/gas/i386/tlspic.d index 2444113d7e6..fbe83a47c4a 100644 --- a/gas/testsuite/gas/i386/tlspic.d +++ b/gas/testsuite/gas/i386/tlspic.d @@ -18,6 +18,13 @@ Disassembly of section .text: 17: 8d 76 00 [ ]*lea 0x0\(%esi\),%esi 1a: 2b 83 00 00 00 00 [ ]*sub 0x0\(%ebx\),%eax [ ]+1c: R_386_TLS_IE_32 foo - 20: 8b 5d fc [ ]*mov 0xfffffffc\(%ebp\),%ebx - 23: c9 [ ]*leave[ ]* - 24: c3 [ ]*ret[ ]* + 20: 8b 83 00 00 00 00 [ ]*mov 0x0\(%ebx\),%eax +[ ]+22: R_386_TLS_GOTIE foo + 26: 8d 76 00 [ ]*lea 0x0\(%esi\),%esi + 29: 65 8b 00 [ ]*mov %gs:\(%eax\),%eax + 2c: 65 8b 0d 00 00 00 00 [ ]*mov %gs:0x0,%ecx + 33: 03 8b 00 00 00 00 [ ]*add 0x0\(%ebx\),%ecx +[ ]+35: R_386_TLS_GOTIE foo + 39: 8b 5d fc [ ]*mov 0xfffffffc\(%ebp\),%ebx + 3c: c9 [ ]*leave[ ]* + 3d: c3 [ ]*ret[ ]* diff --git a/gas/testsuite/gas/i386/tlspic.s b/gas/testsuite/gas/i386/tlspic.s index e445ab975f8..c9b97574ab5 100644 --- a/gas/testsuite/gas/i386/tlspic.s +++ b/gas/testsuite/gas/i386/tlspic.s @@ -16,12 +16,24 @@ fn: /* foo can be anywhere in the startup TLS */ movl %gs:0, %eax - /* Arbitrary instructions in between */ + /* Arbitrary instructions in between. */ leal 0(%esi, 1), %esi subl foo@GOTTPOFF(%ebx), %eax /* %eax now contains &foo */ + /* Now the GNU sequence. */ + movl foo@GOTNTPOFF(%ebx), %eax + + /* Arbitrary instructions in between. */ + leal 0(%esi, 1), %esi + + movl %gs:(%eax), %eax + /* %eax now contains foo */ + + movl %gs:0, %ecx + addl foo@GOTNTPOFF(%ebx), %ecx + movl -4(%ebp), %ebx leave ret diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp index a3b6911f34c..8e415ef6ed5 100644 --- a/gas/testsuite/gas/mips/mips.exp +++ b/gas/testsuite/gas/mips/mips.exp @@ -190,6 +190,7 @@ if { [istarget mips*-*-*] } then { run_dump_test "mips-abi32" run_dump_test "mips-abi32-pic" + run_dump_test "mips-abi32-pic2" run_dump_test "elf${el}-rel" if {[istarget mips64*-*-*] || [istarget mipsisa32*-*-*] @@ -215,5 +216,6 @@ if { [istarget mips*-*-*] } then { run_dump_test "${tmips}mips${el}16-e" run_dump_test "${tmips}mips${el}16-f" } + run_dump_test "elf-consthilo" } } diff --git a/gas/testsuite/gas/mips/rol.d b/gas/testsuite/gas/mips/rol.d index 78f39f12a19..2128dd57047 100644 --- a/gas/testsuite/gas/mips/rol.d +++ b/gas/testsuite/gas/mips/rol.d @@ -21,17 +21,20 @@ Disassembly of section .text: 0+002c <[^>]*> sll at,a1,0x1 0+0030 <[^>]*> srl a0,a1,0x1f 0+0034 <[^>]*> or a0,a0,at -0+0038 <[^>]*> negu at,a1 -0+003c <[^>]*> sllv at,a0,at -0+0040 <[^>]*> srlv a0,a0,a1 -0+0044 <[^>]*> or a0,a0,at -0+0048 <[^>]*> negu at,a2 -0+004c <[^>]*> sllv at,a1,at -0+0050 <[^>]*> srlv a0,a1,a2 -0+0054 <[^>]*> or a0,a0,at -0+0058 <[^>]*> srl at,a0,0x1 -0+005c <[^>]*> sll a0,a0,0x1f -0+0060 <[^>]*> or a0,a0,at -0+0064 <[^>]*> srl at,a1,0x1 -0+0068 <[^>]*> sll a0,a1,0x1f -0+006c <[^>]*> or a0,a0,at +0+0038 <[^>]*> srl a0,a1,0x0 +0+003c <[^>]*> negu at,a1 +0+0040 <[^>]*> sllv at,a0,at +0+0044 <[^>]*> srlv a0,a0,a1 +0+0048 <[^>]*> or a0,a0,at +0+004c <[^>]*> negu at,a2 +0+0050 <[^>]*> sllv at,a1,at +0+0054 <[^>]*> srlv a0,a1,a2 +0+0058 <[^>]*> or a0,a0,at +0+005c <[^>]*> srl at,a0,0x1 +0+0060 <[^>]*> sll a0,a0,0x1f +0+0064 <[^>]*> or a0,a0,at +0+0068 <[^>]*> srl at,a1,0x1 +0+006c <[^>]*> sll a0,a1,0x1f +0+0070 <[^>]*> or a0,a0,at +0+0074 <[^>]*> srl a0,a1,0x0 + ... diff --git a/gas/testsuite/gas/mips/rol.s b/gas/testsuite/gas/mips/rol.s index 259a957e803..988d7021c42 100644 --- a/gas/testsuite/gas/mips/rol.s +++ b/gas/testsuite/gas/mips/rol.s @@ -5,8 +5,11 @@ foo: rol $4,$5,$6 rol $4,1 rol $4,$5,1 + rol $4,$5,0 ror $4,$5 ror $4,$5,$6 ror $4,1 ror $4,$5,1 + ror $4,$5,0 + .space 8 diff --git a/gas/testsuite/gas/mips/rol64.d b/gas/testsuite/gas/mips/rol64.d index 8362219f1e3..32b132b4a6d 100644 --- a/gas/testsuite/gas/mips/rol64.d +++ b/gas/testsuite/gas/mips/rol64.d @@ -18,45 +18,49 @@ Disassembly of section .text: 0+0020 <[^>]*> dsll at,a0,0x1 0+0024 <[^>]*> dsrl32 a0,a0,0x1f 0+0028 <[^>]*> or a0,a0,at -0+002c <[^>]*> dsll at,a1,0x1 -0+0030 <[^>]*> dsrl32 a0,a1,0x1f -0+0034 <[^>]*> or a0,a0,at -0+0038 <[^>]*> dsll at,a1,0x1f -0+003c <[^>]*> dsrl32 a0,a1,0x1 -0+0040 <[^>]*> or a0,a0,at -0+0044 <[^>]*> dsll32 at,a1,0x0 -0+0048 <[^>]*> dsrl32 a0,a1,0x0 -0+004c <[^>]*> or a0,a0,at -0+0050 <[^>]*> dsll32 at,a1,0x1 -0+0054 <[^>]*> dsrl a0,a1,0x1f -0+0058 <[^>]*> or a0,a0,at -0+005c <[^>]*> dsll32 at,a1,0x1f -0+0060 <[^>]*> dsrl a0,a1,0x1 -0+0064 <[^>]*> or a0,a0,at -0+0068 <[^>]*> dnegu at,a1 -0+006c <[^>]*> dsllv at,a0,at -0+0070 <[^>]*> dsrlv a0,a0,a1 -0+0074 <[^>]*> or a0,a0,at -0+0078 <[^>]*> dnegu at,a2 -0+007c <[^>]*> dsllv at,a1,at -0+0080 <[^>]*> dsrlv a0,a1,a2 -0+0084 <[^>]*> or a0,a0,at -0+0088 <[^>]*> dsrl at,a0,0x1 -0+008c <[^>]*> dsll32 a0,a0,0x1f -0+0090 <[^>]*> or a0,a0,at -0+0094 <[^>]*> dsrl at,a1,0x1 -0+0098 <[^>]*> dsll32 a0,a1,0x1f -0+009c <[^>]*> or a0,a0,at -0+00a0 <[^>]*> dsrl at,a1,0x1f -0+00a4 <[^>]*> dsll32 a0,a1,0x1 +0+002c <[^>]*> dsrl a0,a1,0x0 +0+0030 <[^>]*> dsll at,a1,0x1 +0+0034 <[^>]*> dsrl32 a0,a1,0x1f +0+0038 <[^>]*> or a0,a0,at +0+003c <[^>]*> dsll at,a1,0x1f +0+0040 <[^>]*> dsrl32 a0,a1,0x1 +0+0044 <[^>]*> or a0,a0,at +0+0048 <[^>]*> dsll32 at,a1,0x0 +0+004c <[^>]*> dsrl32 a0,a1,0x0 +0+0050 <[^>]*> or a0,a0,at +0+0054 <[^>]*> dsll32 at,a1,0x1 +0+0058 <[^>]*> dsrl a0,a1,0x1f +0+005c <[^>]*> or a0,a0,at +0+0060 <[^>]*> dsll32 at,a1,0x1f +0+0064 <[^>]*> dsrl a0,a1,0x1 +0+0068 <[^>]*> or a0,a0,at +0+006c <[^>]*> dsrl a0,a1,0x0 +0+0070 <[^>]*> dnegu at,a1 +0+0074 <[^>]*> dsllv at,a0,at +0+0078 <[^>]*> dsrlv a0,a0,a1 +0+007c <[^>]*> or a0,a0,at +0+0080 <[^>]*> dnegu at,a2 +0+0084 <[^>]*> dsllv at,a1,at +0+0088 <[^>]*> dsrlv a0,a1,a2 +0+008c <[^>]*> or a0,a0,at +0+0090 <[^>]*> dsrl at,a0,0x1 +0+0094 <[^>]*> dsll32 a0,a0,0x1f +0+0098 <[^>]*> or a0,a0,at +0+009c <[^>]*> dsrl a0,a1,0x0 +0+00a0 <[^>]*> dsrl at,a1,0x1 +0+00a4 <[^>]*> dsll32 a0,a1,0x1f 0+00a8 <[^>]*> or a0,a0,at -0+00ac <[^>]*> dsrl32 at,a1,0x0 -0+00b0 <[^>]*> dsll32 a0,a1,0x0 +0+00ac <[^>]*> dsrl at,a1,0x1f +0+00b0 <[^>]*> dsll32 a0,a1,0x1 0+00b4 <[^>]*> or a0,a0,at -0+00b8 <[^>]*> dsrl32 at,a1,0x1 -0+00bc <[^>]*> dsll a0,a1,0x1f +0+00b8 <[^>]*> dsrl32 at,a1,0x0 +0+00bc <[^>]*> dsll32 a0,a1,0x0 0+00c0 <[^>]*> or a0,a0,at -0+00c4 <[^>]*> dsrl32 at,a1,0x1f -0+00c8 <[^>]*> dsll a0,a1,0x1 +0+00c4 <[^>]*> dsrl32 at,a1,0x1 +0+00c8 <[^>]*> dsll a0,a1,0x1f 0+00cc <[^>]*> or a0,a0,at +0+00d0 <[^>]*> dsrl32 at,a1,0x1f +0+00d4 <[^>]*> dsll a0,a1,0x1 +0+00d8 <[^>]*> or a0,a0,at +0+00dc <[^>]*> dsrl a0,a1,0x0 ... diff --git a/gas/testsuite/gas/ppc/altivec_xcoff64.d b/gas/testsuite/gas/ppc/altivec_xcoff64.d index e2a4e56990d..f83013786fc 100644 --- a/gas/testsuite/gas/ppc/altivec_xcoff64.d +++ b/gas/testsuite/gas/ppc/altivec_xcoff64.d @@ -2,7 +2,7 @@ #objdump: -Dr #name: xcoff64 AltiVec tests -.*: file format aixcoff64-rs6000 +.*: file format aix5?coff64-rs6000 Disassembly of section .text: diff --git a/gas/testsuite/gas/ppc/booke_xcoff64.d b/gas/testsuite/gas/ppc/booke_xcoff64.d index b5dcf637064..e5b2defd684 100644 --- a/gas/testsuite/gas/ppc/booke_xcoff64.d +++ b/gas/testsuite/gas/ppc/booke_xcoff64.d @@ -2,7 +2,7 @@ #objdump: -Dr -Mbooke64 #name: xcoff64 BookE tests -.*: file format aixcoff64-rs6000 +.*: file format aix5?coff64-rs6000 Disassembly of section .text: @@ -12,9 +12,9 @@ Disassembly of section .text: 8: 24 25 00 30 bce 1,4\*cr1\+gt,38 <.text\+0x38> c: 24 46 00 3d bcel 2,4\*cr1\+eq,48 <.text\+0x48> 10: 24 67 00 5a bcea 3,4\*cr1\+so,58 <.text\+0x58> - 10: R_BA .text + 12: R_BA_16 .text 14: 24 88 00 7b bcela 4,4\*cr2,78 <.text\+0x78> - 14: R_BA .text + 16: R_BA_16 .text 18: 4c a9 00 22 bclre 5,4\*cr2\+gt 1c: 4c aa 00 23 bclrel 5,4\*cr2\+eq 20: 4d 0b 04 22 bcctre 8,4\*cr2\+so @@ -22,9 +22,9 @@ Disassembly of section .text: 28: 58 00 00 74 be 9c <.text\+0x9c> 2c: 58 00 00 89 bel b4 <.text\+0xb4> 30: 58 00 00 f2 bea f0 <.text\+0xf0> - 30: R_BA .text + 30: R_BA_26 .text 34: 58 00 01 27 bela 124 <.text\+0x124> - 34: R_BA .text + 34: R_BA_26 .text 38: e9 09 00 80 lbze r8,8\(r9\) 3c: e9 8f 00 41 lbzue r12,4\(r15\) 40: 7c 86 40 fe lbzuxe r4,r6,r8 diff --git a/gas/testsuite/gas/sh/sh64/datal32-3.d b/gas/testsuite/gas/sh/sh64/datal32-3.d index 8d29c054c27..b24974477c7 100644 --- a/gas/testsuite/gas/sh/sh64/datal32-3.d +++ b/gas/testsuite/gas/sh/sh64/datal32-3.d @@ -14,7 +14,7 @@ HAS_RELOC, HAS_SYMS start address 0x0+ Sections: -Idx Name Size VMA LMA File off Algn +Idx Name Size VMA LMA File off Algn 0 \.text 0+6c 0+ 0+ 0+34 2\*\*0 CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE 1 \.data 0+ 0+ 0+ 0+a0 2\*\*0 -- 2.47.3