From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796384515; b=JX7f96Dh6j+OT8GEmzhwrXo8uBOO8V3dfUogRvvt61ZkHg1nck+h/OPR+jnSWD4HmEKA a6Rm7aDrUfBxSbdcmkoJqcSxC6naPzYebjcbHCskystbdYuf8uZ8LrxBgbGHc0BiXnYGf wrNY4LZeIvTv5qWrHAo6RRVyT1i7b00oVxpdhNHnvGTbm5V5DvOvWGCZN5iS/DUaJj4Pt e2qPVMZB02etqpTQMRLQ7mNP+gPFl+UmUtX4GOE/uw0VotmCBOojhYcveUDWcNBWifNZ6 us8ZCBX48PYK6tLN3DFqrLWE9sbjcsd2ioMkDGp8W6b7vTXlb5mTvADXSIxFjPPU7fg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796384515; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=sD0WojMLQNCDoSpR13uMQKQRugkBueBP8q31CsRdFHA=; b=0YW8BV7CIMGMZr3vlZnWH/ak2QJRLghHT6vgb4jUhLq7rApPzrUXPmnztd9VHxL6noo/ bDN4tduw7e0EkjqqxtohTXjSKPcs2+Yb2IZcVBfDAN9TITb8Z2mE1z7q8XsFzklSFC2d4 4IUKtdpNlW6lCVfrcjNJwVghM7blLES4coeBxBmd/PZEjqcfPVjipXVe2QvyzLlxPxXqK 7PBGzQ0hVPkhu2YoB5+KVZ2bgaQOtf7XqnOwe7hqqD+4XAQU9ohEBctakj5Rfn/PkygJo 7Y5xoGv4PPq4mnMYNRGXRfnFPKIZlAvknDkB72WUZHgG+mTlvhrUqn56iBdeBllJo7A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b="Fm0/HlBM"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 44A6E606A322; Fri, 4 Dec 2026 11:41:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=Fm0/HlBM Received: by smtp.kernel.org (Postfix) with ESMTPSA id ADEA11F000C2; Fri, 4 Dec 2026 11:41:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796384515; bh=sD0WojMLQNCDoSpR13uMQKQRugkBueBP8q31CsRdFHA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Fm0/HlBMDayhFTRxC7cuuQ4Tqx/zOCnAGMdxlJ3KrpN0JvshPAeCQChv9AoMe/E/S X9AhBAhbh5fQeOVpLwBWd8sOCMX6Q9af9Jnec6hUBge4nh9CNlfl9zRkVBrMwhDfQn qe+Xc7Xeflwy/Stz/98y1h4JvZKT8TWquyTJYu8E= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Rosen Penev , Thomas Bogendoerfer , Sasha Levin Subject: [PATCH 6.6 0182/1167] MIPS: Avoid dead code/data elimination when using recordmcount Date: Fri, 4 Dec 2026 18:53:29 +0900 Message-ID: <20261204100706.808172490@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Rosen Penev [ Upstream commit 255d9dbd936f7db8b963e82429f6e57cd9d48999 ] CONFIG_LD_DEAD_CODE_DATA_ELIMINATION builds with -ffunction-sections, placing every function in its own section. recordmcount refuses to use weak symbols as section bases, as a strong definition could override them, so a weak function alone in its section, such as the generic pcibios_fixup_bus() stub, breaks the build: Cannot find symbol for section 88: .text.pcibios_fixup_bus. drivers/pci/probe.o: failed MIPS always records mcount locations with recordmcount, so this hits any config with the function tracer and dead code elimination enabled, e.g. malta_defconfig built with LLVM=1. Only offer dead code elimination when recordmcount is not used, as powerpc does since commit f8b2336f15f3 ("powerpc: Avoid dead code/data elimination when using recordmcount"). In practice this makes it unavailable together with the function tracer on MIPS. Fixes: c0436b503591 ("MIPS: Enable dead code elimination") Signed-off-by: Rosen Penev Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin --- arch/mips/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 91c3a502156b3..2d6677fed5407 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -78,7 +78,7 @@ config MIPS select HAVE_IRQ_TIME_ACCOUNTING select HAVE_KPROBES select HAVE_KRETPROBES - select HAVE_LD_DEAD_CODE_DATA_ELIMINATION + select HAVE_LD_DEAD_CODE_DATA_ELIMINATION if !FTRACE_MCOUNT_USE_RECORDMCOUNT select HAVE_MOD_ARCH_SPECIFIC select HAVE_NMI select HAVE_PERF_EVENTS -- 2.53.0