[PATCH] x86: Warn .insn instruction with length > 15 bytes
Jan Beulich
jbeulich@suse.com
Thu Feb 8 08:15:20 GMT 2024
On 08.02.2024 05:47, Hongyu Wang wrote:
>> as_bad() is used to mark errors that result in what we
>> presume to be a useless object file. Say, we ignored
>> something that might have been vital.
>> ...
>>
>> as_warn() is used when we have an error from which we
>> have a plausible error recovery. eg, masking the top
>> bits of a constant that is longer than will fit in the
>> destination. In this case we will continue to assemble
>> the source, although we may have made a bad assumption,
>> and we will produce an object file and return normal exit
>> status (ie, no error).
>> ...
>>
>> It's obvious to me that just continuing to assemble the over-long
>> instruction is a "plausible error recovery". It's even more plausible
>> than "masking the top bits of a constant". Certainly an object file
>> containing a byte sequence correspending to the overlong instruction is
>> not "useless".
>
> We have encountered such issue when running APX workloads with SDE.
> The over-long instruction became either illegal or wrong instruction
> when executing the program, then it crashes after long time running.
> This definitely increases much effort for runtime diagnostics.
Well, that's what you get for not paying attention to diagnostics.
They aren't emitted just for fun.
Jan
> As the over-long instruction would actually break the program, say the
> object crashes or returns with abnormal exit status, the default
> should be an error for assembler and we can add an option to lower the
> error to warning.
More information about the Binutils
mailing list