summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Lawrence <joe.lawrence@redhat.com>2026-03-25 00:34:16 +0300
committerJosh Poimboeuf <jpoimboe@kernel.org>2026-05-05 07:16:00 +0300
commit3de711fba73ad93b8b3fbe09cf681cefed5d573d (patch)
tree95c49f29a1a9af4fd0a29e59bdcd02ebb248162e
parente872b3f13922ecd746f907e20261dfc11c9a9f28 (diff)
downloadlinux-3de711fba73ad93b8b3fbe09cf681cefed5d573d.tar.xz
objtool/klp: Fix create_fake_symbols() skipping entsize-based sections
create_fake_symbols() has two phases: creating symbols from ANNOTATE_DATA_SPECIAL entries, and a fallback that uses sh_entsize for special sections like .static_call_sites. When .discard.annotate_data is absent, the function returns early, skipping the entsize fallback and silently allowing unsupported module-local static call keys through. Fix it by jumping to the entsize phase instead of returning early. Fixes: dd590d4d57eb ("objtool/klp: Introduce klp diff subcommand for diffing object files") Assisted-by: Claude:claude-4-opus Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com> Acked-by: Song Liu <song@kernel.org> Reviewed-by: Miroslav Benes <mbenes@suse.cz> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
-rw-r--r--tools/objtool/klp-diff.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/objtool/klp-diff.c b/tools/objtool/klp-diff.c
index c5d4c9ed8580..0653bf6a33bd 100644
--- a/tools/objtool/klp-diff.c
+++ b/tools/objtool/klp-diff.c
@@ -1374,7 +1374,7 @@ static int create_fake_symbols(struct elf *elf)
sec = find_section_by_name(elf, ".discard.annotate_data");
if (!sec || !sec->rsec)
- return 0;
+ goto entsize;
for_each_reloc(sec->rsec, reloc) {
unsigned long offset, size;
@@ -1406,7 +1406,7 @@ static int create_fake_symbols(struct elf *elf)
/*
* 2) Make symbols for sh_entsize, and simple arrays of pointers:
*/
-
+entsize:
for_each_sec(elf, sec) {
unsigned int entry_size;
unsigned long offset;