Re: [PATCH v5 02/10] x86: Compile-time asm code validation

Pedro Alves
2015-06-12T11:18:24Z

On 06/11/2015 03:10 PM, Josh Poimboeuf wrote:

> C would definitely make more sense when analyzing object code. In fact,
> asmvalidate is written in C. But then I guess we'd have to re-implement
> the .cfi stuff and populate the DWARF sections manually instead of
> letting the assembler do it.

Was doing all this directly in the assembler considered? That is,
e.g., add some knob that makes it error/warn in the same conditions
you're making the validator catch. For tail calls, you'd e.g., add
some new ".nonlocal" directive that you'd use to whitelist the
following jump. And then if it's possible run a CFI generator
as a separate step over the source, it sounds like it should also
be possible to have the assembler do it instead too (again with
some new high level directive to trigger/help it).

Thanks,
Pedro Alves