Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp4351870pxb; Tue, 25 Jan 2022 08:35:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJxh865dObv7ls7i2CVdET30cYJ9ff+yZ/6MuWwqoBFsawWE8DiUDN2bNFIgK1mWRU3Xuthj X-Received: by 2002:a17:907:e87:: with SMTP id ho7mr1389077ejc.481.1643128546535; Tue, 25 Jan 2022 08:35:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643128546; cv=none; d=google.com; s=arc-20160816; b=i/G9bvV4qJE3JoTcIDSoriRklGPaEGYqq9BwGmw8uzpGYS5Q93VT5nFFAL29RkP+V2 glcmaM1FVYcZEYi/WIRteRN7ve+xbKLUGcPlWWGZgxiS6jL+jzxHUdqQK/9wqJKyElGV LdOSoRhufbxLWVM9nPWCRp5t0XuVOQIb8zkipqXVssESII/cAYTtubRzgawaSpraEExS bUYxrJ3evCz7lxjB6755M/Y1LnDMS3IQbcUoq5FYHEKdUP+UWg1dmzSyVvo/zyEI2Oyo GbwzaOPDd/sGTiry/kVcGHiYfG/XBdNzrpPmd6ICq5KtJ8Nxot2V5X8ogDmlL9cCskmp 9bkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=/4hnV+ltMrevjYTbW/F+qpHn61T+BPEdIiAd1W0Z/H0=; b=xSxSJQQLqDciXP5fU30poAobzdUH2QHZKQgf0HBUoOHd7TduFhxcKSCsv/bUBNeZqp ve02YlPJyOkeDguHpzk2nDc72w57HZiV5ROxpTQWBSDox2t5U2lSXihe6PmQ3ywyTdQ3 iM3u6Z+XobbWMBuypYh6+yyLhehy7VWdsga9ZquRkl7IppxYQUFeAiLrGLSNK8NkS8yK FtvS297nkgryso1zNTLmcitgnFfVGHbtME+zBURwmMvs4iUWQ1xjMGw49pDOtjllkwhd GKgb8mi5xJrRqZsA7aDoCBsk/aCd+jvZf35nx7su0IrHIVP812ZNjAh0jvkylk31ToZC fTBg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u8si10150582eda.303.2022.01.25.08.34.52; Tue, 25 Jan 2022 08:35:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355896AbiAYLfd (ORCPT + 99 others); Tue, 25 Jan 2022 06:35:33 -0500 Received: from foss.arm.com ([217.140.110.172]:36816 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346922AbiAYLcR (ORCPT ); Tue, 25 Jan 2022 06:32:17 -0500 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 7DBF811FB; Tue, 25 Jan 2022 03:32:14 -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 81B593F7D8; Tue, 25 Jan 2022 03:32:12 -0800 (PST) From: Mark Rutland To: linux-kernel@vger.kernel.org Cc: acme@redhat.com, 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, linux@armlinux.org.uk, mark.rutland@arm.com, mingo@redhat.com, peterz@infradead.org, tglx@linutronix.de, will@kernel.org Subject: [PATCH v2 2/7] linkage: add SYM_{ENTRY,START,END}_AT() Date: Tue, 25 Jan 2022 11:31:55 +0000 Message-Id: <20220125113200.3829108-3-mark.rutland@arm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220125113200.3829108-1-mark.rutland@arm.com> References: <20220125113200.3829108-1-mark.rutland@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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. Signed-off-by: Mark Rutland Acked-by: Ard Biesheuvel Acked-by: Mark Brown Cc: Borislav Petkov Cc: Jiri Slaby Cc: Josh Poimboeuf Cc: Peter Zijlstra --- include/linux/linkage.h | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/include/linux/linkage.h b/include/linux/linkage.h index dbf8506decca0..d87c2acda2540 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h @@ -147,25 +147,43 @@ /* === generic annotations === */ +#ifndef SYM_ENTRY_AT +#define SYM_ENTRY_AT(name, location, linkage) \ + 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) +#endif + +/* SYM_START_AT -- use only if you have to */ +#ifndef SYM_START_AT +#define SYM_START_AT(name, location, linkage) \ + SYM_ENTRY_AT(name, location, linkage) #endif /* SYM_START -- use only if you have to */ #ifndef SYM_START #define SYM_START(name, linkage, align...) \ - SYM_ENTRY(name, linkage, align) + align ASM_NL \ + SYM_START_AT(name, ., linkage) +#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 === */ -- 2.30.2