From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754736AbeARPKA (ORCPT ); Thu, 18 Jan 2018 10:10:00 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:38079 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754691AbeARO56 (ORCPT ); Thu, 18 Jan 2018 09:57:58 -0500 Message-Id: <20180118140152.595652638@infradead.org> User-Agent: quilt/0.63-1 Date: Thu, 18 Jan 2018 14:48:19 +0100 From: Peter Zijlstra From: Peter Zijlstra To: David Woodhouse , Thomas Gleixner , Josh Poimboeuf Cc: linux-kernel@vger.kernel.org, Dave Hansen , Ashok Raj , Tim Chen , Andy Lutomirski , Linus Torvalds , Greg KH , Andrea Arcangeli , Andi Kleen , Arjan Van De Ven , Dan Williams , Paolo Bonzini , Jun Nakajima , Asit Mallick , Jason Baron , Peter Zijlstra Subject: [PATCH 19/35] objtool: Skip static assert when KCOV/KASAN References: <20180118134800.711245485@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline; filename=peterz-objtool-no-assert.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org They make an absolutely horrid mess of things. Signed-off-by: Peter Zijlstra (Intel) --- scripts/Makefile.build | 9 +++++++++ tools/objtool/builtin-check.c | 3 ++- tools/objtool/builtin.h | 2 +- tools/objtool/check.c | 3 +++ 4 files changed, 15 insertions(+), 2 deletions(-) --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -274,6 +274,15 @@ ifneq ($(RETPOLINE_CFLAGS),) objtool_args += --retpoline endif endif +ifdef CONFIG_KCOV + objtool_no_assert := 1 +endif +ifdef CONFIG_KASAN + objtool_no_assert := 1 +endif +ifdef objtool_no_assert + objtool_args += --no-static-assert +endif ifdef CONFIG_MODVERSIONS --- a/tools/objtool/builtin-check.c +++ b/tools/objtool/builtin-check.c @@ -29,7 +29,7 @@ #include "builtin.h" #include "check.h" -bool no_fp, no_unreachable, retpoline; +bool no_fp, no_unreachable, retpoline, no_assert; static const char * const check_usage[] = { "objtool check [] file.o", @@ -40,6 +40,7 @@ const struct option check_options[] = { OPT_BOOLEAN('f', "no-fp", &no_fp, "Skip frame pointer validation"), OPT_BOOLEAN('u', "no-unreachable", &no_unreachable, "Skip 'unreachable instruction' warnings"), OPT_BOOLEAN('r', "retpoline", &retpoline, "Validate retpoline assumptions"), + OPT_BOOLEAN('s', "no-static-assert", &no_assert, "Skip static branch validation"), OPT_END(), }; --- a/tools/objtool/builtin.h +++ b/tools/objtool/builtin.h @@ -20,7 +20,7 @@ #include extern const struct option check_options[]; -extern bool no_fp, no_unreachable, retpoline; +extern bool no_fp, no_unreachable, retpoline, no_assert; extern int cmd_check(int argc, const char **argv); extern int cmd_orc(int argc, const char **argv); --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -1122,6 +1122,9 @@ static int assert_static_jumps(struct ob struct rela *rela; int i; + if (no_assert) + return 0; + sec = find_section_by_name(file->elf, ".discard.jump_assert"); if (!sec) return 0;