Skip to content

Commit 4ca993d

Browse files
sathvika-vmpe
authored andcommitted
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 <[email protected]> Tested-by: Naveen N. Rao <[email protected]> Reviewed-by: Naveen N. Rao <[email protected]> Reviewed-by: Christophe Leroy <[email protected]> Acked-by: Josh Poimboeuf <[email protected]> Signed-off-by: Sathvika Vasireddy <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent c144973 commit 4ca993d

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

tools/objtool/arch/x86/decode.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
#include <objtool/builtin.h>
2424
#include <arch/elf.h>
2525

26+
int arch_ftrace_match(char *name)
27+
{
28+
return !strcmp(name, "__fentry__");
29+
}
30+
2631
static int is_x86_64(const struct elf *elf)
2732
{
2833
switch (elf->ehdr.e_machine) {

tools/objtool/check.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2316,7 +2316,7 @@ static int classify_symbols(struct objtool_file *file)
23162316
if (arch_is_rethunk(func))
23172317
func->return_thunk = true;
23182318

2319-
if (!strcmp(func->name, "__fentry__"))
2319+
if (arch_ftrace_match(func->name))
23202320
func->fentry = true;
23212321

23222322
if (is_profiling_func(func->name))

tools/objtool/include/objtool/arch.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ struct stack_op {
6969

7070
struct instruction;
7171

72+
int arch_ftrace_match(char *name);
73+
7274
void arch_initial_func_cfi_state(struct cfi_init_state *state);
7375

7476
int arch_decode_instruction(struct objtool_file *file, const struct section *sec,

0 commit comments

Comments
 (0)