Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3865975pxv; Mon, 19 Jul 2021 10:37:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHrNwBHZEVzhrGcvStQpamsWCaUnGt/Po+CJy860I66vTsk/EZ+QCJu4MRFrWHfgd92AQn X-Received: by 2002:a50:ee0b:: with SMTP id g11mr27360741eds.332.1626716227812; Mon, 19 Jul 2021 10:37:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626716227; cv=none; d=google.com; s=arc-20160816; b=0a0dnnkoIyaR3M0oE+eUqblBHDIgs4V7N9oz1gp1yhLIneZXurzox7E3ib3zRFpUmF OyoFB31ku2xgW6XIoGubEsKPAynXcmYfxuC/65w54wnGoTm8E3cqYRDk+qJAvY+X6QJF CzZD+eJ62pn0SCC941lUAw22GDyMKdXlhiYAgMdJakqrlnRG+gfcf4ouIFB7b18NGb4h b8mgc8NR/tyHTT+VtISqhLh9e1PC5NZk0Z2ZQL31qg7PCRAbAx8MbX+uyFhK/iNIMYK+ l/GLT8YAxTyvcyO0fN91zpNiAkGub1e7CwPrL4r9Y5J2QJd5r9o8mPQenmVRGpVJqu+R VHlA== 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=CjI9YCQmiIjNYOoMnByTTk1wLfI8UEoHHJHOb55yrva+JrEHY8PAwB1mKHVs4321Wq r5w8FN9wcIgWONYMEfPB7NR7iuRRGZ92y8wT+HLyu3tElOCtFpHbB5/9/1MDnInczwSe TBxQAKYm/cCYuHC2YillqdJqu6HY08M7SOV0GsAkoTAje9n39snfuHPxseTec4yjCESh sNy1w7zbb2NQDQNwt2htCN8ImXoTg6tuSLQb1aHJf5UJ39R4UFGD9Um9TeFWI6Z5fIfu lYJEasm0wncQiayprgnxzwFn8ibK9DOtm5iOxcJX8k/e7vCUyeTbZ3T2uacNDXNx8Z+T LVkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=w5igigpj; 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 a18si21367638edr.24.2021.07.19.10.36.45; Mon, 19 Jul 2021 10:37:07 -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=w5igigpj; 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 S1357404AbhGSQvl (ORCPT + 99 others); Mon, 19 Jul 2021 12:51:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:40238 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348022AbhGSPYR (ORCPT ); Mon, 19 Jul 2021 11:24:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 17EF061351; Mon, 19 Jul 2021 16:00:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626710442; bh=wb24qyQbbZ4G0BR10Lg7jOKybgjnlwOQVtC4b9/RbVc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w5igigpjbKPrmIx13Cn2ITxWhA85E9Q6CeHrpAk1NyIKY04zye2tkDpDis8cMIjBx dI6XRNOtkYtnra4XIM2r3iQs4q4mLZEpn/btMq9FV7FqGgjVdMyqmRTKWEFSsBXiM6 npJZAdo9ZYaob+h7At0DyleoiZlPgPy+ZzgVqsJE= 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.10 184/243] hexagon: handle {,SOFT}IRQENTRY_TEXT in linker script Date: Mon, 19 Jul 2021 16:53:33 +0200 Message-Id: <20210719144946.864599916@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144940.904087935@linuxfoundation.org> References: <20210719144940.904087935@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