From patchwork Mon Dec 6 12:47:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 12694880 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 2E60FC433EF for ; Mon, 6 Dec 2021 12:49:17 +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:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=T6M4eycDh0h7zr4tCoxHQ6hZvKPFp2thy5M5B0NCo0k=; b=2Rl39w1I8KJ59t Zpu4z5hlHV2umK0SvJGh47flX3ig0BljYJS9HmrC16JotvUGP/76yp6DsqMw7I60eo73HM6T6KKVL qReC/4WDYDtW2MxIvfskSWFE1R7hYc5xWZycFxnfabV3C2kDdqQdJ2NI1Onsul7zTINmNbiyi1i9W DpIwjiiYVrtxWqOhP0qqtBXOdD+Ss7lNK10d1tqQm8YPiXmKO1bkyRVN1S8L4H5nouu/pJI1HgWa4 tpvmulw8QEcEzBQgjaxRLvDlQ/si/o9s3EX/AsGFt/ptA66dobypDj9BYJ1bA0Gtz5Mx6c2lOeJ4Y wiLfOb+6GkJRWXGcl2Tw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1muDPD-003p9U-Hz; Mon, 06 Dec 2021 12:47:43 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1muDOw-003ozm-OK for linux-arm-kernel@lists.infradead.org; Mon, 06 Dec 2021 12:47:28 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5B45A1042; Mon, 6 Dec 2021 04:47:24 -0800 (PST) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 6012A3F73D; Mon, 6 Dec 2021 04:47:22 -0800 (PST) From: Mark Rutland To: linux-kernel@vger.kernel.org Cc: ardb@kernel.org, bp@alien8.de, broonie@kernel.org, catalin.marinas@arm.com, dave.hansen@linux.intel.com, jpoimboe@redhat.com, jslaby@suse.cz, linux-arm-kernel@lists.infradead.org, mark.rutland@arm.com, maz@kernel.org, mingo@redhat.com, peterz@infradead.org, tabba@google.com, tglx@linutronix.de, will@kernel.org Subject: [RFC PATCH 1/6] linkage: add SYM_{ENTRY,START,END}_AT() Date: Mon, 6 Dec 2021 12:47:10 +0000 Message-Id: <20211206124715.4101571-2-mark.rutland@arm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211206124715.4101571-1-mark.rutland@arm.com> References: <20211206124715.4101571-1-mark.rutland@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211206_044726_879894_003C7B1D X-CRM114-Status: UNSURE ( 9.43 ) 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 Currently, the SYM_{ENTRY,START,END}() helpers define symbols in terms of the current position within the section. In subsequent patches we'll need to define symbols after moving this position. This patch splits the core out of SYM_{ENTRY,START,END}() into SYM_{ENTRY,START,END}_AT() macros which take a location argument, with SYM_{ENTRY,START,END}() passing the current position. There should be no functional change as a result of this patch. TODO: * Handle tools/ copy Signed-off-by: Mark Rutland Cc: Borislav Petkov Cc: Jiri Slaby Cc: Josh Poimboeuf Cc: Peter Zijlstra --- include/linux/linkage.h | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/include/linux/linkage.h b/include/linux/linkage.h index dbf8506decca..45a4c0fcef7d 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h @@ -147,25 +147,42 @@ /* === generic annotations === */ +#ifndef SYM_ENTRY_AT +#define SYM_ENTRY_AT(name, location, linkage, align...) \ + linkage(name) ASM_NL \ + .set name, location ASM_NL +#endif + /* SYM_ENTRY -- use only if you have to for non-paired symbols */ #ifndef SYM_ENTRY #define SYM_ENTRY(name, linkage, align...) \ - linkage(name) ASM_NL \ align ASM_NL \ - name: + SYM_ENTRY_AT(name, ., linkage, align) +#endif + +/* SYM_START_AT -- use only if you have to */ +#ifndef SYM_START_AT +#define SYM_START_AT(name, location, linkage, align...) \ + SYM_ENTRY_AT(name, location, linkage, align) #endif /* SYM_START -- use only if you have to */ #ifndef SYM_START #define SYM_START(name, linkage, align...) \ - SYM_ENTRY(name, linkage, align) + SYM_START_AT(name, ., linkage, align) +#endif + +/* SYM_END_AT -- use only if you have to */ +#ifndef SYM_END_AT +#define SYM_END_AT(name, location, sym_type) \ + .type name sym_type ASM_NL \ + .size name, location-name ASM_NL #endif /* SYM_END -- use only if you have to */ #ifndef SYM_END #define SYM_END(name, sym_type) \ - .type name sym_type ASM_NL \ - .size name, .-name + SYM_END_AT(name, ., sym_type) #endif /* === code annotations === */