[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220624183238.388144-9-sv@linux.ibm.com>
Date: Sat, 25 Jun 2022 00:02:34 +0530
From: Sathvika Vasireddy <sv@...ux.ibm.com>
To: linuxppc-dev@...ts.ozlabs.org
Cc: jpoimboe@...hat.com, peterz@...radead.org,
linux-kernel@...r.kernel.org, aik@...abs.ru, mpe@...erman.id.au,
christophe.leroy@...roup.eu, mingo@...hat.com, rostedt@...dmis.org,
naveen.n.rao@...ux.vnet.ibm.com, sv@...ux.ibm.com, mbenes@...e.cz,
benh@...nel.crashing.org, paulus@...ba.org
Subject: [RFC PATCH v3 08/12] objtool: Add arch specific function arch_ftrace_match()
Add architecture specific function to look for
relocation records pointing to arch specific
symbols.
Suggested-by: Christophe Leroy <christophe.leroy@...roup.eu>
Signed-off-by: Sathvika Vasireddy <sv@...ux.ibm.com>
---
tools/objtool/arch/x86/decode.c | 8 ++++++++
tools/objtool/check.c | 2 +-
tools/objtool/include/objtool/arch.h | 2 ++
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/tools/objtool/arch/x86/decode.c b/tools/objtool/arch/x86/decode.c
index 8b990a52aada..6a66b0c0dd2c 100644
--- a/tools/objtool/arch/x86/decode.c
+++ b/tools/objtool/arch/x86/decode.c
@@ -23,6 +23,14 @@
#include <objtool/builtin.h>
#include <arch/elf.h>
+bool arch_ftrace_match(char *name)
+{
+ if (!strcmp(func->name, "__fentry__"))
+ return true;
+
+ return false;
+}
+
static int is_x86_64(const struct elf *elf)
{
switch (elf->ehdr.e_machine) {
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 88f68269860e..51b6dcec8d6a 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -2185,7 +2185,7 @@ static int classify_symbols(struct objtool_file *file)
if (arch_is_retpoline(func))
func->retpoline_thunk = true;
- if (!strcmp(func->name, "__fentry__"))
+ if (arch_ftrace_match(func->name))
func->fentry = true;
if (is_profiling_func(func->name))
diff --git a/tools/objtool/include/objtool/arch.h b/tools/objtool/include/objtool/arch.h
index 9b19cc304195..99d0c8ba1b69 100644
--- a/tools/objtool/include/objtool/arch.h
+++ b/tools/objtool/include/objtool/arch.h
@@ -69,6 +69,8 @@ struct stack_op {
struct instruction;
+bool arch_ftrace_match(char *name);
+
void arch_initial_func_cfi_state(struct cfi_init_state *state);
int arch_decode_instruction(struct objtool_file *file, const struct section *sec,
--
2.25.1
Powered by blists - more mailing lists