summaryrefslogtreecommitdiff
path: root/tools/objtool/elf.h
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@redhat.com>2020-02-18 06:41:54 +0300
committerBorislav Petkov <bp@suse.de>2020-02-21 12:20:34 +0300
commit7acfe5315312fc56c2a94c9216448087b38ae909 (patch)
treee3187f3209664e907dabf0fa7a0151d1a82e487f /tools/objtool/elf.h
parent113d4bc9048336ba7c3d2ad972dbad4aef6e148a (diff)
downloadlinux-7acfe5315312fc56c2a94c9216448087b38ae909.tar.xz
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.h1
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);