[PATCH] x86: Warn .insn instruction with length > 15 bytes
H.J. Lu
hjl.tools@gmail.com
Tue Feb 6 11:36:06 GMT 2024
On Tue, Feb 6, 2024 at 12:19 AM Jan Beulich <jbeulich@suse.com> wrote:
>
> On 05.02.2024 21:00, H.J. Lu wrote:
> > Change .insn instruction with length > 15 bytes from error to warning.
>
> Thanks for doing this. FTAOD though - it addresses only half of my
> concern. Besides .insn (where the concern was of general nature) I
> also use
>
> bextr eax, fs:[eax*4], 0x11223344
> xacquire lock add qword ptr gs:[eax*8], 0x11223344
>
> in testing of my own disassembler library. I expect to continue to
> be able to avoid using .insn (and even more so .byte) when assembling
> this code. IOW there will still need to be a way to also override
> the defaulting to as_bad() when not using .insn.
We issue a warning when something is wrong in input, but still manage
to generate an instruction. This is an error case.
> > --- a/gas/config/tc-i386.c
> > +++ b/gas/config/tc-i386.c
> > @@ -11780,8 +11780,14 @@ output_insn (const struct last_insn *last_insn)
> > {
> > j = encoding_length (insn_start_frag, insn_start_off, frag_more (0));
> > if (j > 15)
> > - as_bad (_("instruction length of %u bytes exceeds the limit of 15"),
> > - j);
> > + {
> > + if (i.tm.mnem_off == MN__insn)
>
> Please don't open-code dot_insn().
>
Fixed in v2.
--
H.J.
More information about the Binutils
mailing list