linux/tools/objtool/include/objtool
Josh Poimboeuf fc0bb9915b objtool: Grow __cfi_* prefix symbols for all CFI+CALL_PADDING
For all CONFIG_CFI+CONFIG_CALL_PADDING configs, for C functions, the
__cfi_ symbols only cover the 5-byte kCFI type hash.  After that there
also N bytes of NOP padding between the hash and the function entry
which aren't associated with any symbol.

The NOPs can be replaced with actual code at runtime.  Without a symbol,
unwinders and tooling have no way of knowing where those bytes belong.

Grow the existing __cfi_* symbols to fill that gap.

Note that assembly functions with SYM_TYPED_FUNC_START() aren't affected
by this issue, their __cfi_ symbols also cover the padding.

Also, CONFIG_PREFIX_SYMBOLS has no reason to exist: CONFIG_CALL_PADDING
is what causes the compiler to emit NOP padding before function entry
(via -fpatchable-function-entry), so it's the right condition for
creating prefix symbols.

Remove CONFIG_PREFIX_SYMBOLS, as it's no longer needed.  Simplify the
LONGEST_SYM_KUNIT_TEST dependency accordingly.  Rework objtool's
arguments a bit to handle the variety of prefix/cfi-related cases.

Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
2026-05-04 21:16:07 -07:00
..
arch.h objtool/klp: Fix position-dependent checksums for non-relocated jumps/calls 2026-05-04 21:16:06 -07:00
builtin.h objtool: Grow __cfi_* prefix symbols for all CFI+CALL_PADDING 2026-05-04 21:16:07 -07:00
cfi.h objtool: Allow stack operations in UNWIND_HINT_UNDEFINED regions 2023-06-07 10:03:11 -07:00
check.h objtool/klp: Fix position-dependent checksums for non-relocated jumps/calls 2026-05-04 21:16:06 -07:00
checksum_types.h objtool/klp: Add --checksum option to generate per-function checksums 2025-10-14 14:50:17 -07:00
checksum.h objtool/klp: Calculate object checksums 2026-05-04 21:16:06 -07:00
disas.h objtool: Add the --disas=<function-pattern> action 2025-11-21 15:30:12 +01:00
elf.h objtool: Grow __cfi_* prefix symbols for all CFI+CALL_PADDING 2026-05-04 21:16:07 -07:00
endianness.h objtool: Add annotype() helper 2025-10-14 14:46:49 -07:00
klp.h objtool/klp: Add "objtool klp checksum" subcommand 2026-05-04 21:16:05 -07:00
objtool.h objtool: Add more robust signal error handling, detect and warn about stack overflows 2025-12-03 19:42:37 +01:00
orc.h objtool/x86: Separate arch-specific and generic parts 2024-03-11 22:23:47 +08:00
special.h objtool: Add Function to get the name of a CPU feature 2025-11-24 20:39:47 +01:00
trace.h objtool: Improve tracing of alternative instructions 2025-11-21 15:30:11 +01:00
util.h objtool/klp: Introduce klp diff subcommand for diffing object files 2025-10-14 14:50:18 -07:00
warn.h objtool: Add insn_sym() helper 2026-05-04 21:16:06 -07:00