Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3890164pxv; Mon, 19 Jul 2021 11:13:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysg48UWOy/jNO0uyno1GRf/9hKtk7aODSPrXxeWhHuBp8OoXv3aSE+lAanAeb3f5LEyp0Y X-Received: by 2002:a17:906:6ad2:: with SMTP id q18mr988257ejs.107.1626718392814; Mon, 19 Jul 2021 11:13:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626718392; cv=none; d=google.com; s=arc-20160816; b=z3HlDEIRA7w8pqG9FHOH1cGxShaRY928x324BmtaxvBfcCMstF0Mw80qP3ftkSmCgF L+Yp/I9stR1UEhhLAgH4mH2SC82LtTm4Q2kAKCn8VDezeWX5g1+1Nb/FVYx7T4fE0ZNj OGaP/DQ/KmB4bBolufYfOrw2CF821/BhlWlhq+2ZmW3Mev/mN49so9TNZ9ZWm0GbB72c kb8BIT3uLUXIthm72J6kVX0Xef3sRz0XSTBUi1aqs36QRqc+zn0bru3F4dDQi113L8ND +25wRXxXBV0CLk282pcaAZRb78kerXcE7vBct6rvYIlVZzodJrQ47VhePEJa4hGrqfEb At4g== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hDW27MenKe4DwKqvZWFS4auav/wZPR8PfA3loaUgI54=; b=cuCLnqlwBpJANKxg2Y4eUmm8h1R1JwuKs92x3Q0SjjhwvchnNQB537x76ENsSJ/kPH 0guC+Pi5uf5z6NTWP97GLchDB13Bbb28LwWh0PgzFboE+MYPCq3+LNP6+WV56hVYsKjG WzczqkWrHVU8CCQzPkcpFPLT/tLabXLs4B6p30vJIadsZzVcIxtFTgzTMl42Goc5Sqrn lKwbt2FdggvsLV10eN3gedfXF3LApQIbGt9RuhKW+1fTWE3e7ltWhSnhNU26PPwymzAO vkw7aBQu3oRQcpKdCG/9iiDyKgvsnnYiqac2OZ7ZTSLoPRi83WHWyYy+YMJsIWBvrN1Z +ZrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Fglcc8N7; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id li7si22704855ejb.552.2021.07.19.11.12.48; Mon, 19 Jul 2021 11:13:12 -0700 (PDT) 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Fglcc8N7; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380535AbhGSR32 (ORCPT + 99 others); Mon, 19 Jul 2021 13:29:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:49362 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241562AbhGSPrH (ORCPT ); Mon, 19 Jul 2021 11:47:07 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A3CDA6135D; Mon, 19 Jul 2021 16:27:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626712030; bh=wb24qyQbbZ4G0BR10Lg7jOKybgjnlwOQVtC4b9/RbVc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fglcc8N7Lx9sxKwlt5a55qoJ92X4Ern2WwIdget3vA3SfdKR9EPp7ME7GYIKkpmDQ wbVN6+kcOIuG9ZYPgfZi0W5IXltoCsOJCCBJKf54ULh735UdSS6fViLGAd6g8NCdOE cFbpJTXehfN+VWmYQv+U4lazBy6PgEpWXHl00GQY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nathan Chancellor , Nick Desaulniers , Brian Cain , Oliver Glitta , Vlastimil Babka , David Rientjes , Andrew Morton , Linus Torvalds , Sasha Levin Subject: [PATCH 5.12 222/292] hexagon: handle {,SOFT}IRQENTRY_TEXT in linker script Date: Mon, 19 Jul 2021 16:54:44 +0200 Message-Id: <20210719144950.274256070@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144942.514164272@linuxfoundation.org> References: <20210719144942.514164272@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Chancellor [ Upstream commit 6fef087d0d37ba7dba8f3d75566eb4c256cd6742 ] Patch series "hexagon: Fix build error with CONFIG_STACKDEPOT and select CONFIG_ARCH_WANT_LD_ORPHAN_WARN". This series fixes an error with ARCH=hexagon that was pointed out by the patch "mm/slub: use stackdepot to save stack trace in objects". The first patch fixes that error by handling the '.irqentry.text' and '.softirqentry.text' sections. The second patch switches Hexagon over to the common DISCARDS macro, which should have been done when Hexagon was merged into the tree to match commit 023bf6f1b8bf ("linker script: unify usage of discard definition"). The third patch selects CONFIG_ARCH_WANT_LD_ORPHAN_WARN so that something like this does not happen again. This patch (of 3): Patch "mm/slub: use stackdepot to save stack trace in objects" in -mm selects CONFIG_STACKDEPOT when CONFIG_STACKTRACE_SUPPORT is selected and CONFIG_STACKDEPOT requires IRQENTRY_TEXT and SOFTIRQENTRY_TEXT to be handled after commit 505a0ef15f96 ("kasan: stackdepot: move filter_irq_stacks() to stackdepot.c") due to the use of the __{,soft}irqentry_text_{start,end} section symbols. If those sections are not handled, the build is broken. $ make ARCH=hexagon CROSS_COMPILE=hexagon-linux- LLVM=1 LLVM_IAS=1 defconfig all ... ld.lld: error: undefined symbol: __irqentry_text_start >>> referenced by stackdepot.c >>> stackdepot.o:(filter_irq_stacks) in archive lib/built-in.a >>> referenced by stackdepot.c >>> stackdepot.o:(filter_irq_stacks) in archive lib/built-in.a ld.lld: error: undefined symbol: __irqentry_text_end >>> referenced by stackdepot.c >>> stackdepot.o:(filter_irq_stacks) in archive lib/built-in.a >>> referenced by stackdepot.c >>> stackdepot.o:(filter_irq_stacks) in archive lib/built-in.a ld.lld: error: undefined symbol: __softirqentry_text_start >>> referenced by stackdepot.c >>> stackdepot.o:(filter_irq_stacks) in archive lib/built-in.a >>> referenced by stackdepot.c >>> stackdepot.o:(filter_irq_stacks) in archive lib/built-in.a ld.lld: error: undefined symbol: __softirqentry_text_end >>> referenced by stackdepot.c >>> stackdepot.o:(filter_irq_stacks) in archive lib/built-in.a >>> referenced by stackdepot.c >>> stackdepot.o:(filter_irq_stacks) in archive lib/built-in.a ... Add these sections to the Hexagon linker script so the build continues to work. ld.lld's orphan section warning would have caught this prior to the -mm commit mentioned above: ld.lld: warning: kernel/built-in.a(softirq.o):(.softirqentry.text) is being placed in '.softirqentry.text' ld.lld: warning: kernel/built-in.a(softirq.o):(.softirqentry.text) is being placed in '.softirqentry.text' ld.lld: warning: kernel/built-in.a(softirq.o):(.softirqentry.text) is being placed in '.softirqentry.text' Link: https://lkml.kernel.org/r/20210521011239.1332345-1-nathan@kernel.org Link: https://lkml.kernel.org/r/20210521011239.1332345-2-nathan@kernel.org Link: https://github.com/ClangBuiltLinux/linux/issues/1381 Fixes: 505a0ef15f96 ("kasan: stackdepot: move filter_irq_stacks() to stackdepot.c") Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Acked-by: Brian Cain Cc: Oliver Glitta Cc: Vlastimil Babka Cc: David Rientjes Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- arch/hexagon/kernel/vmlinux.lds.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/hexagon/kernel/vmlinux.lds.S b/arch/hexagon/kernel/vmlinux.lds.S index 35b18e55eae8..20f19539c5fc 100644 --- a/arch/hexagon/kernel/vmlinux.lds.S +++ b/arch/hexagon/kernel/vmlinux.lds.S @@ -38,6 +38,8 @@ SECTIONS .text : AT(ADDR(.text)) { _text = .; TEXT_TEXT + IRQENTRY_TEXT + SOFTIRQENTRY_TEXT SCHED_TEXT CPUIDLE_TEXT LOCK_TEXT -- 2.30.2