linux/tools/objtool/tests/generic
Song Liu 945537271d objtool/klp: Add test for ThinLTO symbols sharing a demangled name
A file-local symbol which ThinLTO has to make visible is renamed
helper.llvm.<hash>.  With two such helpers in one link, the original and
the patched object hold two each, all four spelled differently, and
demangling gives "helper" for every one of them -- so the name alone cannot
say which corresponds to which.

Three translation units, two with a static helper of the same name and a
third calling into both, which is what forces the promotion.  Only one
helper changes: paired correctly that means exactly one is cloned, and
paired the wrong way round the other is, or both are.  Had both bodies
changed, both would be cloned either way and the test would prove nothing
-- which is how the first version of this was written.

The outcome is asserted, not the machinery.  With the clang tested here the
pairing survives disabling the .llvm.<hash> suffix map and stubbing out
llvm_suffix() entirely, so no single-line sabotage distinguishes it; the
tiered matcher this case was written for is not needed for this shape.  The
test says so rather than implying otherwise.

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-59-song@kernel.org
2026-09-21 11:12:08 +02:00
..
fixtures objtool/klp: Add test for ThinLTO symbols sharing a demangled name 2026-09-21 11:12:08 +02:00
test-abs-and-addressable.sh objtool/klp: Add test for absolute and __ADDRESSABLE symbols 2026-09-21 11:12:08 +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-switch-rodata.sh objtool/klp: Add test for Clang switch jump tables 2026-09-21 11:12:08 +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-ambiguity.sh objtool/klp: Add test for ThinLTO symbols sharing a demangled name 2026-09-21 11:12:08 +02:00
test-thinlto-local.sh objtool/klp: Add test for correlation across ThinLTO name mangling 2026-09-21 11:05:27 +02:00
test-ubsan-noise.sh objtool/klp: Add test for UBSAN metadata in an unchanged function 2026-09-21 11:12:08 +02:00