This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: MIPS assembler branch relaxations
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: binutils at sources dot redhat dot com
- Cc: echristo at redhat dot com
- Date: 15 Sep 2002 01:44:36 -0300
- Subject: Re: MIPS assembler branch relaxations
- Organization: GCC Team, Red Hat
- References: <orr8fxdsby.fsf@free.redhat.lsd.ic.unicamp.br>
On Sep 14, 2002, Alexandre Oliva <aoliva@redhat.com> wrote:
> + val = S_GET_VALUE (fragp->fr_symbol) + fragp->fr_offset;
> +
> + addr = fragp->fr_address + fragp->fr_fix;
> +
> + val -= addr;
> +
> + toofar = val < - (0x8000 << 2) || val >= (0x8000 << 2);
I just realized this test is off by 4. The base address added to the
branch offset is the address of the instruction in the delay slot, not
that of the branch instruction. I'm amending the patch as follows:
addr = fragp->fr_address + fragp->fr_fix + 4;
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist Professional serial bug killer