Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

objtool: Add arch specific function arch_ftrace_match()

Add architecture specific function to look for relocation records
pointing to architecture specific symbols.

Suggested-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Tested-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Reviewed-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Sathvika Vasireddy <sv@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20221114175754.1131267-15-sv@linux.ibm.com

authored by

Sathvika Vasireddy and committed by
Michael Ellerman
4ca993d4 c1449735

+8 -1
+5
tools/objtool/arch/x86/decode.c
··· 23 23 #include <objtool/builtin.h> 24 24 #include <arch/elf.h> 25 25 26 + int arch_ftrace_match(char *name) 27 + { 28 + return !strcmp(name, "__fentry__"); 29 + } 30 + 26 31 static int is_x86_64(const struct elf *elf) 27 32 { 28 33 switch (elf->ehdr.e_machine) {
+1 -1
tools/objtool/check.c
··· 2316 2316 if (arch_is_rethunk(func)) 2317 2317 func->return_thunk = true; 2318 2318 2319 - if (!strcmp(func->name, "__fentry__")) 2319 + if (arch_ftrace_match(func->name)) 2320 2320 func->fentry = true; 2321 2321 2322 2322 if (is_profiling_func(func->name))
+2
tools/objtool/include/objtool/arch.h
··· 69 69 70 70 struct instruction; 71 71 72 + int arch_ftrace_match(char *name); 73 + 72 74 void arch_initial_func_cfi_state(struct cfi_init_state *state); 73 75 74 76 int arch_decode_instruction(struct objtool_file *file, const struct section *sec,