From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753167AbdHJVhj (ORCPT ); Thu, 10 Aug 2017 17:37:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50820 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751487AbdHJVhi (ORCPT ); Thu, 10 Aug 2017 17:37:38 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BAEBC6147B Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jpoimboe@redhat.com From: Josh Poimboeuf To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Arnd Bergmann Subject: [PATCH 1/2] objtool: Fix validate_branch() return codes Date: Thu, 10 Aug 2017 16:37:25 -0500 Message-Id: X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 10 Aug 2017 21:37:38 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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