[PATCH] New testcase for MIPS jal overflow/misalignment mismatch

cgd@broadcom.com cgd@broadcom.com
Tue Sep 17 11:19:00 GMT 2002


At Tue, 17 Sep 2002 08:25:00 +0000 (UTC), "Thiemo Seufer" wrote:
> +	jal	0x0
> +	jal	0x7fffffc
> +	jal	0x7fffffd
> +	jal	0x8000000

OK, i'm puzzled about these.

jal (and j) takes a 28 bit PC index-into-segment, that it puts into a
26-bit field.

None of these go into the 29th address bit, so I don't understand why
any would overflow.

from the code (pre-existing):

              if (address_expr->X_add_number & ~0xfffffff
                  || address_expr->X_add_number > 0x7fffffc)  
                as_bad (_("jump address range overflow (0x%lx)"),      
                        (unsigned long) address_expr->X_add_number);  
              ip->insn_opcode |= (address_expr->X_add_number >> 2) & 0x3ffffff;

why the 7fffffc here?  shouldn't that be ffffffc ?


(OK, i'll be the first to admit it if need be: i've not caffeinated
yet this morning...  8-)


chris



More information about the Binutils mailing list