This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] New testcase for MIPS jal overflow/misalignmentmismatch


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]