linux/tools/objtool/tests/generic
Song Liu 8abe5c94bf objtool/klp: Add test for the alignment of cloned data sections
A cloned data section has to keep its sh_addralign.  Plenty of kernel data
is aligned for correctness rather than speed -- per-CPU variables, anything
touched by an aligned vector move, structures padded to own a cacheline --
and a clone that lands under-aligned either faults on first use or silently
shares a line it was laid out to avoid.  Neither shows up until the patch
is loaded on hardware that cares.

The fixture's data is new in the patched build, so klp diff has to clone it
rather than reference the kernel's copy, and it asserts that premise before
asserting the result.

Commit 2f2600decb ("objtool/klp: fix data alignment in __clone_symbol()")
cannot be reverted to check this -- the revert is a no-op against the
current code, which has been rewritten since.  Verified instead by forcing
the clone's alignment to 1, which the test reports as "alignment 1,
expected 64".

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-54-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-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