From patchwork Mon Oct 14 12:57:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 13834973 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 5C6DED1625B for ; Mon, 14 Oct 2024 12:57:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E94446B0089; Mon, 14 Oct 2024 08:57:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E44096B008A; Mon, 14 Oct 2024 08:57:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D3C676B008C; Mon, 14 Oct 2024 08:57:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id B1E7A6B0089 for ; Mon, 14 Oct 2024 08:57:15 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id A3E1F1A09F1 for ; Mon, 14 Oct 2024 12:57:01 +0000 (UTC) X-FDA: 82672208136.09.EA6B073 Received: from mail-wr1-f74.google.com (mail-wr1-f74.google.com [209.85.221.74]) by imf05.hostedemail.com (Postfix) with ESMTP id E011A10000D for ; Mon, 14 Oct 2024 12:57:01 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=D36dIAc6; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf05.hostedemail.com: domain of 3JxUNZwgKCMQk1nl+qs3qyyqvo.mywvsx47-wwu5kmu.y1q@flex--ardb.bounces.google.com designates 209.85.221.74 as permitted sender) smtp.mailfrom=3JxUNZwgKCMQk1nl+qs3qyyqvo.mywvsx47-wwu5kmu.y1q@flex--ardb.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1728910587; a=rsa-sha256; cv=none; b=HOlK/rE1M8sRpwx4fegwT86sGGRiAzLweIIttLLZcZeuiiTB+PiGdpS5YQqHZWz69wHHMq dJb2YpBjgQ/nuS1CIWpP1qqVjUYBfe7qEJQrNBamuOmUCLY3i3HIOYOnRdYQo8HjWpJ/6e 7g1nEgJyD1EkgakLXEwgFLNlDdsxcKY= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=D36dIAc6; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf05.hostedemail.com: domain of 3JxUNZwgKCMQk1nl+qs3qyyqvo.mywvsx47-wwu5kmu.y1q@flex--ardb.bounces.google.com designates 209.85.221.74 as permitted sender) smtp.mailfrom=3JxUNZwgKCMQk1nl+qs3qyyqvo.mywvsx47-wwu5kmu.y1q@flex--ardb.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1728910587; 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=/4+Id/JvDOWrciOX+Pt0gw96Ii3oR3apf9+eeU2SPu0=; b=Cu5ACsbglvRCMYRxTh1xDOh9McZB1Q/loG6XpQGzuj2bbWVZLMc4gG3YeUD5PuVTHiL6Vb 6+K7gM+2FPcs/VAAIxerUXczVEfLHQv+jriRbKRgsj8V7EQ+ITXCknUAlEeHLgHDJawnyg aRKmL920B96OlZ9o7Ckv7es6++GA3Ps= Received: by mail-wr1-f74.google.com with SMTP id ffacd0b85a97d-37d45de8bbfso2624614f8f.3 for ; Mon, 14 Oct 2024 05:57:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1728910632; x=1729515432; 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=/4+Id/JvDOWrciOX+Pt0gw96Ii3oR3apf9+eeU2SPu0=; b=D36dIAc6sW3iL0KhHKGcD1MvXjtTM1Hp+tsOdGNGlWgOOiuDW5xXLqwEKyjifQQ8sm kjyvHc8K3HihZ9yl9qY+iVg+X97xamiViMpADzliz+tXPo/KO9hhHTEKpqIcpCh2S+bo U+JGd7fhXcQzZwYiWrVpsIUnQwRrRxKS4xsLVuD0q/zZ6TCPONho/RVS7AbXtQ8YciIJ 5kyj5AOwurwdruUo7luVUB9s9TaLtm8fbWhqJYGPF1lcNYspkH4pltA9uLhyHkrMjVpq vgCdFXtRQRA+LhLnUwAtVMHbI33jes+tyLtM5Wzt4juDYtx35YlThBvuxX0YhIeNqwn0 Ydvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728910632; x=1729515432; 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=/4+Id/JvDOWrciOX+Pt0gw96Ii3oR3apf9+eeU2SPu0=; b=MCB5qGLindEHRNMZ32V8xcFY13ji7IUxcRtS14bjZKmbCn3w7w+czKNqGgtYkGTVXU TMpHpGxMRxvO6opxnghOiLCZFmdZUbeEFuWljkoOMBFEI/fCEP852Tr0s99MwNyg5kvd qd3wO2l8/gS5d0BC4vX3e77GVqvIMXD19kF112UaYle9PdoztsOTgnMcD6ma0t9re1Tp d27GBSML2TG/za7epR9BipPyQql2i9zwVJGIkHD7vzKZI9DUisXfG+FPn0IwFtQPC1KL aFx7EDGxtTSKy0hv7VQRzks5SgQoc7bfNVCJSn3aNO4aI6+MYr0iSiht3yxfetG/RLtQ n+gw== X-Forwarded-Encrypted: i=1; AJvYcCW2enYLU77vXFK8br/XkBnUocJckXEbwSMf7SYQCghH1eCM0pcFE2ccpWmBAc8xZXEfHKKFyHr93Q==@kvack.org X-Gm-Message-State: AOJu0YwzErImuFHMge82stPGQYxyaRJThwz+Ea5zKH8umhRY7HAAbmY6 DVjacd9bTYJ+fWVxnqF48obrpEkEGkzZDj4t2RloCeUbtBH04/FRh0Haeg5jwyyeizbPmA== X-Google-Smtp-Source: AGHT+IGCETarcWcQqRIFRqqHH6KuqwoHb8bPYOCS/I0QvqDwtXW1Y79wZek7+MHKLcfDyEgkZpc9XL2l X-Received: from palermo.c.googlers.com ([fda3:e722:ac3:cc00:7b:198d:ac11:8138]) (user=ardb job=sendgmr) by 2002:a5d:6349:0:b0:37d:496a:af40 with SMTP id ffacd0b85a97d-37d5519e9f7mr14077f8f.1.1728910631360; Mon, 14 Oct 2024 05:57:11 -0700 (PDT) Date: Mon, 14 Oct 2024 14:57:05 +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=2118; i=ardb@kernel.org; h=from:subject; bh=MtWmIu/XLANHMVww4WyPFLDlQ8/l/C/DRmC5uEQQzio=; b=owGbwMvMwCFmkMcZplerG8N4Wi2JIZ1XVNHwoeS37nPZH8+9jH/hl7bp0+2HPxo3Wze3X9irp 3O/lOVgRykLgxgHg6yYIovA7L/vdp6eKFXrPEsWZg4rE8gQBi5OAZhIpzgjw6WCzw7LSvZtXxIe Jldyg2+rqsRr3031i5gOXjDVZ539rZ+R4Uxopky14DObzLN7jl2QsN2SvWKJyyaVFNYcxV2fhRn P8gEA X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog Message-ID: <20241014125703.2287936-5-ardb+git@google.com> Subject: [PATCH 1/2] codetag: Use dot prefix for section name 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-Rspam-User: X-Rspamd-Queue-Id: E011A10000D X-Rspamd-Server: rspam01 X-Stat-Signature: cnxdqbws63geu7c3et6ppdkcwweh8uuc X-HE-Tag: 1728910621-351736 X-HE-Meta: U2FsdGVkX1/GxlpMgEGpAAij6LX2zcJ8Knrx4sNQ05CJ+FZi4QM0ggRCH19ItdZ9X8VsXUZ1WHF9LYCZj6lDI1FEUArqNXUP0QSLsXKUR6kM97PmAAADD3266Lv3Lxcbb8NesEnfyrJxRWCLAJlqQssi+Zy4bODWKFq/MO133c4/FkWPDXX8eswIDya5bQ/y09oBdWb1SOPd8RqBCCCuflEYfA6uxuc4XWQT0A960Up5r8KpUl+bOly2E0hFp+Kd3TEuC2wZB1WEepslPPNbSeUy1Gtlmn8ymvZvlXVOqydXxrHuqruLUiyngd39LNXRh13GbKaviJSPgXRX/pgfWQGLuyZrxDZZOVV/c5qT4hLqXwmvsgGKPryZipZnyUv9bElP7km6p1mjaEZ9qciXH30tWVkuPF9lWSyl6UmmXFSjGf8ifksRj/efV6iiJCf/vYm8m3fsA3Oj8Jqmbzv03MITEkuekwx9gMf21P6Y/OC6bZFnJoHKCwbYAPwwy8AUWTFzP1/PVnVcCv5HMVy+rsB4wJNzXvRIkKfs0wa6iOPVC7QhT98qabxpQxo2BC9/3+ps/YoqNPgHZYnmHMncHFVjqdhl4wL0GUURrBq3AV7k00tjVkE1mp+QpBmlg4a6Ph1JDvLeQw7tgNVNqVxnxuw+BajJeafGFPdYsiPNGrCiC57f0C3pDHsJ1aDBvh1oWib9NyPV+s7Izg+TgIvhI7QrKrVT4QwLEPjHlabAn/unH8T94R4YbcVf8yDxSDfaMAIN2exrtp7s73CB3PqENUVHxs/4Gs2iY+sA1dflLBhC6H7+cERXzVY4yZLGnUVPS4yBVqhFcJDb/RnAlLKr4c+tAS9JY68pLFGULQin0IPmX5/d1N7uqR1a4WTrMp6D+mzWBtH+A+3n6Dbr5aC9SKHTrR+L8L97RTTgdVFdVzW2C7NfQPz2EXtpzwJ52xu2umQ1eT+twiLuw2o+cis HL1CGvIr Q5T3H9fIoPB1HDWUm6MmY52RLBuv0t6gifwQlcE4nh4+iOhz1QGs1cEc5WSD7gzFT6R81llaUazyMA9ycKYmgni2cvpSRAm+bc6khnPNiMdpoS/dmQfDMz/NhETxweG4pq4Q1hQS3w/IJps/g/s0skjsclVfI5hZ497NOyg289yMQ+vUGzhT9kgZhXq8262BLS5cu5dg5ZY7LXAg+/iU5iIdzxiJ/95wd5hpagGBnzvX0TImiVBmWJXv5RiKMSsf1PfcbJxiKF+fUSL8r8btKdfSKoicwI1QGdKYr/PS/2Bfy3VVdDJpgjvlt74FhGoh9tALAGRw6VBT0/0Ru1xEk10nXw2jSXKtqnv26z67ic6++K1qIk8lgUruJchzoV4X2UxcG70MXUGXVrmLyGcx4flWHOjFSMEqZbnX78fUWoKgMDty/i06xgA6AZ6hX2aCt5uXgrP+JtQheKQ24XFc6eCYKzzdIfABIu7aAHTR9aL7433XBcJ0pd7l8/jsnVnZsxlovNKwQ20wYM2MIklBYQ5GQ4TdWCQe2qxdS/Yck+pnhqJcs4NjMQE3lHeYqHjGa5Eb4 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000595, 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, which filters out .rela.* and .rela__* sections. [65] alloc_tags PROGBITS 0000000000000000 03a57958 0000000000026340 0000000000000000 WA 0 0 8 [66] .relaalloc_tags RELA 0000000000000000 08dbb868 0000000000044c40 0000000000000018 I 280 65 8 So use a leading dot for the alloc_tags sections. Signed-off-by: Ard Biesheuvel --- include/asm-generic/codetag.lds.h | 2 +- include/linux/alloc_tag.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/asm-generic/codetag.lds.h b/include/asm-generic/codetag.lds.h index 64f536b80380..dcd18351ba2f 100644 --- a/include/asm-generic/codetag.lds.h +++ b/include/asm-generic/codetag.lds.h @@ -5,7 +5,7 @@ #define SECTION_WITH_BOUNDARIES(_name) \ . = ALIGN(8); \ __start_##_name = .; \ - KEEP(*(_name)) \ + KEEP(*(. ## _name)) \ __stop_##_name = .; #define CODETAG_SECTIONS() \ diff --git a/include/linux/alloc_tag.h b/include/linux/alloc_tag.h index 1f0a9ff23a2c..d45a8a582970 100644 --- a/include/linux/alloc_tag.h +++ b/include/linux/alloc_tag.h @@ -76,7 +76,7 @@ DECLARE_PER_CPU(struct alloc_tag_counters, _shared_alloc_tag); #define DEFINE_ALLOC_TAG(_alloc_tag) \ static struct alloc_tag _alloc_tag __used __aligned(8) \ - __section("alloc_tags") = { \ + __section(".alloc_tags") = { \ .ct = CODE_TAG_INIT, \ .counters = &_shared_alloc_tag }; @@ -85,7 +85,7 @@ DECLARE_PER_CPU(struct alloc_tag_counters, _shared_alloc_tag); #define DEFINE_ALLOC_TAG(_alloc_tag) \ static DEFINE_PER_CPU(struct alloc_tag_counters, _alloc_tag_cntr); \ static struct alloc_tag _alloc_tag __used __aligned(8) \ - __section("alloc_tags") = { \ + __section(".alloc_tags") = { \ .ct = CODE_TAG_INIT, \ .counters = &_alloc_tag_cntr }; 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)