diff options
author | Ian Lance Taylor <ian@airs.com> | 1997-01-03 17:14:02 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1997-01-03 17:14:02 +0000 |
commit | a78bc551965be8b006fcee34670ce0345ff1a374 (patch) | |
tree | 8624c6172560300f153702d11cef5a7711721e42 /gas/config/tc-m68k.c | |
parent | de224d6a49136398b8d0d151b7079fd4b1ede8a3 (diff) | |
download | gdb-a78bc551965be8b006fcee34670ce0345ff1a374.zip gdb-a78bc551965be8b006fcee34670ce0345ff1a374.tar.gz gdb-a78bc551965be8b006fcee34670ce0345ff1a374.tar.bz2 |
* config/tc-m68k.c (m68k_ip): Accept 'B' as a size for an
immediate value.
(md_assemble): If the size is 'B', set fx_signed.
(md_apply_fix_2): Use fx_signed when checking for overflow.
* write.h (struct fix): Add fx_signed field.
* write.c (fix_new_internal): Initialize fx_no_overflow and
fx_signed fields.
(fixup_segment): Use fx_signed when checking for overflow.
* config/obj-coff.c (fixup_segment): Check fx_no_overflow and
fx_signed when checking for overflow.
Diffstat (limited to 'gas/config/tc-m68k.c')
-rw-r--r-- | gas/config/tc-m68k.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c index 0e40fa3..7204ec3 100644 --- a/gas/config/tc-m68k.c +++ b/gas/config/tc-m68k.c @@ -1152,6 +1152,11 @@ m68k_ip (instring) && (opP->disp.exp.X_op != O_constant || ! isbyte (opP->disp.exp.X_add_number))) losing++; + else if (s[1] == 'B' + && ! isvar (&opP->disp) + && (opP->disp.exp.X_op != O_constant + || ! issbyte (opP->disp.exp.X_add_number))) + losing++; else if (s[1] == 'w' && ! isvar (&opP->disp) && (opP->disp.exp.X_op != O_constant @@ -2289,6 +2294,13 @@ m68k_ip (instring) the_ins.reloc[the_ins.nrel - 1].n = (opcode->m_codenum) * 2 + 1; break; + case 'B': + if (!issbyte (tmpreg)) + opP->error = "out of range"; + opcode->m_opcode |= tmpreg; + if (isvar (&opP->disp)) + the_ins.reloc[the_ins.nrel - 1].n = opcode->m_codenum * 2 - 1; + break; case 'w': if (!isword (tmpreg)) opP->error = "out of range"; @@ -3337,6 +3349,8 @@ md_assemble (str) get_reloc_code (n, the_ins.reloc[m].pcrel, the_ins.reloc[m].pic_reloc)); fixP->fx_pcrel_adjust = the_ins.reloc[m].pcrel_fix; + if (the_ins.reloc[m].wid == 'B') + fixP->fx_signed = 1; } return; } @@ -3888,7 +3902,7 @@ md_apply_fix_2 (fixP, val) like "0xff" for a byte field. So extend the upper part of the range to accept such numbers. We arbitrarily disallow "-0xff" or "0xff+0xff", so that we can do any range checking at all. */ - if (!fixP->fx_pcrel) + if (! fixP->fx_pcrel && ! fixP->fx_signed) upper_limit = upper_limit * 2 + 1; if ((addressT) val > upper_limit |