diff options
author | Ian Lance Taylor <ian@airs.com> | 1997-02-11 20:56:00 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1997-02-11 20:56:00 +0000 |
commit | 16262668acc29046648c3dafc6a5a535abce3c9d (patch) | |
tree | 6621ac39245f9404ed6b6c43487a4cc8a2a57dc6 /gas | |
parent | b0c0b41ab150bee67a4d7bc825ef3e282c8f39c5 (diff) | |
download | gdb-16262668acc29046648c3dafc6a5a535abce3c9d.zip gdb-16262668acc29046648c3dafc6a5a535abce3c9d.tar.gz gdb-16262668acc29046648c3dafc6a5a535abce3c9d.tar.bz2 |
* config/tc-mips.c (mips16_ip): Handle %gprel modifier.
(md_apply_fix): Handle BFD_RELOC_MIPS16_GPREL.
* config/tc-mips.c (append_insn): Output jump instruction as a
pair of 2 byte instructions, rather than as a single 4 byte
instruction.
start-sanitize-r5900
* config/tc-mips.c (md_begin): Correct test of mips_5900.
(mips_ip): Don't check INSN_ISA for a macro.
end-sanitize-r5900
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 14 | ||||
-rw-r--r-- | gas/config/tc-mips.c | 59 |
2 files changed, 59 insertions, 14 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 968d433..0b2ba3b 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,17 @@ +Tue Feb 11 15:52:22 1997 Ian Lance Taylor <ian@cygnus.com> + + * config/tc-mips.c (mips16_ip): Handle %gprel modifier. + (md_apply_fix): Handle BFD_RELOC_MIPS16_GPREL. + + * config/tc-mips.c (append_insn): Output jump instruction as a + pair of 2 byte instructions, rather than as a single 4 byte + instruction. + +start-sanitize-r5900 + * config/tc-mips.c (md_begin): Correct test of mips_5900. + (mips_ip): Don't check INSN_ISA for a macro. + +end-sanitize-r5900 start-sanitize-r5900 Fri Feb 7 11:11:06 1997 Gavin Koch <gavin@cygnus.com> diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 4b3c955..87cac56 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -793,7 +793,7 @@ md_begin () mips_isa = 3; if (mips_cpu == -1) mips_cpu = 5900; - if (mips_5900 = -1) + if (mips_5900 == -1) mips_5900 = 1; } /* end-sanitize-r5900 */ @@ -1533,8 +1533,13 @@ append_insn (place, ip, address_expr, reloc_type, unmatched_hi) } } - if (! mips16 || reloc_type == BFD_RELOC_MIPS16_JMP) + if (! mips16) md_number_to_chars (f, ip->insn_opcode, 4); + else if (reloc_type == BFD_RELOC_MIPS16_JMP) + { + md_number_to_chars (f, ip->insn_opcode >> 16, 2); + md_number_to_chars (f + 2, ip->insn_opcode & 0xffff, 2); + } else { if (ip->use_extend) @@ -6132,17 +6137,18 @@ mips_ip (str, ip) insn_isa = 1; if (insn_isa > mips_isa - || ((insn->pinfo & INSN_ISA) == INSN_4650 - && ! mips_4650) - || ((insn->pinfo & INSN_ISA) == INSN_4010 - && ! mips_4010) - || ((insn->pinfo & INSN_ISA) == INSN_4100 - && ! mips_4100) - /* start-sanitize-r5900 */ - || ((insn->pinfo & INSN_ISA) == INSN_5900 - && ! mips_5900) - /* end-sanitize-r5900 */ - ) + || (insn->pinfo != INSN_MACRO + && (((insn->pinfo & INSN_ISA) == INSN_4650 + && ! mips_4650) + || ((insn->pinfo & INSN_ISA) == INSN_4010 + && ! mips_4010) + || ((insn->pinfo & INSN_ISA) == INSN_4100 + && ! mips_4100) + /* start-sanitize-r5900 */ + || ((insn->pinfo & INSN_ISA) == INSN_5900 + && ! mips_5900) + /* end-sanitize-r5900 */ + ))) { if (insn + 1 < &mips_opcodes[NUMOPCODES] && strcmp (insn->name, insn[1].name) == 0) @@ -7191,7 +7197,31 @@ mips16_ip (str, ip) continue; } - my_getExpression (&imm_expr, s); + if (s[0] == '%' + && strncmp (s + 1, "gprel(", sizeof "gprel(" - 1) == 0) + { + /* This is %gprel(SYMBOL). We need to read SYMBOL, + and generate the appropriate reloc. If the text + inside %gprel is not a symbol name with an + optional offset, then we generate a normal reloc + and will probably fail later. */ + my_getExpression (&imm_expr, s + sizeof "%gprel" - 1); + if (imm_expr.X_op == O_symbol) + { + mips16_ext = true; + imm_reloc = BFD_RELOC_MIPS16_GPREL; + s = expr_end; + ip->use_extend = true; + ip->extend = 0; + continue; + } + } + else + { + /* Just pick up a normal expression. */ + my_getExpression (&imm_expr, s); + } + /* We need to relax this instruction. */ imm_reloc = (int) BFD_RELOC_UNUSED + c; s = expr_end; @@ -8341,6 +8371,7 @@ md_apply_fix (fixP, valueP) case BFD_RELOC_MIPS_GOT_LO16: case BFD_RELOC_MIPS_CALL_HI16: case BFD_RELOC_MIPS_CALL_LO16: + case BFD_RELOC_MIPS16_GPREL: if (fixP->fx_pcrel) as_bad_where (fixP->fx_file, fixP->fx_line, "Invalid PC relative reloc"); |