Re: [PATCH v3 55/58] objtool/klp: Add test for absolute and __ADDRESSABLE symbols
From: sashiko-bot@kernel.org
Date: 2026-09-15 00:53:19
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] objtool: test suite build failure on 32-bit architectures due to .quad -- commit 8413836c45f39cb1efbf4a2f69693cc56d13f861 Author: Song Liu [off-list ref] objtool/klp: Add test for absolute and __ADDRESSABLE symbols This commit adds a test fixture and script to ensure that objtool's livepatching features correctly handle absolute symbols and __ADDRESSABLE pointers without failing or crashing. It uses inline assembly to emit these structures for the test framework.
quoted hunk ↗ jump to hunk
diff --git a/tools/objtool/tests/generic/fixtures/abs_and_addressable.c b/tools/objtool/tests/generic/fixtures/abs_and_addressable.c new file mode 100644 index 0000000000000..6392ff99af421 --- /dev/null +++ b/tools/objtool/tests/generic/fixtures/abs_and_addressable.c
[ ... ]
+int helper(int x);
+int helper(int x) { return x + 1; }
+
+/* The shape of __ADDRESSABLE(helper). */
+__asm__(".pushsection .discard.addressable, \"aw\"\n"
+ ".balign 8\n"
+ ".quad helper\n"[Severity: Medium] Does using ".quad" here cause a build failure on 32-bit architectures? When running the generic klp test suite on a 32-bit host (like 32-bit x86), the assembler cannot emit a 64-bit absolute relocation for a symbol and fails with an error like "cannot represent relocation type BFD_RELOC_64". Would using a pointer-sized assembly directive instead of hardcoding a 64-bit directive prevent this from causing a hard failure in build_one() when running `make tests` on 32-bit targets?
+ ".popsection\n"); + +int target(int x)
[ ... ] -- Sashiko AI review · https://sashiko.dev/#/patchset/20260914230355.3422996-1-song@kernel.org?part=55