summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/objtool/check.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 2f80aa511243..fea222192c57 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -100,6 +100,7 @@ static bool gcov_enabled(struct objtool_file *file)
static bool ignore_func(struct objtool_file *file, struct symbol *func)
{
struct rela *rela;
+ struct instruction *insn;
/* check for STACK_FRAME_NON_STANDARD */
if (file->whitelist && file->whitelist->rela)
@@ -112,6 +113,11 @@ static bool ignore_func(struct objtool_file *file, struct symbol *func)
return true;
}
+ /* check if it has a context switching instruction */
+ func_for_each_insn(file, func, insn)
+ if (insn->type == INSN_CONTEXT_SWITCH)
+ return true;
+
return false;
}
@@ -1446,14 +1452,6 @@ static int validate_branch(struct objtool_file *file, struct instruction *first,
return 0;
- case INSN_CONTEXT_SWITCH:
- if (func) {
- WARN_FUNC("unsupported instruction in callable function",
- sec, insn->offset);
- return 1;
- }
- return 0;
-
case INSN_STACK:
if (update_insn_state(insn, &state))
return -1;