linux/tools/objtool/tests/generic
Song Liu 794b162b37 objtool/klp: Add test for a patch which strips a data annotation
klp diff needs entry boundaries for a special section: either an entsize,
or ANNOTATE_DATA_SPECIAL annotations naming where each entry starts.
.static_call_sites has no entsize, so the annotations are all there is --
and a patch can remove the last one in a translation unit while leaving the
section itself in place, so that only the patched side has lost them.

The section still has to be handled.  Dropping it leaves the patched
function's static call unregistered; misreading its boundaries attaches the
entry to the wrong code.  Neither is reported at build time.

Give the fixture a NO_ANNOTATE knob and assert the premise -- annotation
present in the original, absent in the patched object, section present in
both -- before asserting the result.

Fixed by commit 3de711fba7 ("objtool/klp: Fix create_fake_symbols()
skipping entsize-based sections").  Verified by making klp diff skip
.static_call_sites when cloning special sections: the test fails.

Assisted-by: Claude:claude-opus-4
Based-on-test-by: Joe Lawrence <joe.lawrence@redhat.com>
Assisted-by: Claude:claude-opus-5
Signed-off-by: Song Liu <song@kernel.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://patch.msgid.link/20260916184351.2720310-55-song@kernel.org
2026-09-21 11:12:07 +02:00
..
fixtures objtool/klp: Add test for the alignment of cloned data sections 2026-09-21 11:12:07 +02:00
test-basic.sh
test-changed-data.sh
test-checksum-data.sh objtool/klp: Add test for data object checksums 2026-09-21 11:12:07 +02:00
test-checksum-debug.sh objtool/klp: Add klp diff and post-link regression tests 2026-09-21 11:05:47 +02:00
test-checksum-insn.sh objtool/klp: Add test for instruction operand checksums 2026-09-21 11:12:07 +02:00
test-checksum-position.sh objtool/klp: Add test for position-independent checksums 2026-09-21 11:12:06 +02:00
test-checksum-skip.sh objtool/klp: Add test for symbols with no checksum entry of their own 2026-09-21 11:12:07 +02:00
test-checksum-value.sh objtool/klp: Add test for recorded checksum values 2026-09-21 11:12:06 +02:00
test-cold-function.sh objtool/klp: Add test for cold function halves 2026-09-21 11:02:54 +02:00
test-data-alignment.sh objtool/klp: Add test for the alignment of cloned data sections 2026-09-21 11:12:07 +02:00
test-export-symbol-for-modules.sh objtool/klp: Add test for EXPORT_SYMBOL_FOR_MODULES references 2026-09-21 11:12:06 +02:00
test-function-removal.sh objtool/klp: Add klp diff and post-link regression tests 2026-09-21 11:05:47 +02:00
test-init-reference.sh objtool/klp: Add test for rejecting references to init code/data 2026-09-21 11:05:20 +02:00
test-jump-label-exempt-keys.sh objtool/klp: Add test for tracepoint and pr_debug static branch keys 2026-09-21 11:12:07 +02:00
test-jump-label-key.sh objtool/klp: Add test for jump table key relocations 2026-09-21 11:04:50 +02:00
test-jump-label-module-key.sh objtool/klp: Add test for rejecting module-owned static branch keys 2026-09-21 11:04:58 +02:00
test-jump-label-module-static-key.sh objtool/klp: Test rejection of a file-local static branch key 2026-09-21 11:12:07 +02:00
test-jump-label-new-key.sh objtool/klp: Add test for a static branch introduced by the patch 2026-09-21 11:12:07 +02:00
test-klp-funcs-content.sh objtool/klp: Add test for the contents of the klp_funcs list 2026-09-21 11:12:06 +02:00
test-local-to-global-flip.sh objtool/klp: Add test for symbols whose linkage the patch changes 2026-09-21 11:12:07 +02:00
test-local-vs-export.sh objtool/klp: Add klp diff and post-link regression tests 2026-09-21 11:05:47 +02:00
test-missing-checksum.sh objtool/klp: Add test for unchecksummed input 2026-09-21 11:05:41 +02:00
test-missing-modinfo.sh objtool/klp: Add test for objects without .modinfo 2026-09-21 11:05:34 +02:00
test-modname-normalize.sh objtool/klp: Add test for Module.symvers path normalization 2026-09-21 11:12:06 +02:00
test-module-object.sh objtool/klp: Add test for klp reloc section naming in module objects 2026-09-21 11:06:08 +02:00
test-module-vmlinux-reloc.sh objtool/klp: Add test for vmlinux relocs in a patched module 2026-09-21 11:11:36 +02:00
test-new-data.sh objtool/klp: Add test for newly introduced data 2026-09-21 11:02:20 +02:00
test-new-export-ref.sh objtool/klp: Add test for new references to exported symbols 2026-09-21 11:12:06 +02:00
test-new-function.sh objtool/klp: Add test for newly introduced functions 2026-09-21 11:02:40 +02:00
test-post-link.sh objtool/klp: Add klp diff and post-link regression tests 2026-09-21 11:05:47 +02:00
test-special-section-shared.sh objtool/klp: Add test for selective special section extraction 2026-09-21 11:03:07 +02:00
test-special-section.sh objtool/klp: Add test for special section extraction 2026-09-21 11:03:00 +02:00
test-static-call-annotate-stripped.sh objtool/klp: Add test for a patch which strips a data annotation 2026-09-21 11:12:07 +02:00
test-static-call-module-key.sh objtool/klp: Add test for rejecting module-owned static call keys 2026-09-21 11:05:04 +02:00
test-static-call-new.sh objtool/klp: Add test for a static call introduced by the patch 2026-09-21 11:12:07 +02:00
test-static-local-uncorrelated.sh objtool/klp: Add test for static locals which must not be correlated 2026-09-21 11:12:06 +02:00
test-static-local.sh objtool/klp: Add test for static local correlation 2026-09-21 11:02:47 +02:00
test-symid-discarded.sh objtool/klp: Add test for symids in discarded sections 2026-09-21 11:05:13 +02:00
test-sympos-vmlinux.sh objtool/klp: Add test for sympos resolved against a linked vmlinux 2026-09-21 11:12:06 +02:00
test-sympos.sh objtool/klp: Add test for sympos in module objects 2026-09-21 11:12:06 +02:00
test-symvers-parse-error.sh objtool/klp: Add klp diff and post-link regression tests 2026-09-21 11:05:47 +02:00
test-thinlto-local.sh objtool/klp: Add test for correlation across ThinLTO name mangling 2026-09-21 11:05:27 +02:00