[PATCH v2] x86: Disallow instructions with length > 15 bytes
H.J. Lu
hjl.tools@gmail.com
Fri Feb 2 11:49:32 GMT 2024
On Fri, Feb 2, 2024 at 3:41 AM Jan Beulich <jbeulich@suse.com> wrote:
>
> On 02.02.2024 12:33, H.J. Lu wrote:
> > --- a/gas/config/tc-i386.c
> > +++ b/gas/config/tc-i386.c
> > @@ -11780,8 +11780,8 @@ output_insn (const struct last_insn *last_insn)
> > {
> > j = encoding_length (insn_start_frag, insn_start_off, frag_more (0));
> > if (j > 15)
> > - as_warn (_("instruction length of %u bytes exceeds the limit of 15"),
> > - j);
> > + as_bad (_("instruction length of %u bytes exceeds the limit of 15"),
> > + j);
>
> When taking purely a gas perspective, this may be okay. But I'd like
> to retain the ability to generate overlong insns (without resorting
> to .byte), so there wants to be a way to downgrade the error to a
> warning. This is useful in particular when trying to make testcases
> for disassemblers or other software decoding insns.
>
> Jan
I am checking it in now and backport it to 2.42 branch. We can add
a switch or a directive later to downgrade error to warning.
--
H.J.
More information about the Binutils
mailing list