Skip to content

Commit 1d48915

Browse files
committed
objtool: Don't fail on missing symbol table
Thanks to a recent binutils change which doesn't generate unused symbols, it's now possible for thunk_64.o be completely empty without CONFIG_PREEMPTION: no text, no data, no symbols. We could edit the Makefile to only build that file when CONFIG_PREEMPTION is enabled, but that will likely create confusion if/when the thunks end up getting used by some other code again. Just ignore it and move on. Reported-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Reviewed-by: Miroslav Benes <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Link: ClangBuiltLinux#1254 Signed-off-by: Josh Poimboeuf <[email protected]>
1 parent 655cf86 commit 1d48915

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tools/objtool/elf.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,11 @@ static int read_symbols(struct elf *elf)
380380

381381
symtab = find_section_by_name(elf, ".symtab");
382382
if (!symtab) {
383-
WARN("missing symbol table");
384-
return -1;
383+
/*
384+
* A missing symbol table is actually possible if it's an empty
385+
* .o file. This can happen for thunk_64.o.
386+
*/
387+
return 0;
385388
}
386389

387390
symtab_shndx = find_section_by_name(elf, ".symtab_shndx");

0 commit comments

Comments
 (0)