From nobody Tue Dec 16 21:10:52 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 BADE9282EB for ; Tue, 2 Dec 2025 18:00:30 +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=1764698430; cv=none; b=d+mW9I3O4SEEvIY/KUzv/DdVsXX04pxDj9a3mVPq1ZTSvbAOcWtY7C+L+kWxgYG2Y7p6F+F0/uTGeZuwx1mg4Sz70aQQn8VNoHb5w29kHhfimrJxkAqSLsDsV38fSS6LZhJuCLjqBReTTHXjEyoIuvGimGUN7ZsJWomtq0GK5Qk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764698430; c=relaxed/simple; bh=zRwjnUQrQn0IYCFmdYc8MqHt18iMu0TvQxJkioQJ9zw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=td+WyN839vAn7QRpH7dff+1/Sh/ZUXTli82Zj7c/b8jJfooycEFzGL2ruCrVaqwfFAJoBFTG4Vu1afGb1hmsgGmOzP+ikGiBmD/8/HuWHyWL9/dgRKw45qLlonKAqfM8s3qepAwnJu2iJRxJhnr6C2wh/l1HU7/pLEIUWgZAg/I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=vLx3AzBi; 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="vLx3AzBi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 42D04C116B1; Tue, 2 Dec 2025 18:00:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1764698430; bh=zRwjnUQrQn0IYCFmdYc8MqHt18iMu0TvQxJkioQJ9zw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vLx3AzBiX/u16PKfgTCBhtmA6q0aV3GE2I76DH/yKD1sGEEjGSW5pZ/hMlFPVdETi mjaFsgyMQxQAGo0fGdVcknkpdJWm/Qad98XHTsKPcG1BrLYnJBN0+y7ihLMXaTyICg uEMmYoJ6J6Bti9FrvmcmlKmS6vgu99pD+0rfsnUXIZRtPO9+TKSktMa9C5VvOFSmU0 cDOd1fg4vPKUlb9MZ9yIFSS6V+NX68J+fMbsGLF5socaLg7CY4RBwaJdOGojCwMdaC MVEMG4Mu/NoyySJLDMphOxgRaty94fqayOSaoT6UgjrzGRyZmPbTiUVNNLNygkaF7V WK7qB6YXF84SQ== From: Josh Poimboeuf To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar Subject: [PATCH v2 3/4] objtool: Consolidate annotation macros Date: Tue, 2 Dec 2025 09:59:38 -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