diff options
| author | Ingo Molnar <mingo@kernel.org> | 2021-02-17 14:04:39 +0100 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2021-02-17 14:04:39 +0100 |
| commit | ed3cd45f8ca873dd320ff7e6b4c1c8f83a65302c (patch) | |
| tree | 783a02c1e78964654fe6d9a9c14b24bfc50e6b3b /tools/objtool/elf.c | |
| parent | sched/fair: Move avg_scan_cost calculations under SIS_PROP (diff) | |
| parent | Linux 5.11 (diff) | |
| download | linux-ed3cd45f8ca873dd320ff7e6b4c1c8f83a65302c.tar.gz linux-ed3cd45f8ca873dd320ff7e6b4c1c8f83a65302c.zip | |
Merge tag 'v5.11' into sched/core, to pick up fixes & refresh the branch
Signed-off-by: Ingo Molnar <mingo@kernel.org>
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) |
