diff options
author | Josh Poimboeuf <[email protected]> | 2017-08-10 16:37:25 -0500 |
---|---|---|
committer | Ingo Molnar <[email protected]> | 2017-08-11 14:06:14 +0200 |
commit | 12b25729a194198e3c4289adaddc4115b10b094e (patch) | |
tree | fc39c0dd9935d7254cd1c004542fd19da27c6696 | |
parent | 01651324edad9db4fe49fb39b905c76861649b4c (diff) |
objtool: Fix validate_branch() return codes
The validate_branch() function should never return a negative value.
Errors are treated as warnings so that even if something goes wrong,
objtool does its best to generate ORC data for the rest of the file.
Signed-off-by: Josh Poimboeuf <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Brian Gerst <[email protected]>
Cc: Denys Vlasenko <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Fixes: baa41469a7b9 ("objtool: Implement stack validation 2.0")
Link: http://lkml.kernel.org/r/d86671cfde823b50477cd2f6f548dfe54871e24d.1502401017.git.jpoimboe@redhat.com
Signed-off-by: Ingo Molnar <[email protected]>
-rw-r--r-- | tools/objtool/check.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 4f0c4aea8f6f..5814e907f8c2 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -1524,7 +1524,7 @@ static int validate_branch(struct objtool_file *file, struct instruction *first, if (insn->alt_group && list_empty(&insn->alts)) { WARN_FUNC("don't know how to handle branch to middle of alternative instruction group", sec, insn->offset); - return -1; + return 1; } while (1) { @@ -1543,7 +1543,7 @@ static int validate_branch(struct objtool_file *file, struct instruction *first, if (func && insn->ignore) { WARN_FUNC("BUG: why am I validating an ignored function?", sec, insn->offset); - return -1; + return 1; } if (insn->visited) { @@ -1681,7 +1681,7 @@ static int validate_branch(struct objtool_file *file, struct instruction *first, case INSN_STACK: if (update_insn_state(insn, &state)) - return -1; + return 1; break; |