tweak last patch

This commit is contained in:
Ian Lance Taylor 1998-01-27 17:33:35 +00:00
parent 8ecadea45b
commit 29b2b5da96
2 changed files with 9 additions and 7 deletions

View File

@ -1,7 +1,8 @@
Tue Jan 27 12:24:32 1998 Ian Lance Taylor <ian@cygnus.com>
* config/tc-arm.c (md_apply_fix3): Add casts before comparing
offsetT variable set to unsigned int value with FAIL.
* config/tc-arm.c (md_apply_fix3): Add new variable newimm to hold
validate_immediate return value in the right type for comparisons
to FAIL.
Tue Jan 27 06:51:59 1998 Richard Henderson <rth@cygnus.com>

View File

@ -5036,6 +5036,7 @@ md_apply_fix3 (fixP, val, seg)
{
offsetT value = *val;
offsetT newval;
unsigned int newimm;
unsigned long temp;
int sign;
char *buf = fixP->fx_where + fixP->fx_frag->fr_literal;
@ -5072,21 +5073,21 @@ md_apply_fix3 (fixP, val, seg)
switch (fixP->fx_r_type)
{
case BFD_RELOC_ARM_IMMEDIATE:
newval = (offsetT) validate_immediate (value);
newimm = (offsetT) validate_immediate (value);
temp = md_chars_to_number (buf, INSN_SIZE);
/* If the instruction will fail, see if we can fix things up by
changing the opcode. */
if (newval == (offsetT) FAIL
&& (newval = negate_data_op (&temp, value)) == (offsetT) FAIL)
if (newimm == (unsigned int) FAIL
&& (newimm = negate_data_op (&temp, value)) == (unsigned int) FAIL)
{
as_bad_where (fixP->fx_file, fixP->fx_line,
"invalid constant after fixup\n");
break;
}
newval |= (temp & 0xfffff000);
md_number_to_chars (buf, newval, INSN_SIZE);
newimm |= (temp & 0xfffff000);
md_number_to_chars (buf, (valueT) newimm, INSN_SIZE);
break;
case BFD_RELOC_ARM_OFFSET_IMM: