This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] i386: Don't add 0x66 prefix to IRET for .code16gcc
- From: "Jan Beulich" <JBeulich at suse dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: <binutils at sourceware dot org>
- Date: Mon, 29 Apr 2019 01:00:56 -0600
- Subject: Re: [PATCH] i386: Don't add 0x66 prefix to IRET for .code16gcc
- References: <20190426172207.13838-1-hjl.tools@gmail.com>
>>> On 26.04.19 at 19:22, <hjl.tools@gmail.com> wrote:
> The .code16gcc directive supports 16bit mode with 32-bit address. Since
> IRET (opcode 0xcf) in 16bit mode returns from an interrupt in 16bit mode,
> we shouldn't add 0x66 prefix for IRET.
>
> PR gas/24485
> * config/tc-i386.c (process_suffix): Don't add DATA_PREFIX_OPCODE
> to IRET for .code16gcc.
This, at the very least, needs to be accompanied by a warning:
As the bug report validly says, the changed behavior is what is
wanted only "almost always". The report even mentions the
(supposedly uncommon) case: Code manually building a frame
and IRETing to it will now be silently(!) broken.
In fact I think the better solution would be to reject ambiguous
code by demanding a suffix in all cases in .code16gcc mode.
Jan