gas/
authorRichard Sandiford <rdsandiford@googlemail.com>
Mon, 12 Jan 2004 09:30:49 +0000 (09:30 +0000)
committerRichard Sandiford <rdsandiford@googlemail.com>
Mon, 12 Jan 2004 09:30:49 +0000 (09:30 +0000)
* 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.

gas/ChangeLog
gas/config/tc-mips.c
gas/testsuite/ChangeLog
gas/testsuite/gas/mips/elf-rel18.d [new file with mode: 0644]
gas/testsuite/gas/mips/elf-rel18.s [new file with mode: 0644]
gas/testsuite/gas/mips/mips.exp

index 1f0aa97cafe7098d29edd0d8969baae300df345c..0a6f41aea1f4d42917fb2efe9dcb0c07467d1a11 100644 (file)
@@ -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.
index da0ea769970cdd4f002f1fc8d04697c1c05533fa..fcf0a79fdfa94ca03a639d9cfebc1794f7cf1ba5 100644 (file)
@@ -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);
index 24d56e144bf30771c007996de80bcf70c8b6f49f..d96b7ba9bb1b29255034a7d4c31b6e8da76d92e9 100644 (file)
@@ -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 (file)
index 0000000..fa467a4
--- /dev/null
@@ -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 (file)
index 0000000..b019331
--- /dev/null
@@ -0,0 +1,5 @@
+       .rept   0x3b4
+       nop
+       .endr
+       jal     foo
+       jal     foo
index 2d515a96b6937ec402a2da628eb80d5be61094b6..124df794751c6d59cd144d553ee55835d9afd631 100644 (file)
@@ -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"