From nobody Tue Dec 2 00:02:24 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D24C31690A for ; Wed, 26 Nov 2025 06:07:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764137257; cv=none; b=Upc355cgbamd9qAp90M6Tlg1J1HtMX47UJsweKXT2JCJPFWsxVZd2fVnxOORlaWJWd0rM8a2oGUL8BQfGkeD+Cao/mQRBOgwQsAQ6klWXl1Y/6PfhU7v1iTvXNbDMR36pdFIznOneidmjNCsCE3XwgvW3aqQxNSDFe/v+8ULZPA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764137257; c=relaxed/simple; bh=zRwjnUQrQn0IYCFmdYc8MqHt18iMu0TvQxJkioQJ9zw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JGJyDcdq+IWk1b5Qo2GSMD+KteZqUdqfSN1WYwjkO9BBYqq0lTKDE694Q5ydZQTm1OoxKLoA/14IEpbqaI7n1daW8zfMqBAmqyo7OLtP9bHZqunt6qHUe5BoB67ol145XOpqezr2DO+8jB3eiw1TPvNX7lLFYG9aZl2S5dfJJMg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VlJrXtaO; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VlJrXtaO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91C55C19424; Wed, 26 Nov 2025 06:07:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1764137256; bh=zRwjnUQrQn0IYCFmdYc8MqHt18iMu0TvQxJkioQJ9zw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VlJrXtaOLZaTsyKUalpd2kQjAdZDsuCAU5FbEDAHfvQreTo57RIg4jJzOHutvwop7 wbJN/hkJtmnKbxjlshFHLTpKYhMC/v3HAQn+xS3gGCsmVPgL/rfffiP50o4wdqDBM4 5jz7YjzuJ8QDtTdv2C1JCKpfhm/bVgqNfL0JJca0NzVRFC269F4YIMvaC3UxttVrYQ B0yTNYXYvwNQkz5J1mwD8k5sE5CLGPk4wSkibCrteJTorGC6uxipIxyDnWaQ2RGNYK pypNzpRQbVcc9v0cmCGE5FM/tHvPahgCSu3uuREve6ogmowABMLPsB36OVr56SdATY OPFj7ozee8f2g== From: Josh Poimboeuf To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Peter Zijlstra Subject: [PATCH 3/4] objtool: Consolidate annotation macros Date: Tue, 25 Nov 2025 22:06:59 -0800 Message-ID: X-Mailer: git-send-email 2.51.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Consolidate __ASM_ANNOTATE into a single macro which is used by both C and asm. This also makes the code generation a bit more palatable by putting it all on a single line. Signed-off-by: Josh Poimboeuf --- include/linux/annotate.h | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/include/linux/annotate.h b/include/linux/annotate.h index 7c10d34d198c..996126f5f9ec 100644 --- a/include/linux/annotate.h +++ b/include/linux/annotate.h @@ -6,41 +6,35 @@ =20 #ifdef CONFIG_OBJTOOL =20 +#define __ASM_ANNOTATE(section, label, type) \ + .pushsection section, "M", @progbits, 8; \ + .long label - .; \ + .long type; \ + .popsection + #ifndef __ASSEMBLY__ =20 -#define __ASM_ANNOTATE(section, label, type) \ - ".pushsection " section ",\"M\", @progbits, 8\n\t" \ - ".long " __stringify(label) " - .\n\t" \ - ".long " __stringify(type) "\n\t" \ - ".popsection\n\t" - #define ASM_ANNOTATE_LABEL(label, type) \ - __ASM_ANNOTATE(".discard.annotate_insn", label, type) + __stringify(__ASM_ANNOTATE(".discard.annotate_insn", label, type)) "\n\t" =20 #define ASM_ANNOTATE(type) \ - "911:\n\t" \ - ASM_ANNOTATE_LABEL(911b, type) + "911: " \ + __stringify(__ASM_ANNOTATE(".discard.annotate_insn", 911b, type)) "\n\t" =20 #define ASM_ANNOTATE_DATA(type) \ - "912:\n\t" \ - __ASM_ANNOTATE(".discard.annotate_data", 912b, type) + "912: " \ + __stringify(__ASM_ANNOTATE(".discard.annotate_data", 912b, type)) "\n\t" =20 #else /* __ASSEMBLY__ */ =20 -.macro __ANNOTATE section, type -.Lhere_\@: - .pushsection \section, "M", @progbits, 8 - .long .Lhere_\@ - . - .long \type - .popsection -.endm - .macro ANNOTATE type - __ANNOTATE ".discard.annotate_insn", \type +.Lhere_\@: + __ASM_ANNOTATE(".discard.annotate_insn", .Lhere_\@, \type) .endm =20 .macro ANNOTATE_DATA type - __ANNOTATE ".discard.annotate_data", \type +.Lhere_\@: + __ASM_ANNOTATE(".discard.annotate_data", .Lhere_\@, \type) .endm =20 #endif /* __ASSEMBLY__ */ --=20 2.51.1