2009-08-05 Chao-ying Fu <fu@mips.com>
authorChao-ying Fu <fu@mips.com>
Wed, 5 Aug 2009 21:22:15 +0000 (21:22 +0000)
committerChao-ying Fu <fu@mips.com>
Wed, 5 Aug 2009 21:22:15 +0000 (21:22 +0000)
* config/tc-mips.c (MIPS_JALR_HINT_P): New define. For IRIX, it is
true for new abi.  For non-IRIX targets, it is always true.
(macro_build_jalr): If MIPS_JALR_HINT_P, emit BFD_RELOC_MIPS_JALR.

gas/ChangeLog
gas/config/tc-mips.c

index 3b9dc58..6bbf281 100644 (file)
@@ -1,3 +1,9 @@
+2009-08-05  Chao-ying Fu  <fu@mips.com>
+
+       * config/tc-mips.c (MIPS_JALR_HINT_P): New define. For IRIX, it is
+       true for new abi.  For non-IRIX targets, it is always true.
+       (macro_build_jalr): If MIPS_JALR_HINT_P, emit BFD_RELOC_MIPS_JALR.
+
 2009-08-05  Eric B. Weddington  <eric.weddington@atmel.com>
 
        * config/tc-avr.c (mcu_types): Add attiny2313a, attiny4313, attiny261a,
index 5f8d447..0a2f9e4 100644 (file)
@@ -290,6 +290,14 @@ static int file_ase_mips16;
                              || mips_opts.isa == ISA_MIPS64            \
                              || mips_opts.isa == ISA_MIPS64R2)
 
+/* True if we want to create R_MIPS_JALR for jalr $25.  */
+#ifdef TE_IRIX
+#define MIPS_JALR_HINT_P HAVE_NEWABI
+#else
+/* As a GNU extension, we use R_MIPS_JALR for o32 too.  */
+#define MIPS_JALR_HINT_P 1
+#endif
+
 /* True if -mips3d was passed or implied by arguments passed on the
    command line (e.g., by -march).  */
 static int file_ase_mips3d;
@@ -3922,13 +3930,13 @@ macro_build_jalr (expressionS *ep)
 {
   char *f = NULL;
 
-  if (HAVE_NEWABI)
+  if (MIPS_JALR_HINT_P)
     {
       frag_grow (8);
       f = frag_more (0);
     }
   macro_build (NULL, "jalr", "d,s", RA, PIC_CALL_REG);
-  if (HAVE_NEWABI)
+  if (MIPS_JALR_HINT_P)
     fix_new_exp (frag_now, f - frag_now->fr_literal,
                 4, ep, FALSE, BFD_RELOC_MIPS_JALR);
 }