summaryrefslogtreecommitdiff
path: root/tools/objtool/check.c
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2021-03-26 16:12:04 +0100
committerIngo Molnar <mingo@kernel.org>2021-04-02 12:43:02 +0200
commit530b4ddd9dd92b263081f5c7786d39a8129c8b2d (patch)
tree668abefc52613ad44949bbf1233b098b1e19a0f4 /tools/objtool/check.c
parentbcb1b6ff39da7e8a6a986eb08126fba2b5e13c32 (diff)
objtool: Handle per arch retpoline naming
The __x86_indirect_ naming is obviously not generic. Shorten to allow matching some additional magic names later. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Borislav Petkov <bp@suse.de> Signed-off-by: Ingo Molnar <mingo@kernel.org> Reviewed-by: Miroslav Benes <mbenes@suse.cz> Link: https://lkml.kernel.org/r/20210326151259.630296706@infradead.org
Diffstat (limited to 'tools/objtool/check.c')
-rw-r--r--tools/objtool/check.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 519af4be7018..6fbc00122d27 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -850,6 +850,11 @@ static int add_ignore_alternatives(struct objtool_file *file)
return 0;
}
+__weak bool arch_is_retpoline(struct symbol *sym)
+{
+ return false;
+}
+
/*
* Find the destination instructions for all jumps.
*/
@@ -872,7 +877,7 @@ static int add_jump_destinations(struct objtool_file *file)
} else if (reloc->sym->type == STT_SECTION) {
dest_sec = reloc->sym->sec;
dest_off = arch_dest_reloc_offset(reloc->addend);
- } else if (!strncmp(reloc->sym->name, "__x86_indirect_thunk_", 21)) {
+ } else if (arch_is_retpoline(reloc->sym)) {
/*
* Retpoline jumps are really dynamic jumps in
* disguise, so convert them accordingly.
@@ -1026,7 +1031,7 @@ static int add_call_destinations(struct objtool_file *file)
return -1;
}
- } else if (!strncmp(reloc->sym->name, "__x86_indirect_thunk_", 21)) {
+ } else if (arch_is_retpoline(reloc->sym)) {
/*
* Retpoline calls are really dynamic calls in
* disguise, so convert them accordingly.