diff options
author | Ian Lance Taylor <ian@airs.com> | 1996-04-15 16:28:19 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1996-04-15 16:28:19 +0000 |
commit | 7a15a226ada5d390e119d5b4e8eb376e2d5c3d8d (patch) | |
tree | fd3980e9390f2305c61dd673f8c23ca090591432 /gas/config | |
parent | 449abd890017f4db4e9842a492e5be44610ecfaa (diff) | |
download | gdb-7a15a226ada5d390e119d5b4e8eb376e2d5c3d8d.zip gdb-7a15a226ada5d390e119d5b4e8eb376e2d5c3d8d.tar.gz gdb-7a15a226ada5d390e119d5b4e8eb376e2d5c3d8d.tar.bz2 |
* config/tc-mips.c (load_address): Cast X_add_number to valueT
before comparing against MAX_GPREL_OFFSET, so that negative
numbers are handled correctly.
(macro): Likewise.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-mips.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 19b271d..61f38dc 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -1993,7 +1993,8 @@ load_address (counter, reg, ep) lui $reg,<sym> (BFD_RELOC_HI16_S) addiu $reg,$reg,<sym> (BFD_RELOC_LO16) If we have an addend, we always use the latter form. */ - if (ep->X_add_number != 0 || nopic_need_relax (ep->X_add_symbol)) + if ((valueT) ep->X_add_number >= MAX_GPREL_OFFSET + || nopic_need_relax (ep->X_add_symbol)) p = NULL; else { @@ -2860,7 +2861,7 @@ macro (ip) addiu $tempreg,$tempreg,<sym> (BFD_RELOC_LO16) If we have a constant, we need two instructions anyhow, so we may as well always use the latter form. */ - if (offset_expr.X_add_number != 0 + if ((valueT) offset_expr.X_add_number >= MAX_GPREL_OFFSET || nopic_need_relax (offset_expr.X_add_symbol)) p = NULL; else @@ -3571,7 +3572,7 @@ macro (ip) With a constant we always use the latter case. */ if (breg == 0) { - if (offset_expr.X_add_number != 0 + if ((valueT) offset_expr.X_add_number >= MAX_GPREL_OFFSET || nopic_need_relax (offset_expr.X_add_symbol)) p = NULL; else @@ -3595,7 +3596,7 @@ macro (ip) } else { - if (offset_expr.X_add_number != 0 + if ((valueT) offset_expr.X_add_number >= MAX_GPREL_OFFSET || nopic_need_relax (offset_expr.X_add_symbol)) p = NULL; else @@ -4000,7 +4001,7 @@ macro (ip) If there is a base register, we add it to $at after the lui instruction. If there is a constant, we always use the last case. */ - if (offset_expr.X_add_number != 0 + if ((valueT) offset_expr.X_add_number >= MAX_GPREL_OFFSET || nopic_need_relax (offset_expr.X_add_symbol)) { p = NULL; |