diff options
author | Josh Poimboeuf <jpoimboe@redhat.com> | 2020-02-17 21:41:54 -0600 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2020-02-21 10:20:34 +0100 |
commit | 7acfe5315312fc56c2a94c9216448087b38ae909 (patch) | |
tree | e3187f3209664e907dabf0fa7a0151d1a82e487f /tools/objtool/elf.h | |
parent | 113d4bc9048336ba7c3d2ad972dbad4aef6e148a (diff) | |
download | linux-7acfe5315312fc56c2a94c9216448087b38ae909.tar.bz2 |
objtool: Improve call destination function detection
A recent clang change, combined with a binutils bug, can trigger a
situation where a ".Lprintk$local" STT_NOTYPE symbol gets created at the
same offset as the "printk" STT_FUNC symbol. This confuses objtool:
kernel/printk/printk.o: warning: objtool: ignore_loglevel_setup()+0x10: can't find call dest symbol at .text+0xc67
Improve the call destination detection by looking specifically for an
STT_FUNC symbol.
Reported-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
Link: https://github.com/ClangBuiltLinux/linux/issues/872
Link: https://sourceware.org/bugzilla/show_bug.cgi?id=25551
Link: https://lkml.kernel.org/r/0a7ee320bc0ea4469bd3dc450a7b4725669e0ea9.1581997059.git.jpoimboe@redhat.com
Diffstat (limited to 'tools/objtool/elf.h')
-rw-r--r-- | tools/objtool/elf.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/objtool/elf.h b/tools/objtool/elf.h index 44150204db4d..a1963259b930 100644 --- a/tools/objtool/elf.h +++ b/tools/objtool/elf.h @@ -77,6 +77,7 @@ struct elf { struct elf *elf_read(const char *name, int flags); struct section *find_section_by_name(struct elf *elf, const char *name); +struct symbol *find_func_by_offset(struct section *sec, unsigned long offset); struct symbol *find_symbol_by_offset(struct section *sec, unsigned long offset); struct symbol *find_symbol_by_name(struct elf *elf, const char *name); struct symbol *find_symbol_containing(struct section *sec, unsigned long offset); |