[RFC PATCH 16/21] objtool: Add support for CONFIG_CFI_CLANG

Sami Tolvanen samitolvanen at google.com
Fri Apr 29 18:00:03 PDT 2022


On Fri, Apr 29, 2022 at 4:30 PM Peter Zijlstra <peterz at infradead.org> wrote:
> Urgh, what does this do for decode speed? This is a hash-lookup for
> every single instruction.

Two actually, since .kcfi_traps only contains compiler-emitted
locations and we also have to check for manual type annotations. I
haven't measured performance yet, but I also didn't notice a
significant impact here.

> Is that kcfi location array sorted by the compiler? Because then you can
> keep a running iterator and replace the whole lookup with a simple
> equality comparison.

The compiler generates a separate .kcfi_types section for each text
section and the entries are emitted in order, so this should be
doable.

Sami



More information about the linux-arm-kernel mailing list