aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2004-01-12 09:30:49 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2004-01-12 09:30:49 +0000
commitcc3d92a51a68cbf2af232c598821e1b40630be77 (patch)
tree7c97bdf051030849d598d8c3dbb4bf07ef0a6160
parent818a27acd60601744a6bc7ba516376ee7ef8a938 (diff)
downloadgdb-cc3d92a51a68cbf2af232c598821e1b40630be77.zip
gdb-cc3d92a51a68cbf2af232c598821e1b40630be77.tar.gz
gdb-cc3d92a51a68cbf2af232c598821e1b40630be77.tar.bz2
gas/
* config/tc-mips.c (macro_build_jalr): When adding an R_MIPS_JALR reloc, reserve space for the delay slot as well as the jalr itself. gas/testsuite/ * gas/mips/elf-rel18.[sd]: New test. * gas/mips/mips.exp: Run it.
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-mips.c2
-rw-r--r--gas/testsuite/ChangeLog5
-rw-r--r--gas/testsuite/gas/mips/elf-rel18.d9
-rw-r--r--gas/testsuite/gas/mips/elf-rel18.s5
-rw-r--r--gas/testsuite/gas/mips/mips.exp3
6 files changed, 28 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 1f0aa97..0a6f41a 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2004-01-12 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/tc-mips.c (macro_build_jalr): When adding an R_MIPS_JALR
+ reloc, reserve space for the delay slot as well as the jalr itself.
+
2004-01-09 Paul Brook <paul@codesourcery.com>
* config/tc-arm.c (do_vfp_reg2_from_sp2): Rename from do_vfp_sp_reg2.
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index da0ea76..fcf0a79 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -3169,7 +3169,7 @@ macro_build_jalr (int icnt, expressionS *ep)
if (HAVE_NEWABI)
{
- frag_grow (4);
+ frag_grow (8);
f = frag_more (0);
}
macro_build (NULL, &icnt, NULL, "jalr", "d,s", RA, PIC_CALL_REG);
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 24d56e1..d96b7ba 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2004-01-12 Richard Sandiford <rsandifo@redhat.com>
+
+ * gas/mips/elf-rel18.[sd]: New test.
+ * gas/mips/mips.exp: Run it.
+
2004-01-09 Paul Brook <paul@codesourcery.com>
* gas/arm/vfp2.s, gas/arm/vfp2.d: New test.
diff --git a/gas/testsuite/gas/mips/elf-rel18.d b/gas/testsuite/gas/mips/elf-rel18.d
new file mode 100644
index 0000000..fa467a4
--- /dev/null
+++ b/gas/testsuite/gas/mips/elf-rel18.d
@@ -0,0 +1,9 @@
+#readelf: --relocs
+#as: -mabi=n32 -KPIC
+
+Relocation section '\.rela\.text' at offset .* contains 4 entries:
+ Offset Info Type Sym.Value Sym. Name \+ Addend
+00000ed0 .* R_MIPS_CALL16 00000000 foo \+ 0
+00000ed4 .* R_MIPS_JALR 00000000 foo \+ 0
+00000edc .* R_MIPS_CALL16 00000000 foo \+ 0
+00000ee0 .* R_MIPS_JALR 00000000 foo \+ 0
diff --git a/gas/testsuite/gas/mips/elf-rel18.s b/gas/testsuite/gas/mips/elf-rel18.s
new file mode 100644
index 0000000..b019331
--- /dev/null
+++ b/gas/testsuite/gas/mips/elf-rel18.s
@@ -0,0 +1,5 @@
+ .rept 0x3b4
+ nop
+ .endr
+ jal foo
+ jal foo
diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp
index 2d515a9..124df79 100644
--- a/gas/testsuite/gas/mips/mips.exp
+++ b/gas/testsuite/gas/mips/mips.exp
@@ -671,6 +671,9 @@ if { [istarget mips*-*-*] } then {
run_dump_test "elf-rel-xgot-n64"
}
run_dump_test "elf-rel17"
+ if $has_newabi {
+ run_dump_test "elf-rel18"
+ }
run_dump_test "${tmips}${el}empic"
run_dump_test "empic2"