mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] objtool: Fix validate_branch() return codes
@ 2017-08-10 21:37 Josh Poimboeuf
  2017-08-10 21:37 ` [PATCH 2/2] objtool: Track DRAP separately from callee-saved registers Josh Poimboeuf
  2017-08-11 12:13 ` [tip:x86/asm] objtool: Fix validate_branch() return codes tip-bot for Josh Poimboeuf
  0 siblings, 2 replies; 8+ messages in thread
From: Josh Poimboeuf @ 2017-08-10 21:37 UTC (permalink / raw)
  To: x86; +Cc: linux-kernel, Arnd Bergmann

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.

Fixes: baa41469a7b9 ("objtool: Implement stack validation 2.0")
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
---
 tools/objtool/check.c | 6 +++---
 1 file 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;
 
-- 
2.13.3

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-08-11 17:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-10 21:37 [PATCH 1/2] objtool: Fix validate_branch() return codes Josh Poimboeuf
2017-08-10 21:37 ` [PATCH 2/2] objtool: Track DRAP separately from callee-saved registers Josh Poimboeuf
2017-08-11 12:13   ` [tip:x86/asm] " tip-bot for Josh Poimboeuf
2017-08-11 16:22     ` Andy Lutomirski
2017-08-11 16:26       ` Linus Torvalds
2017-08-11 16:57       ` Josh Poimboeuf
2017-08-11 17:17         ` hpa
2017-08-11 12:13 ` [tip:x86/asm] objtool: Fix validate_branch() return codes tip-bot for Josh Poimboeuf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome