From b12dd2e413a8a2491986dcb46ae42d3c8362629b Mon Sep 17 00:00:00 2001 From: Chao-ying Fu Date: Wed, 5 Aug 2009 21:22:15 +0000 Subject: [PATCH] 2009-08-05 Chao-ying Fu * 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 | 6 ++++++ gas/config/tc-mips.c | 12 ++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 3b9dc58..6bbf281 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2009-08-05 Chao-ying Fu + + * 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 * config/tc-avr.c (mcu_types): Add attiny2313a, attiny4313, attiny261a, diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 5f8d447..0a2f9e4 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -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); } -- 2.7.4