Re: [PATCH v2 32/58] objtool/klp: Add test for EXPORT_SYMBOL_FOR_MODULES references
From: sashiko-bot@kernel.org
Date: 2026-09-14 06:45:10
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] The test script claims to cover commit d8a2860b4a36 but fails to exercise its logic because it patches vmlinux instead of a module. -- commit 0018f6f310cd6d22138d9d2b74d24fb1f9be4ab3 Author: Song Liu [off-list ref] objtool/klp: Add test for EXPORT_SYMBOL_FOR_MODULES references This commit adds a test script to verify klp relocations for symbols exported with EXPORT_SYMBOL_FOR_MODULES(). The test aims to cover the behavior of previous fixes related to klp relocation section naming.
quoted hunk ↗ jump to hunk
diff --git a/tools/objtool/tests/generic/test-export-symbol-for-modules.sh b/tools/objtool/tests/generic/test-export-symbol-for-modules.sh new file mode 100755 index 0000000000000..7e7bdde6a7aca --- /dev/null +++ b/tools/objtool/tests/generic/test-export-symbol-for-modules.sh@@ -0,0 +1,39 @@ +#!/bin/bash
[ ... ]
+. "$(dirname "$0")/../lib.sh" + +setup +build_pair cross_module.c
[Severity: Medium] Does this test actually exercise the module-patching case fixed in d8a2860b4a36? By calling build_pair without a -DMODNAME flag, the test fixture defaults to patching vmlinux. Because the patched object is vmlinux, the __klp_relocs.vmlinux section is generated regardless of the logic introduced in d8a2860b4a36. That commit forces the section to vmlinux when the target is a vmlinux symbol, overriding the patched module's name. As a result of patching vmlinux directly here, the test appears to pass even without the fix it claims to cover. Should this test pass a module name to build_pair to properly test the module relocation behavior?
+ +sym=other_mod_func
[ ... ] -- Sashiko AI review · https://sashiko.dev/#/patchset/20260914062514.926997-1-song@kernel.org?part=32