diff options
author | Richard Sandiford <rdsandiford@googlemail.com> | 2009-09-13 19:18:11 +0000 |
---|---|---|
committer | Richard Sandiford <rdsandiford@googlemail.com> | 2009-09-13 19:18:11 +0000 |
commit | 1180b5a4deb36962eb5ad244f32d93e4ad519370 (patch) | |
tree | 60ffcaeeb998f209bb52cc696fff9bb1e89b71cf /gas/testsuite | |
parent | 3c0bfb2a239710f52543cc9e1a434814e82bd120 (diff) | |
download | gdb-1180b5a4deb36962eb5ad244f32d93e4ad519370.zip gdb-1180b5a4deb36962eb5ad244f32d93e4ad519370.tar.gz gdb-1180b5a4deb36962eb5ad244f32d93e4ad519370.tar.bz2 |
gas/
* config/tc-mips.c (MIPS_JALR_HINT_P): Take an expr argument.
Require the target to be a bare symbol on targets with
in-place addends.
(macro_build_jalr): Update accordingly.
(mips_fix_adjustable): Don't reduce R_MIPS_JALRs on targets
with in-place addends.
gas/testsuite/
* gas/mips/jalr2.s, gas/mips/jalr2.d: New test.
* gas/mips/jal-svr4pic.d: Don't expect R_MIPS_JALRs to be reduced.
* gas/mips/jal-xgot.d: Likewise.
* gas/mips/mips-abi32-pic2.d: Likewise.
* gas/mips/mips.exp: Run it.
Diffstat (limited to 'gas/testsuite')
-rw-r--r-- | gas/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gas/testsuite/gas/mips/jal-svr4pic.d | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/mips/jal-xgot.d | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/mips/jalr2.d | 41 | ||||
-rw-r--r-- | gas/testsuite/gas/mips/jalr2.s | 15 | ||||
-rw-r--r-- | gas/testsuite/gas/mips/mips-abi32-pic2.d | 6 | ||||
-rw-r--r-- | gas/testsuite/gas/mips/mips.exp | 1 |
7 files changed, 70 insertions, 5 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 3d737c2..6f23334 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,5 +1,13 @@ 2009-09-13 Richard Sandiford <rdsandiford@googlemail.com> + * gas/mips/jalr2.s, gas/mips/jalr2.d: New test. + * gas/mips/jal-svr4pic.d: Don't expect R_MIPS_JALRs to be reduced. + * gas/mips/jal-xgot.d: Likewise. + * gas/mips/mips-abi32-pic2.d: Likewise. + * gas/mips/mips.exp: Run it. + +2009-09-13 Richard Sandiford <rdsandiford@googlemail.com> + * gas/mips/mips16-dwarf2-n32.d: Expect odd addresses. 2009-09-11 Hans-Peter Nilsson <hp@bitrange.com> diff --git a/gas/testsuite/gas/mips/jal-svr4pic.d b/gas/testsuite/gas/mips/jal-svr4pic.d index ef51f4b..3fc206d 100644 --- a/gas/testsuite/gas/mips/jal-svr4pic.d +++ b/gas/testsuite/gas/mips/jal-svr4pic.d @@ -26,7 +26,7 @@ Disassembly of section .text: 0+0034 <[^>]*> addiu t9,t9,0 [ ]*34: R_MIPS_LO16 .text 0+0038 <[^>]*> jalr t9 -[ ]*38: R_MIPS_JALR .text +[ ]*38: R_MIPS_JALR text_label 0+003c <[^>]*> nop 0+0040 <[^>]*> lw gp,0\(sp\) 0+0044 <[^>]*> nop diff --git a/gas/testsuite/gas/mips/jal-xgot.d b/gas/testsuite/gas/mips/jal-xgot.d index 89a9b42..2ece157 100644 --- a/gas/testsuite/gas/mips/jal-xgot.d +++ b/gas/testsuite/gas/mips/jal-xgot.d @@ -27,7 +27,7 @@ Disassembly of section .text: 0+0034 <[^>]*> addiu t9,t9,0 [ ]*34: R_MIPS_LO16 .text 0+0038 <[^>]*> jalr t9 -[ ]*38: R_MIPS_JALR .text +[ ]*38: R_MIPS_JALR text_label 0+003c <[^>]*> nop 0+0040 <[^>]*> lw gp,0\(sp\) 0+0044 <[^>]*> lui t9,0x0 diff --git a/gas/testsuite/gas/mips/jalr2.d b/gas/testsuite/gas/mips/jalr2.d new file mode 100644 index 0000000..6509a18 --- /dev/null +++ b/gas/testsuite/gas/mips/jalr2.d @@ -0,0 +1,41 @@ +#as: -mips2 -32 -KPIC +#objdump: -dr + +.* + + +Disassembly of section \.text: + +.* <test>: +.*: afbc0010 sw gp,16\(sp\) +.*: 8f990000 lw t9,0\(gp\) +.*: R_MIPS_GOT16 \.text +.*: 2739004c addiu t9,t9,76 +.*: R_MIPS_LO16 \.text +.*: 0320f809 jalr t9 +.*: R_MIPS_JALR local +.*: 00000000 nop +.*: 8fbc0010 lw gp,16\(sp\) +.*: 8f990000 lw t9,0\(gp\) +.*: R_MIPS_GOT16 \.text +.*: 27390058 addiu t9,t9,88 +.*: R_MIPS_LO16 \.text +# No R_MIPS_JALR here, because the target address had an addend. +.*: 0320f809 jalr t9 +.*: 00000000 nop +.*: 8fbc0010 lw gp,16\(sp\) +.*: 8f990000 lw t9,0\(gp\) +.*: R_MIPS_CALL16 global +.*: 0320f809 jalr t9 +.*: R_MIPS_JALR global +.*: 00000000 nop +.*: 8fbc0010 lw gp,16\(sp\) +.*: 8f99000c lw t9,12\(gp\) +.*: R_MIPS_CALL16 global +# No R_MIPS_JALR here either, for the same reason. +.*: 0320f809 jalr t9 +.*: 00000000 nop +.*: 8fbc0010 lw gp,16\(sp\) + +.* <local>: + \.\.\. diff --git a/gas/testsuite/gas/mips/jalr2.s b/gas/testsuite/gas/mips/jalr2.s new file mode 100644 index 0000000..6b100d7 --- /dev/null +++ b/gas/testsuite/gas/mips/jalr2.s @@ -0,0 +1,15 @@ + .ent test +test: + .frame $sp,32,$31 + .cprestore 16 + jal local + jal local+12 + jal global + jal global+12 + .end test + +local: + nop + nop + nop + nop diff --git a/gas/testsuite/gas/mips/mips-abi32-pic2.d b/gas/testsuite/gas/mips/mips-abi32-pic2.d index 5336780..aca0dbd 100644 --- a/gas/testsuite/gas/mips/mips-abi32-pic2.d +++ b/gas/testsuite/gas/mips/mips-abi32-pic2.d @@ -16,7 +16,7 @@ Disassembly of section \.text: 0+014 <[^>]*> 273900cc addiu t9,t9,204 14: R_MIPS_LO16 \.text 0+018 <[^>]*> 0320f809 jalr t9 - 18: R_MIPS_JALR \.text + 18: R_MIPS_JALR end 0+01c <[^>]*> 00000000 nop 0+020 <[^>]*> 8fbc0008 lw gp,8\(sp\) 0+024 <[^>]*> 00000000 nop @@ -36,7 +36,7 @@ Disassembly of section \.text: 0+050 <[^>]*> 273900cc addiu t9,t9,204 50: R_MIPS_LO16 \.text 0+054 <[^>]*> 0320f809 jalr t9 - 54: R_MIPS_JALR \.text + 54: R_MIPS_JALR end 0+058 <[^>]*> 00000000 nop 0+05c <[^>]*> 3c010001 lui at,0x1 0+060 <[^>]*> 003d0821 addu at,at,sp @@ -60,7 +60,7 @@ Disassembly of section \.text: 0+09c <[^>]*> 273900cc addiu t9,t9,204 9c: R_MIPS_LO16 \.text 0+0a0 <[^>]*> 0320f809 jalr t9 - a0: R_MIPS_JALR \.text + a0: R_MIPS_JALR end 0+0a4 <[^>]*> 00000000 nop 0+0a8 <[^>]*> 3c010001 lui at,0x1 0+0ac <[^>]*> 003d0821 addu at,at,sp diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp index ebe17c5..6f82f46 100644 --- a/gas/testsuite/gas/mips/mips.exp +++ b/gas/testsuite/gas/mips/mips.exp @@ -706,6 +706,7 @@ if { [istarget mips*-*-vxworks*] } { run_list_test "tls-ill" "-32" run_dump_test "tls-o32" + run_dump_test "jalr2" } if $has_newabi { |