mirror-linux/tools/objtool
Josh Poimboeuf ebe864b553 objtool/klp: Add post-link subcommand to finalize livepatch modules
Livepatch needs some ELF magic which linkers don't like:

  - Two relocation sections (.rela*, .klp.rela*) for the same text
    section.

  - Use of SHN_LIVEPATCH to mark livepatch symbols.

Unfortunately linkers tend to mangle such things.  To work around that,
klp diff generates a linker-compliant intermediate binary which encodes
the relevant KLP section/reloc/symbol metadata.

After module linking, the .ko then needs to be converted to an actual
livepatch module.  Introduce a new klp post-link subcommand to do so.

Acked-by: Petr Mladek <pmladek@suse.com>
Tested-by: Joe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
2025-10-14 14:50:18 -07:00
..
Documentation objtool: Fix up some outdated references to ENTRY/ENDPROC 2025-03-25 09:20:27 +01:00
arch objtool/klp: Introduce klp diff subcommand for diffing object files 2025-10-14 14:50:18 -07:00
include/objtool objtool/klp: Add post-link subcommand to finalize livepatch modules 2025-10-14 14:50:18 -07:00
.gitignore objtool: Install libsubcmd in build 2023-01-30 16:27:46 -08:00
Build objtool/klp: Add post-link subcommand to finalize livepatch modules 2025-10-14 14:50:18 -07:00
Makefile objtool/klp: Introduce klp diff subcommand for diffing object files 2025-10-14 14:50:18 -07:00
builtin-check.c objtool/klp: Add --debug-checksum=<funcs> to show per-instruction checksums 2025-10-14 14:50:18 -07:00
builtin-klp.c objtool/klp: Add post-link subcommand to finalize livepatch modules 2025-10-14 14:50:18 -07:00
check.c objtool/klp: Introduce klp diff subcommand for diffing object files 2025-10-14 14:50:18 -07:00
elf.c objtool/klp: Introduce klp diff subcommand for diffing object files 2025-10-14 14:50:18 -07:00
klp-diff.c objtool/klp: Add --debug option to show cloning decisions 2025-10-14 14:50:18 -07:00
klp-post-link.c objtool/klp: Add post-link subcommand to finalize livepatch modules 2025-10-14 14:50:18 -07:00
noreturns.h x86/sev: Zap snp_abort() 2025-09-04 13:15:59 +02:00
objtool.c objtool/klp: Add --debug option to show cloning decisions 2025-10-14 14:50:18 -07:00
orc_dump.c objtool: Add annotype() helper 2025-10-14 14:46:49 -07:00
orc_gen.c objtool: Add annotype() helper 2025-10-14 14:46:49 -07:00
special.c objtool: Add annotype() helper 2025-10-14 14:46:49 -07:00
sync-check.sh objtool/klp: Introduce klp diff subcommand for diffing object files 2025-10-14 14:50:18 -07:00
weak.c objtool/klp: Introduce klp diff subcommand for diffing object files 2025-10-14 14:50:18 -07:00