diff options
author | Nick Clifton <nickc@redhat.com> | 2002-08-01 16:31:16 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2002-08-01 16:31:16 +0000 |
commit | 08df23795b3c1ac9a1fdb57c9f1d0616fe1b2fba (patch) | |
tree | 2c2bacd03998a51a5d4ebfe4992c9afea479c5cb | |
parent | 70ee46581bf305c387bc3880ba85222ed468b8f5 (diff) | |
download | gdb-08df23795b3c1ac9a1fdb57c9f1d0616fe1b2fba.zip gdb-08df23795b3c1ac9a1fdb57c9f1d0616fe1b2fba.tar.gz gdb-08df23795b3c1ac9a1fdb57c9f1d0616fe1b2fba.tar.bz2 |
Ensure that offset to literal pool is computed using signed arithmetic so that
proper sign extension is performed if X_add_number is a 64-bit integer.
-rw-r--r-- | gas/ChangeLog | 6 | ||||
-rw-r--r-- | gas/config/tc-arm.c | 19 |
2 files changed, 18 insertions, 7 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 5fe5f16..3493ddb 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2002-08-01 Nick Clifton <nickc@redhat.com> + + * config/tc-arm.c (add_to_lit_pool): Ensure that offset to literal + pool is computed using signed arithmetic so that proper sign + extension is performed if X_add_number is a 64-bit integer. + 2002-08-01 H.J. Lu <hjl@gnu.org> Daniel Jacobowitz <drow@mvista.com> diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 7bb094f..7085a2f 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -2237,7 +2237,7 @@ add_to_lit_pool () } inst.reloc.exp.X_op = O_symbol; - inst.reloc.exp.X_add_number = (entry) * 4 - 8; + inst.reloc.exp.X_add_number = ((int) entry) * 4 - 8; inst.reloc.exp.X_add_symbol = pool->symbol; return SUCCESS; @@ -9682,7 +9682,7 @@ md_apply_fix3 (fixP, valP, seg) { as_bad_where (fixP->fx_file, fixP->fx_line, _("unable to compute ADRL instructions for PC offset of 0x%lx"), - value); + (long) value); break; } @@ -10048,7 +10048,8 @@ md_apply_fix3 (fixP, valP, seg) if ((value + 2) & ~0x3fe) as_bad_where (fixP->fx_file, fixP->fx_line, - _("invalid offset, value too big (0x%08lX)"), value); + _("invalid offset, value too big (0x%08lX)"), + (long) value); /* Round up, since pc will be rounded down. */ newval |= (value + 2) >> 2; @@ -10057,28 +10058,32 @@ md_apply_fix3 (fixP, valP, seg) case 9: /* SP load/store. */ if (value & ~0x3fc) as_bad_where (fixP->fx_file, fixP->fx_line, - _("invalid offset, value too big (0x%08lX)"), value); + _("invalid offset, value too big (0x%08lX)"), + (long) value); newval |= value >> 2; break; case 6: /* Word load/store. */ if (value & ~0x7c) as_bad_where (fixP->fx_file, fixP->fx_line, - _("invalid offset, value too big (0x%08lX)"), value); + _("invalid offset, value too big (0x%08lX)"), + (long) value); newval |= value << 4; /* 6 - 2. */ break; case 7: /* Byte load/store. */ if (value & ~0x1f) as_bad_where (fixP->fx_file, fixP->fx_line, - _("invalid offset, value too big (0x%08lX)"), value); + _("invalid offset, value too big (0x%08lX)"), + (long) value); newval |= value << 6; break; case 8: /* Halfword load/store. */ if (value & ~0x3e) as_bad_where (fixP->fx_file, fixP->fx_line, - _("invalid offset, value too big (0x%08lX)"), value); + _("invalid offset, value too big (0x%08lX)"), + (long) value); newval |= value << 5; /* 6 - 1. */ break; |