This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [short@ucw.cz: GAS i386 jmp generator .arch compliance [PATCH]]
- To: Jan Kratochvil <short at ucw dot cz>
- Subject: Re: [short@ucw.cz: GAS i386 jmp generator .arch compliance [PATCH]]
- From: Alan Modra <alan at linuxcare dot com dot au>
- Date: Mon, 12 Feb 2001 10:07:21 +1100 (EST)
- cc: Jan Hubicka <jh at suse dot cz>, binutils at sources dot redhat dot com
On Sun, 11 Feb 2001, Jan Hubicka wrote:
> ----- Forwarded message from Jan Kratochvil <short@ucw.cz> -----
>
> Unfortunately GAS still silently produces 32-bit conditional jumps which are
> available only on 386 and higher - the attached simple patch fixes this
> behaviour and gives proper warnings in such case.
>
> suggested commit msg:
> 32-bit conditional jumps availability checked by .arch mode
>[snip]
>
> @@ -3995,6 +4007,7 @@
> break;
>
> case ENCODE_RELAX_STATE (COND_JUMP, BIG):
> + warn_long_jump (fragP);
> extension = 5; /* 2 opcode + 4 displacement */
> opcode[1] = opcode[0] + 0x10;
> opcode[0] = TWO_BYTE_OPCODE_ESCAPE;
Is the above needed? I think you won't generate `BIG' jumps in 16 bit
mode, but it's a while since I added this code.
Also, can I ask that you do a little more work here? It would be nice if
instead of a warning in 8086 mode, we turned
jcond too_far
into
jncond .+5
jmp too_far
It's quite easy to do, and to save you some head-scratching, here's a
little hint: You will also need to increase the frag size by one (line
2707) ;-)
Alan Modra
--
Linuxcare. Support for the Revolution.