diff options
| author | 2021-02-15 06:41:56 +0200 | |
|---|---|---|
| committer | 2021-02-15 06:41:56 +0200 | |
| commit | 857de6fe2f86b009df620f7cdb07c262cc17070d (patch) | |
| tree | e9718ebeeef39485a51a9f8e3c8122da18c796cf /tools/objtool/elf.c | |
| parent | ARM: dts: am33xx: add aliases for mmc interfaces (diff) | |
| parent | ARM: OMAP2+: Fix smartreflex init regression after dropping legacy data (diff) | |
Merge branch 'fixes-v5.11' into fixes
Diffstat (limited to 'tools/objtool/elf.c')
| -rw-r--r-- | tools/objtool/elf.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c index be89c741ba9a..d8421e1d06be 100644 --- a/tools/objtool/elf.c +++ b/tools/objtool/elf.c @@ -380,8 +380,11 @@ static int read_symbols(struct elf *elf) symtab = find_section_by_name(elf, ".symtab"); if (!symtab) { - WARN("missing symbol table"); - return -1; + /* + * A missing symbol table is actually possible if it's an empty + * .o file. This can happen for thunk_64.o. + */ + return 0; } symtab_shndx = find_section_by_name(elf, ".symtab_shndx"); @@ -448,6 +451,13 @@ static int read_symbols(struct elf *elf) list_add(&sym->list, entry); elf_hash_add(elf->symbol_hash, &sym->hash, sym->idx); elf_hash_add(elf->symbol_name_hash, &sym->name_hash, str_hash(sym->name)); + + /* + * Don't store empty STT_NOTYPE symbols in the rbtree. They + * can exist within a function, confusing the sorting. + */ + if (!sym->len) + rb_erase(&sym->node, &sym->sec->symbol_tree); } if (stats) |
