+Mon Apr 15 12:26:33 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * 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.
+
Thu Apr 11 12:39:02 1996 Ian Lance Taylor <ian@cygnus.com>
* config/tc-sparc.c (last_insn): New static variable.
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
{
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
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
}
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
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;