Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1877879lql; Wed, 13 Mar 2024 10:32:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWAVbY1MFFqU4O5yJ84AhmBafUlIdvqJzQ75W3KI3ac9gHXuuoblYLBAwYPI4hxEO9G5DK1OYYtGRf8z3tOrXVB4ze+JYDzLmpliDqoOg== X-Google-Smtp-Source: AGHT+IEnn9g2dfk1ZZRA5iF0U9OqPYt1T1OVeTDZra2IWP2laiJxSlY9iEj8GDbRuNW8w1P9aeND X-Received: by 2002:a05:622a:13c8:b0:42f:30ec:aec6 with SMTP id p8-20020a05622a13c800b0042f30ecaec6mr16640869qtk.21.1710351140048; Wed, 13 Mar 2024 10:32:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710351140; cv=pass; d=google.com; s=arc-20160816; b=pLG3FS5Zyw5sje9x/bzElcfIvDiJDEPO7/QYRyaRLuDnPjTmikbHKpJ+ZfsNXyvfly p4GYio/Nt5xJJWMC9LtDH1W3yy1IDzmSmFzLGe3Txrkb0Hn8VzwrE2hRpYXY29B0LeSL GOSFmRWYBFBiUZIpQZJxw0ODajLACQT1jB2jNJrKu28jyl1yU60I7gnbUVp95y0XHM1C Idceh/Lf3tCovcjPVg5EWVxyFR0a2bKSC7DD0fZWhum+jIdyu/Zm6EDx44gklpdSI9jl HJdUkjxHYoMJqShpyy9bLLRjOlhtLoK7DqJovt7GrqmQwQUFAzNIHzYTuvyXgFrfMZAv LcMw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=MYsKns9mhlIOzMs96b6WvaCG6RO19dvP+aAepsM8CaY=; fh=vY+E/5adX5R4NqsyVfNP2OAKLQSbHnIeUm3jnzgImQc=; b=N9pW1LK1f5zMcaXAYreX/1Si0xWAL6y/QeRfBO/fQXwmSGOn+XKuWAi10TDta8K1Nk 0b3cbC81nzdnwT317LwN0TwHeFHV6a0Z7k7t6whI8qglmmONy6du6AnH4f4Yakpx1yRm IE3Mu+H9TiR4ZQDsyM1d5ANxueiD2emSufqol1abpW5JL5U2f691e9nt5jxY2zpWWSr0 sCIoyfVCOlZaRgriMx6hTToog79UKbclQjIBGX5mb0TJ8/TSiN5BWFUC+K8nJwxjyQaK sFOAJz5pDBw7NHf5LZsqmCOjWkPcDjDs+Bix+9Xq9d2xTo9EtogT9h5PtTgLyCIgvh0n JG/A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UO2OIWqY; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101985-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101985-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id f5-20020ac85d05000000b0042dff81e402si10434037qtx.471.2024.03.13.10.32.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 10:32:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101985-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UO2OIWqY; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101985-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101985-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C34121C20D26 for ; Wed, 13 Mar 2024 17:32:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 948381474D6; Wed, 13 Mar 2024 16:43:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="UO2OIWqY" 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 A434C14830A; Wed, 13 Mar 2024 16:43:16 +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=1710348196; cv=none; b=dKv4K81XLt/l0nsSgRT6Ysl/tgTIS37VoDtiPYKYic0HBoIxNOrQz5Uc8HNhmclYk4hqy648O+JiJt7fztOX1meWTVuggvfOpLUhafsM0zJ7Ftr+MpG7VXW+ka/RTYmHosJPYPbAVeoiBRbhX361PnQwfveyMV3RP31A+QpKNdU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710348196; c=relaxed/simple; bh=/JqcOwDy3vmYnzIP4SeFWDetGnNlE3xy9azSvyjg9+s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AGqlalbaRZQu/2sVYB2hbCTP+bmO8pfYeCBqs95mvOndQh1413urBJruYRk8VSCdWfb3a3dSlF6VRRC1lzX4JBKxpTGxiTLcoMwgIYuUYL/ujyxWxhCBqHZPahDW2foGdh+z53E9wIi7gcRnOtah7V9oa7HOVyC2kBrJmkGyk24= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UO2OIWqY; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82B3AC433A6; Wed, 13 Mar 2024 16:43:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710348196; bh=/JqcOwDy3vmYnzIP4SeFWDetGnNlE3xy9azSvyjg9+s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UO2OIWqYhmUR/xxgQC5tcJMBHttExJx/+osOFHTWiveWmdc2DO937j2ga4pu/Cmec RAtbH5kO1uDx9a3qUEdWwKxX1MVyYBxkFpMKYj7RUPgqYVz9NozMleGRghvZOtyFZ/ qGcCvPyjCBngqJbazmzs0j7WjE8PpdpS+HzHEZNLsuMPowG/AeIYrEkhQYULqUvEQ1 XI/YYFOqqW0flAcYa3TWopBgKHGdKdVCKyOMSu4WIWRxjA61gFJ3dr1+x2AqBdUzIp FQbGz83wvRMgu2/3o9zMcu2aF6XSAYqqSzNy8gtC0T8kXRdK2gj+RONTrAEbeBdnAN WvHkmIkweG8dQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Nathan Chancellor , Masahiro Yamada , Sasha Levin Subject: [PATCH 5.15 45/76] modpost: Add '.ltext' and '.ltext.*' to TEXT_SECTIONS Date: Wed, 13 Mar 2024 12:41:52 -0400 Message-ID: <20240313164223.615640-46-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240313164223.615640-1-sashal@kernel.org> References: <20240313164223.615640-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.152-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.15.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.15.152-rc1 X-KernelTest-Deadline: 2024-03-15T16:42+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Nathan Chancellor [ Upstream commit 397586506c3da005b9333ce5947ad01e8018a3be ] After the linked LLVM change, building ARCH=um defconfig results in a segmentation fault in modpost. Prior to commit a23e7584ecf3 ("modpost: unify 'sym' and 'to' in default_mismatch_handler()"), there was a warning: WARNING: modpost: vmlinux.o(__ex_table+0x88): Section mismatch in reference to the .ltext:(unknown) WARNING: modpost: The relocation at __ex_table+0x88 references section ".ltext" which is not in the list of authorized sections. If you're adding a new section and/or if this reference is valid, add ".ltext" to the list of authorized sections to jump to on fault. This can be achieved by adding ".ltext" to OTHER_TEXT_SECTIONS in scripts/mod/modpost.c. The linked LLVM change moves global objects to the '.ltext' (and '.ltext.*' with '-ffunction-sections') sections with '-mcmodel=large', which ARCH=um uses. These sections should be handled just as '.text' and '.text.*' are, so add them to TEXT_SECTIONS. Cc: stable@vger.kernel.org Closes: https://github.com/ClangBuiltLinux/linux/issues/1981 Link: https://github.com/llvm/llvm-project/commit/4bf8a688956a759b7b6b8d94f42d25c13c7af130 Signed-off-by: Nathan Chancellor Signed-off-by: Masahiro Yamada Signed-off-by: Sasha Levin --- scripts/mod/modpost.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 43bacdee5cc5d..201ac1bf5030d 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -937,7 +937,8 @@ static void check_section(const char *modname, struct elf_info *elf, #define DATA_SECTIONS ".data", ".data.rel" #define TEXT_SECTIONS ".text", ".text.*", ".sched.text", \ - ".kprobes.text", ".cpuidle.text", ".noinstr.text" + ".kprobes.text", ".cpuidle.text", ".noinstr.text", \ + ".ltext", ".ltext.*" #define OTHER_TEXT_SECTIONS ".ref.text", ".head.text", ".spinlock.text", \ ".fixup", ".entry.text", ".exception.text", \ ".coldtext", ".softirqentry.text" -- 2.43.0