[Devel] [PATCH hci-8.2 v2 09/18] ms/objtool/klp: Fix relocation conversion failures for R_X86_64_NONE
Eva Kurchatova
eva.kurchatova at virtuozzo.com
Wed Nov 25 09:03:51 MSK 2026
From: Josh Poimboeuf <jpoimboe at kernel.org>
Objtool has some hacks which NOP out certain calls/jumps and replace
their relocations with R_X86_64_NONE. The klp-diff relocation
extraction code will error out when trying to copy these relocations due
to their negative addend, which would only makes sense for a PC-relative
branch instruction. Just ignore them.
Fixes: dd590d4d57eb ("objtool/klp: Introduce klp diff subcommand for diffing object files")
Acked-by: Song Liu <song at kernel.org>
Reviewed-by: Miroslav Benes <mbenes at suse.cz>
Signed-off-by: Josh Poimboeuf <jpoimboe at kernel.org>
(cherry picked from commit 3787e82a4e3a0a04aeb5543580ee90bed3a36e55)
https://virtuozzo.atlassian.net/browse/VSTOR-128510
Feature: klp-build support
Signed-off-by: Eva Kurchatova <eva.kurchatova at virtuozzo.com>
Reviewed-by: Sashiko <no-reply at sashiko.virtuozzo.com>
---
tools/objtool/klp-diff.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/objtool/klp-diff.c b/tools/objtool/klp-diff.c
index 817db8540c8b..941be5829ce7 100644
--- a/tools/objtool/klp-diff.c
+++ b/tools/objtool/klp-diff.c
@@ -891,6 +891,9 @@ static int convert_reloc_secsym_to_sym(struct elf *elf, struct reloc *reloc)
*/
static int convert_reloc_sym(struct elf *elf, struct reloc *reloc)
{
+ if (reloc_type(reloc) == R_NONE)
+ return 1;
+
if (is_reloc_allowed(reloc))
return 0;
--
2.56.1
More information about the Devel
mailing list