From patchwork Thu Feb 2 07:40:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhavan T. Venkataraman" X-Patchwork-Id: 13125452 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C0657C05027 for ; Thu, 2 Feb 2023 07:45:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lWrcKFp1RC52LrksMe48pL6JLzMXttMtROwKzUeqMek=; b=beVk6fkqltvmMo fW6x4GaaTdvuomz2DcopSYVUHxV37KJjxgYNCA/Bdi6KN5NHogsHJS3Z8plPk4hsbWD9oqhm9+VRk OOtlqusNrjRUa2s2rVaOHU48ggLwWE1n33/04qTEdgWEVrPQyaBENV+WqYBUKaz+c1lOjft0W2ULM 1FcBED+qs1fLcCAxaVXxkBuHPp5kyJf51/2B4EJZs1YmCO1wc9OnkYMzoNSc2eO7Xo97AKXB2CoPQ tdMR3rheVEDtId9xvavX8vdGdmAmYb6m8C3KMj3VGy8Vm/gS08asBxoUHR9PjZuYBXDLl1oQwzNHP mbmXKMMteJbMqNeRJL/Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNUGM-00Ehyj-Ul; Thu, 02 Feb 2023 07:44:07 +0000 Received: from linux.microsoft.com ([13.77.154.182]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNUEr-00EhA1-OI for linux-arm-kernel@lists.infradead.org; Thu, 02 Feb 2023 07:42:38 +0000 Received: from x64host.home (unknown [47.187.213.40]) by linux.microsoft.com (Postfix) with ESMTPSA id AD63B20B74FF; Wed, 1 Feb 2023 23:42:32 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com AD63B20B74FF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1675323753; bh=52SrY+gLkGQ+qY0RKHseR68Es2aziku7Iq+7Kj3IvpA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=RUt80pjNp8C7trJI0sPTY1QI6sO7KgTQpWVd5pInOxNNd/XWFYJ1TUZS+69s9qN/6 OwruZ8I1N1PDYZXxQsgW6hzU2KESnVVqsn6j1IOeCcdNnEDAKF8o/BokI8HmeiETUG btkxQ9AB+SmHdZ4i2C8s/js9ajspwZApYakUgFK0= From: madvenka@linux.microsoft.com To: jpoimboe@redhat.com, peterz@infradead.org, chenzhongjin@huawei.com, mark.rutland@arm.com, broonie@kernel.org, nobuta.keiya@fujitsu.com, sjitindarsingh@gmail.com, catalin.marinas@arm.com, will@kernel.org, jamorris@linux.microsoft.com, linux-arm-kernel@lists.infradead.org, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, madvenka@linux.microsoft.com Subject: [RFC PATCH v3 08/22] objtool: Introduce STATIC_CHECK Date: Thu, 2 Feb 2023 01:40:22 -0600 Message-Id: <20230202074036.507249-9-madvenka@linux.microsoft.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230202074036.507249-1-madvenka@linux.microsoft.com> References: <0337266cf19f4c98388e3f6d09f590d9de258dc7> <20230202074036.507249-1-madvenka@linux.microsoft.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230201_234233_898181_44DE4753 X-CRM114-Status: UNSURE ( 8.14 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: "Madhavan T. Venkataraman" Objtool currently implements static stack validation. Another method called dynamic validation can be supported for other architectures. Define STATIC_CHECK to select the files required for static validation in objtool build. Signed-off-by: Madhavan T. Venkataraman --- tools/objtool/Build | 6 +++--- tools/objtool/Makefile | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/objtool/Build b/tools/objtool/Build index c4666d0b40ba..974290dc4aac 100644 --- a/tools/objtool/Build +++ b/tools/objtool/Build @@ -2,13 +2,13 @@ objtool-y += arch/$(SRCARCH)/ objtool-y += weak.o -objtool-y += check.o -objtool-y += special.o +objtool-$(STATIC_CHECK) += check.o +objtool-$(STATIC_CHECK) += special.o objtool-y += builtin-check.o objtool-y += cfi.o objtool-y += insn.o objtool-y += decode.o -objtool-y += unwind_hints.o +objtool-$(STATIC_CHECK) += unwind_hints.o objtool-y += elf.o objtool-y += objtool.o diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile index a3a9cc24e0e3..797d1ea02db0 100644 --- a/tools/objtool/Makefile +++ b/tools/objtool/Makefile @@ -43,9 +43,10 @@ BUILD_ORC := n ifeq ($(SRCARCH),x86) BUILD_ORC := y + STATIC_CHECK := y endif -export BUILD_ORC +export BUILD_ORC STATIC_CHECK export srctree OUTPUT CFLAGS SRCARCH AWK include $(srctree)/tools/build/Makefile.include