diff options
| author | Josh Poimboeuf <jpoimboe@kernel.org> | 2026-03-30 21:50:46 -0700 |
|---|---|---|
| committer | Josh Poimboeuf <jpoimboe@kernel.org> | 2026-05-04 21:16:04 -0700 |
| commit | 9e4512d7de5ab27c1b0c3891f7a0e9202a5a2eef (patch) | |
| tree | 0f01dc9e0560ef03b39156e40fd3f664b02919ef /tools/objtool | |
| parent | ac999926774a71e30c2e2e2eb48d5419dc167781 (diff) | |
| download | linux-next-9e4512d7de5ab27c1b0c3891f7a0e9202a5a2eef.tar.gz linux-next-9e4512d7de5ab27c1b0c3891f7a0e9202a5a2eef.zip | |
objtool/klp: Create empty checksum sections for function-less object files
If an object file has no functions, objtool has nothing to checksum, so
it doesn't create the .discard.sym_checksum symbol.
Then when 'objtool klp diff' reads symbol checksums, it errors out due
to the missing .discard.sym_checksum section.
Instead, just create an empty checksum section to signal to
read_sym_checksums() that the file has been processed.
Acked-by: Song Liu <song@kernel.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Diffstat (limited to 'tools/objtool')
| -rw-r--r-- | tools/objtool/check.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c index e7579c4e46dc..f020f21f94a7 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -1044,9 +1044,6 @@ static int create_sym_checksum_section(struct objtool_file *file) if (sym->csum.checksum) idx++; - if (!idx) - return 0; - sec = elf_create_section_pair(file->elf, ".discard.sym_checksum", entsize, idx, idx); if (!sec) |
