From patchwork Mon Oct 14 12:57:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 13834974 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE2E0D16261 for ; Mon, 14 Oct 2024 12:57:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 82BC56B008A; Mon, 14 Oct 2024 08:57:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7DFE36B008C; Mon, 14 Oct 2024 08:57:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 62E816B0092; Mon, 14 Oct 2024 08:57:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 42A956B008A for ; Mon, 14 Oct 2024 08:57:17 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 3B9781A01DB for ; Mon, 14 Oct 2024 12:57:03 +0000 (UTC) X-FDA: 82672208262.08.F5C3642 Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) by imf03.hostedemail.com (Postfix) with ESMTP id EACE620014 for ; Mon, 14 Oct 2024 12:57:11 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=MIKIKrRl; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf03.hostedemail.com: domain of 3KhUNZwgKCMcn4qo+tv6t11tyr.p1zyv07A-zzx8npx.14t@flex--ardb.bounces.google.com designates 209.85.219.201 as permitted sender) smtp.mailfrom=3KhUNZwgKCMcn4qo+tv6t11tyr.p1zyv07A-zzx8npx.14t@flex--ardb.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1728910519; a=rsa-sha256; cv=none; b=NARopmOReNZvnKeh7dvXdj98acYPkPq5Rm9UrNTC9wBOaQsGZm+c8iozzFo44166SKxOe2 M2SzKFuZ7vfpjK/Cf5Lw/QBt7+9Zs58uA82JSK9nVx+DTQyRumYXNDyeEIPo28Ts8tU+VU NjO1sbgHce4F27zsGGDJ7kwtqf+K3ZE= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=MIKIKrRl; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf03.hostedemail.com: domain of 3KhUNZwgKCMcn4qo+tv6t11tyr.p1zyv07A-zzx8npx.14t@flex--ardb.bounces.google.com designates 209.85.219.201 as permitted sender) smtp.mailfrom=3KhUNZwgKCMcn4qo+tv6t11tyr.p1zyv07A-zzx8npx.14t@flex--ardb.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1728910519; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=jr6gvJaG1W/UpmtkFcAoLuQg+5nDfK5k6tZ9Bo4jz64=; b=Bw39+yruITy/ESOD87i9lMy6TRN3uWLo2yizNGlih6mI7V6aBMiuOqL6k5dmFbkLFSUmsS zBEDxLHRlcxS7bkzaVcfFOWMWxQ39vPK3OgZluXwEe940s6r6UDXHo4DKulHTfgW6Etf2X QbkggOe1RXkkg14SCu4RkF7t1FRHt9s= Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-e290222fde4so4607748276.1 for ; Mon, 14 Oct 2024 05:57:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1728910634; x=1729515434; darn=kvack.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=jr6gvJaG1W/UpmtkFcAoLuQg+5nDfK5k6tZ9Bo4jz64=; b=MIKIKrRl/Mmah07TpA6G5dxokPiVzP9Uh6aq8w/eba9knhg7AMoeHZaGjNWVXLo9k0 qxDNwKT/Xp52eF4c7tmN2wTicCG1g2JD7A0d/Pa7znz5Wro0Jyl0xrYn7URgTBG3jdGm 00hXEmBbgTTO98IdtIQy8xo0Eq2PhtJkk1G19UBeBz1LMfCBH8VAPUr0BTe3rND0kUdw RxkdZ5Xg9yiXxwRPWRzZv94EawrnW5WVgIcYb093SqmZWbVdtb/JgZdHCdkUVf6Wivs1 uIFoMxN3dj14QFGuFWnrynS+4XQBRBu9isAibTTgvXnBy3a+Y/ZFVW/zaKo4SsqJoxX/ RC6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728910634; x=1729515434; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jr6gvJaG1W/UpmtkFcAoLuQg+5nDfK5k6tZ9Bo4jz64=; b=iUy8dxjGX036Ca6DposcSPm0pN/WP2G91DwdH912GdASM23bllT249ohzHN7mPzGzT AyERXPrOBpYobSrA4PWHBGdsG2jSlbbPn5BUoN/uCA3aP4OSx6e8Xd2UofFurTK8HbUT w2izF20GrrrGsnmHlgEP7Jt+UiLQjVocn2Hivx44Jlj+c9GlzbHWnCel/VlmcwwmqW/P 4UfrUz28Eu30ZBu0yGM7aJZRtu3ia4FF7PQofscdaDSlp8WmtL2Xamfd9mP7P46pb/ft njF384zn7Fb0/XW3wJb3ptzVGTB7e1gxo2MET6gO7MzPSZ4iFR9cuNvC15Ocapvn3H8g sWag== X-Forwarded-Encrypted: i=1; AJvYcCVbcULjVm8Hc+Ap+H85wHJ+6f8C9NQTcAwvzJF+zABBGwCgEFsZaACHCNaG7mCaqli6H4gVUyx4Ig==@kvack.org X-Gm-Message-State: AOJu0Ywd1i/5YVwOxyMW0wg6k1WSskqjC/6GRiJPD1PwZdGhhRp2yQQS +n18e/QRz/hCW+H2hdSSS00UUBpr5xcD2G3mghMUuYCG+AwGV9+PV7SzVMZGIi9tC0Njtw== X-Google-Smtp-Source: AGHT+IEqZs2ag5HAsjw3w4ECPuvmKzmJ37fRfQ+HNG7wdnrxnT87LnWCSThnt7WZIiUCd09hr/MntVqv X-Received: from palermo.c.googlers.com ([fda3:e722:ac3:cc00:7b:198d:ac11:8138]) (user=ardb job=sendgmr) by 2002:a25:9cc3:0:b0:e28:f1e8:6596 with SMTP id 3f1490d57ef6-e2919d523eemr60405276.1.1728910634152; Mon, 14 Oct 2024 05:57:14 -0700 (PDT) Date: Mon, 14 Oct 2024 14:57:06 +0200 In-Reply-To: <20241014125703.2287936-4-ardb+git@google.com> Mime-Version: 1.0 References: <20241014125703.2287936-4-ardb+git@google.com> X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-Developer-Signature: v=1; a=openpgp-sha256; l=3929; i=ardb@kernel.org; h=from:subject; bh=XLQa+AmTzeuAR0O/nY3+iU4kWyjdOKPiaa9Oa0UT+Zo=; b=owGbwMvMwCFmkMcZplerG8N4Wi2JIZ1XVPHlsnWbD98/su/dP/0/+j+yM89MPCgYbRZx6Vlc3 Kze4Ev/OkpZGMQ4GGTFFFkEZv99t/P0RKla51myMHNYmUCGMHBxCsBEzOoYGX6YbYn+c8Bj/zI+ 9SddFwx59numHtmzpUlw8Y7dAceS/+xm+O/4RWHR6eO8juWFT38urWL+2Hi7LvHC398yx8w6NZf uNuUGAA== X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog Message-ID: <20241014125703.2287936-6-ardb+git@google.com> Subject: [PATCH 2/2] runtime-const: Use dot prefix for section names From: Ard Biesheuvel To: linux-kernel@vger.kernel.org Cc: Ard Biesheuvel , Linus Torvalds , Masahiro Yamada , Nathan Chancellor , Suren Baghdasaryan , Kent Overstreet , Arnd Bergmann , linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-kbuild@vger.kernel.org X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: EACE620014 X-Stat-Signature: wgrjq164tjb73j9ppjnh56itqawriyea X-Rspam-User: X-HE-Tag: 1728910631-413472 X-HE-Meta: U2FsdGVkX1++VDem8Q/jgIxnC7/cKwsjzOrj2sG1ZmwUuk3fFwRxyFTkEWOudZRBkRYdiyF4+i6wVNrbGmzocyKvgbQ9vKWe+j9L1SOJwKPdSKPDXvDXPAS9SSTpfuOWbj7jNoE/WsJT1sLofDMp8iPwg8DIa1km5qQ2BQfBQdjsIpLL4m4pInoEQz/uQMCPK0+locCllN+dDi92Dri4Ca2T9j5F8KIFc09ilD3lQxDhzUwMe9dZEHdgdjmy2PpsEn/yuZwyeUKEHhwgMXw37v+djYj9hMzTK1VBxD36jnwLcxcjjqXtV8mXLP7EdQ3AxGEy6daPb8l8nSHbph6ItHLczDFO3gRLQntV50c9tTjqxARQhYm5+V07qj/LFIDWQd2l7dJzUyiCogEI/Ibi1CMnpMbOTmK3OPxBv7fKteU14j86ilrqLcstCXRN7pObGI7meeAJ64GV3NFKxpGJBA50bwW+F4dC/ixtd+sv5sbawy4660DAh0PmfIYg57NbMF9eVym5PwSGQqqRRXONHEyFX+nZC4YzqpPUEgOQB5jJYQuvEBXxh8JG7tRXPbk58rO8jOG+zzgdGxuXQ4TUyRB8Kgigvtj1tkA/RKrrvNmAB7hM4NKlgPkVGbqHLJztuAnmsouHwPBceOa5qoVV821nL0SLDs0mEWhJX3325Ftm+rZHVQSqqJC22mF8UAukrmm3d8LGsCEFPXvGOO13pKcCjBXUPuhIBKwRPbNLYTYH3DRwrAkp1Dv3usPCA1ZeuFSERkP5s5pa/pev1xBsNyGZGzDuOtPYIfPB1p/jPs3kgvFf1wMKLfwv2clivRhY0u6n7coHSJH0/csTgytpKiaCHbSwcX/luiV/kd2P1jJsZ3OkmxPONLSmPZSm+/JppgeSJOsQApSLWL6eM99gtP0FaV/L9f/YAoRD9fqq+eUzcEzYRP392YBDL3OIwm/SQinL4/pklzdwoHrP8kt LU+zdett eqqM33fqOIGFzJte217Yxdwe1s4kMsbpF9FYOGvnIRKgK26AJJ0af0pM/ij1Q2O4jiMM1XbmiUM1JCd4oCl28hpXzNdrVd1b46McVkfdD3H6wIyLfyi5xD7D+7V5WobISR10ciYG5nuIVthbGbmh4nwaLEejbDhT4TykShc25lpSFksqshpxEMYjwfd3P89V1y3iK6/TXVKhzOtIFCvy5u/Bo9gLfKNGQegWS4WIS2nHGdMvUtZ/jNailAHBGU5yQb+QzpjkESe80LQgJLJtRgl3hzO/VdUlOG62VtV7pUCdSazc/MA4ljFRph+V9p2fMybVV2rbrpqKUJ49Pl9SGDbTNTIsNy35Ze+m9U48TJFAmNx6ZpXxmrnr3jiowWFc50yHbIoXFfYuYMPyaBnsSlI4gD//xo9kH4AojSeQSKoSoMIseAeukgrBGX0yz8a9995REusborDUjySzZ7f6ua2Y7UBNNLmE6agjyWW1P+pXi4Lkw3R3Cr64mo23Ffu/QVTCdAt0MV5M1jsDCc+IPilgZJ+9XLo6UhosSKiTEYCbVNfd6wBYT41Ych7hIAagBgjnt X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Ard Biesheuvel Sections typically use leading dots in their names, and deviating from this breaks some assumptions in the existing code, e.g., in strip_relocs on x86, as the linker prepends .rela to the section names when emitting static relocations. [59] .relaruntime_ptr_dentry_hashtable RELA 0000000000000000 792c758 000078 18 I 56 38 8 [60] .relaruntime_shift_d_hash_shift RELA 0000000000000000 792c7d0 000078 18 I 56 37 8 So use a leading dot for the runtime const sections. Signed-off-by: Ard Biesheuvel --- arch/arm64/include/asm/runtime-const.h | 4 ++-- arch/s390/include/asm/runtime-const.h | 4 ++-- arch/x86/include/asm/runtime-const.h | 4 ++-- include/asm-generic/vmlinux.lds.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/arm64/include/asm/runtime-const.h b/arch/arm64/include/asm/runtime-const.h index be5915669d23..2c3521765cfe 100644 --- a/arch/arm64/include/asm/runtime-const.h +++ b/arch/arm64/include/asm/runtime-const.h @@ -14,7 +14,7 @@ "movk %0, #0x89ab, lsl #16\n\t" \ "movk %0, #0x4567, lsl #32\n\t" \ "movk %0, #0x0123, lsl #48\n\t" \ - ".pushsection runtime_ptr_" #sym ",\"a\"\n\t" \ + ".pushsection .runtime_ptr_" #sym ",\"a\"\n\t" \ ".long 1b - .\n\t" \ ".popsection" \ :"=r" (__ret)); \ @@ -24,7 +24,7 @@ unsigned long __ret; \ asm_inline("1:\t" \ "lsr %w0,%w1,#12\n\t" \ - ".pushsection runtime_shift_" #sym ",\"a\"\n\t" \ + ".pushsection .runtime_shift_" #sym ",\"a\"\n\t"\ ".long 1b - .\n\t" \ ".popsection" \ :"=r" (__ret) \ diff --git a/arch/s390/include/asm/runtime-const.h b/arch/s390/include/asm/runtime-const.h index 17878b1d048c..d19f54567d48 100644 --- a/arch/s390/include/asm/runtime-const.h +++ b/arch/s390/include/asm/runtime-const.h @@ -11,7 +11,7 @@ asm_inline( \ "0: iihf %[__ret],%[c1]\n" \ " iilf %[__ret],%[c2]\n" \ - ".pushsection runtime_ptr_" #sym ",\"a\"\n" \ + ".pushsection .runtime_ptr_" #sym ",\"a\"\n" \ ".long 0b - .\n" \ ".popsection" \ : [__ret] "=d" (__ret) \ @@ -26,7 +26,7 @@ \ asm_inline( \ "0: srl %[__ret],12\n" \ - ".pushsection runtime_shift_" #sym ",\"a\"\n" \ + ".pushsection .runtime_shift_" #sym ",\"a\"\n" \ ".long 0b - .\n" \ ".popsection" \ : [__ret] "+d" (__ret)); \ diff --git a/arch/x86/include/asm/runtime-const.h b/arch/x86/include/asm/runtime-const.h index 24e3a53ca255..0de5a40ee6d0 100644 --- a/arch/x86/include/asm/runtime-const.h +++ b/arch/x86/include/asm/runtime-const.h @@ -5,7 +5,7 @@ #define runtime_const_ptr(sym) ({ \ typeof(sym) __ret; \ asm_inline("mov %1,%0\n1:\n" \ - ".pushsection runtime_ptr_" #sym ",\"a\"\n\t" \ + ".pushsection .runtime_ptr_" #sym ",\"a\"\n\t" \ ".long 1b - %c2 - .\n\t" \ ".popsection" \ :"=r" (__ret) \ @@ -19,7 +19,7 @@ #define runtime_const_shift_right_32(val, sym) ({ \ typeof(0u+(val)) __ret = (val); \ asm_inline("shrl $12,%k0\n1:\n" \ - ".pushsection runtime_shift_" #sym ",\"a\"\n\t" \ + ".pushsection .runtime_shift_" #sym ",\"a\"\n\t"\ ".long 1b - 1 - .\n\t" \ ".popsection" \ :"+r" (__ret)); \ diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index eeadbaeccf88..da097ba2d4d8 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -914,8 +914,8 @@ #define NAMED_SECTION(name) \ . = ALIGN(8); \ - name : AT(ADDR(name) - LOAD_OFFSET) \ - { BOUNDED_SECTION_PRE_LABEL(name, name, __start_, __stop_) } + . ## name : AT(ADDR(. ## name) - LOAD_OFFSET) \ + { BOUNDED_SECTION_PRE_LABEL(. ## name, name, __start_, __stop_) } #define RUNTIME_CONST(t,x) NAMED_SECTION(runtime_##t##_##x)