mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-25 13:27:26 +08:00
Second fix for microblaze gas port's ability to parse constants.
PR gas/18189 * config/tc-microblaze.c (parse_imm): Use offsetT as the type for min and max parameters. Sign extend values before testing.
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
PR gas/18189
|
PR gas/18189
|
||||||
* config/tc-microblaze.c (parse_imm): Use offsetT as the type for
|
* config/tc-microblaze.c (parse_imm): Use offsetT as the type for
|
||||||
min and max parameters.
|
min and max parameters. Sign extend values before testing.
|
||||||
|
|
||||||
2015-04-02 Renlin Li <renlin.li@arm.com>
|
2015-04-02 Renlin Li <renlin.li@arm.com>
|
||||||
|
|
||||||
|
@ -736,11 +736,17 @@ parse_imm (char * s, expressionS * e, offsetT min, offsetT max)
|
|||||||
; /* An error message has already been emitted. */
|
; /* An error message has already been emitted. */
|
||||||
else if ((e->X_op != O_constant && e->X_op != O_symbol) )
|
else if ((e->X_op != O_constant && e->X_op != O_symbol) )
|
||||||
as_fatal (_("operand must be a constant or a label"));
|
as_fatal (_("operand must be a constant or a label"));
|
||||||
else if ((e->X_op == O_constant) && (e->X_add_number < min
|
else if (e->X_op == O_constant)
|
||||||
|| e->X_add_number > max))
|
|
||||||
{
|
{
|
||||||
as_fatal (_("operand must be absolute in range %lx..%lx, not %lx"),
|
/* Special case: sign extend negative 32-bit values to 64-bits. */
|
||||||
(long) min, (long) max, (long) e->X_add_number);
|
if ((e->X_add_number >> 31) == 1)
|
||||||
|
e->X_add_number |= (-1 << 31);
|
||||||
|
|
||||||
|
if (e->X_add_number < min || e->X_add_number > max)
|
||||||
|
{
|
||||||
|
as_fatal (_("operand must be absolute in range %lx..%lx, not %lx"),
|
||||||
|
(long) min, (long) max, (long) e->X_add_number);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (atp)
|
if (atp)
|
||||||
|
Reference in New Issue
Block a user