From patchwork Mon Jan 16 15:47:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13103432 X-Patchwork-Delegate: palmer@dabbelt.com 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AEF2AC67871 for ; Mon, 16 Jan 2023 15:58:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PTashnVMW0nYfIlADkpOZRhd4C0zat1Z4Bd8N7Z102U=; b=zfgoj03Fi8JWmh G2D6nnJ531psJPnOdDUCc6pD2n6NVnuSS43RZ38uNJ36TdPn244qlyDrA80tsyFgtjIyBGr5nSHfi uoN7noszYxuJIW+rKyFuzXXVF+KRVD2NwVSA+pIkldvd3BSmJ7MDgN3MMuEXf/xujkncIqNh9vZkM mAbGCF0h8JoUMiNLgMLs6fOZeKjeck+sMyNQXKY2tRmqcAY4Q59GyJFG50E/uTzN7JMMa772LEl54 N2ZV+f7QNClq26IobMxp7OFl8qRLCrKElBfkobeWPYigurpostlx0iZl3Vt+x/hETalDa3seSgWAW rjUTQMIIbGyEzhU97Axw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHRsO-00BAxt-Tk; Mon, 16 Jan 2023 15:58:24 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHRsM-00BAwp-2M for linux-riscv@lists.infradead.org; Mon, 16 Jan 2023 15:58:23 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B4DB5B81052; Mon, 16 Jan 2023 15:58:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1EDAFC43392; Mon, 16 Jan 2023 15:58:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673884699; bh=J6NfBaiAHaZuC3c1U8Q2mwYoiCAI9Bs41guM1DxDgPc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E/Fm4fJ6R+gnYkAgA5KkTUQZgSbM1FBy03JJaSNEJBrs8Qx4ICgclPgIZHwfd+rh6 h+xQ7hvzGvW335ZpsYf4g1sna3tshbQjaZq/d1sOs2UDz3PVBZRg7FU1VKcYc3GQ3J 3kos1+0cwj20dPkbeq2MiXQKO7Po2z5QBRHwIaaotWQlqosYU+1Rv2/G0AeSnLJ/0u U9Y9+4GqvWpyHJUoVEILZZ8eNwOLDRoaks6RH2Elao7PqmnZbNUssHsQA0bwBmD7W6 5SlPYhbJW4CjU5UI60tc8b3fnzIviWYRByLwdYyZbrSP9HGnjLrmWX9pTkdap8TnVB 3LSNAHsW+ycxA== From: Jisheng Zhang To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Masahiro Yamada , Kees Cook , Nathan Chancellor Cc: linux-riscv@lists.infradead.org Subject: [PATCH 1/4] riscv: lds: define RUNTIME_DISCARD_EXIT Date: Mon, 16 Jan 2023 23:47:57 +0800 Message-Id: <20230116154800.2396-2-jszhang@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230116154800.2396-1-jszhang@kernel.org> References: <20230116154800.2396-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230116_075822_276526_C9B82015 X-CRM114-Status: GOOD ( 10.49 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org riscv discards .exit.* sections at run-time but doesn't define RUNTIME_DISCARD_EXIT. However, the .exit.* sections are still allocated and kept even if the generic DISCARDS would discard the sections due to missing RUNTIME_DISCARD_EXIT, because the DISCARD sits at the end of the linker script. Add the missing RUNTIME_DISCARD_EXIT define so that it still works if we move DISCARD up or even at the beginning of the linker script. Signed-off-by: Jisheng Zhang Suggested-by: Masahiro Yamada Reviewed-by: Conor Dooley --- arch/riscv/kernel/vmlinux.lds.S | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/riscv/kernel/vmlinux.lds.S b/arch/riscv/kernel/vmlinux.lds.S index 4e6c88aa4d87..07c19f2a288c 100644 --- a/arch/riscv/kernel/vmlinux.lds.S +++ b/arch/riscv/kernel/vmlinux.lds.S @@ -5,6 +5,7 @@ */ #define RO_EXCEPTION_TABLE_ALIGN 4 +#define RUNTIME_DISCARD_EXIT #ifdef CONFIG_XIP_KERNEL #include "vmlinux-xip.lds.S" From patchwork Mon Jan 16 15:47:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13103433 X-Patchwork-Delegate: palmer@dabbelt.com 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 63C68C677F1 for ; Mon, 16 Jan 2023 15:58:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=j6GFbqX2458SyTJDO9J25h/w0Wt40zvExchTuTSrfuw=; b=GafYVTIpWs9ehe ML/TbohoHbh0rhcuYW/DR9Dp6ws2xa2bovZPiKFFzSxlK5cq5R524C1Nv5eWXNkCboa5POHIyNXoU L7o3HwQEY9JHp2xsjX1eXJQ+YtvGxIZW7+SejsRzbxNVZIUyOZAYEKgPyvyWAM+KcgcgHwUcpJDAL F51OCV0Q4spP59R8o9ZR5nT4/FpAIYw+G8wN8UWF7oBXbKAUigoEjFXrHT5Qg9DLi4y5KMv7KdwtX uaiBBUCgxodNkD0VcV29zwAaPjIA03yCpsW+5LG7xmdB5rqjLWWt2vC5WxxMPdXmy0uCRqmF/sUsh B5AxVWzqraGflv1sstkg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHRsQ-00BAyL-5g; Mon, 16 Jan 2023 15:58:26 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHRsM-00BAwu-Eu for linux-riscv@lists.infradead.org; Mon, 16 Jan 2023 15:58:23 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A559E61040; Mon, 16 Jan 2023 15:58:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C310EC43396; Mon, 16 Jan 2023 15:58:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673884701; bh=JVI55/ivlZ2TxoJHk0X2NO1E9dymbfoLXWzO4tbPtjg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hQLGWPWQBowTdfDg/CAki4MZcAg5/oB3PXLLPX88Fnba5bARdbE1+3SIw6lMIpexo 158RFZEXuUbxPysfc9lf9HngMpxyxhvWhtr8iNeazmKvbXLi2Ou6toHL074DAHNap8 C8/T3PPt6zAG0XEAUaociWBjoQP+nn4QB1AlC3xS1nru4qIbz/Wug10e3x09Vdn+Tr WnndwNlS89nIB5ayBvcVqWQxlJCaU8lhsxbnLP5n3VHtETNQXTxQelSSX2UtPRQVwQ AWSNBRAK6fZw+izOcSz7VW5ZZ7BTAHkP4rOBZcaUUbjiivigRGcf2aKfn3OH6kWZDX l124xXCOsW7zQ== From: Jisheng Zhang To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Masahiro Yamada , Kees Cook , Nathan Chancellor Cc: linux-riscv@lists.infradead.org Subject: [PATCH 2/4] riscv: vmlinux.lds.S: explicitly catch .rela.dyn symbols Date: Mon, 16 Jan 2023 23:47:58 +0800 Message-Id: <20230116154800.2396-3-jszhang@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230116154800.2396-1-jszhang@kernel.org> References: <20230116154800.2396-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230116_075822_561008_716C52B1 X-CRM114-Status: UNSURE ( 9.28 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org When enabling linker orphan section warning, I got warnings similar as below: riscv64-linux-gnu-ld: warning: orphan section `.rela.text' from `init/main.o' being placed in section `.rela.dyn' Use the approach similar as ARM64 does and declare it in vmlinux.lds.S Signed-off-by: Jisheng Zhang --- arch/riscv/kernel/vmlinux.lds.S | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/riscv/kernel/vmlinux.lds.S b/arch/riscv/kernel/vmlinux.lds.S index 07c19f2a288c..6a250313b752 100644 --- a/arch/riscv/kernel/vmlinux.lds.S +++ b/arch/riscv/kernel/vmlinux.lds.S @@ -97,6 +97,10 @@ SECTIONS *(.rel.dyn*) } + .rela.dyn : { + *(.rela*) + } + __init_data_end = .; . = ALIGN(8); From patchwork Mon Jan 16 15:47:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13103434 X-Patchwork-Delegate: palmer@dabbelt.com 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F3DF0C46467 for ; Mon, 16 Jan 2023 15:58:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lKT3sOiMyKTkl6l2nQ1WSoftNXoqdZ1jXZHlVYj4RDs=; b=tffFEUPRnyOXY/ /5C+rxO+9ohPO8lgUKIwx1c7GLefIvxDzvJRH/WIwm9YTrlc8aCUeT7i4EaAtG/Oho1vEFARskKv5 mrS4PhCeqEiJPLx8XDym4or+j/2T+RbD5doWejCYjAYYsWsg2zKbq+bkhZh9iskL2LtShrqb3NJ24 zahLdDN0KCAXf+q2STVE7cD6G+LCEgDx/DNZ29/WzblWkM1c3Kz/B+WaWaFAD94EeVrFZd6HMzywB nbtubBl2Q/JVBsnXKRdJf2HG0R1FpYkQjEQ/qH+US9CVlRVKY5E5epI1rfJ97liaFfftyuqha29Yl S1MMWm3hMLQtr42B6/pQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHRsS-00BAz9-GC; Mon, 16 Jan 2023 15:58:28 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHRsN-00BAxR-Ut for linux-riscv@lists.infradead.org; Mon, 16 Jan 2023 15:58:25 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 519FE61030; Mon, 16 Jan 2023 15:58:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74215C43398; Mon, 16 Jan 2023 15:58:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673884702; bh=t4kWO6RzYGVOXF7OBL8S5jRby3O+U8tlpoQh+00evO4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WhVJ/wweeC1d7+vmLys3cy87idXZSvsxGv8ovyvUhrhSj/1KOZEENKX4ljEh/vaHj 5KSWoEI2B1qF5zpLPjLN/vAGCpuE3EOQ8UjjAUg1waQpQXRA+E7AphE675vVhLxQtI tSxwO/KIApZXgxZw+5xh1jRMCXZaLOpEQF3LvnWXEwRhvFRVB6y6pdbF04X4yjghja MiGlArgdb3/fXRHbDbwmMr8BhFliFtz3LQqTqF1+XpbRxZeUGdROj2Vtt4eSUslh3g 8LYqZ6UfmhvuExYZeuwW2oWWKkd/ZA8Vm2EpW+KtbajfX4Bbwjf/lmy8lV1NT3eJ57 6lRY/mcBt1Thg== From: Jisheng Zhang To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Masahiro Yamada , Kees Cook , Nathan Chancellor Cc: linux-riscv@lists.infradead.org Subject: [PATCH 3/4] riscv: vmlinux.lds.S: explicitly catch .riscv.attributes sections Date: Mon, 16 Jan 2023 23:47:59 +0800 Message-Id: <20230116154800.2396-4-jszhang@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230116154800.2396-1-jszhang@kernel.org> References: <20230116154800.2396-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230116_075824_045041_9D88EE8C X-CRM114-Status: UNSURE ( 9.63 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org When enabling linker orphan section warning, I got warnings similar as below: riscv64-linux-gnu-ld: warning: orphan section `.riscv.attributes' from `init/main.o' being placed in section `.riscv.attributes' While I don't see any usage of .riscv.attributes sections' usage in kernel now, just catch the sections so that we can enable linker orphan section warning. Signed-off-by: Jisheng Zhang --- arch/riscv/kernel/vmlinux.lds.S | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/riscv/kernel/vmlinux.lds.S b/arch/riscv/kernel/vmlinux.lds.S index 6a250313b752..7eb3d25d0dae 100644 --- a/arch/riscv/kernel/vmlinux.lds.S +++ b/arch/riscv/kernel/vmlinux.lds.S @@ -146,6 +146,7 @@ SECTIONS STABS_DEBUG DWARF_DEBUG ELF_DETAILS + .riscv.attributes 0 : { *(.riscv.attributes) } DISCARDS } From patchwork Mon Jan 16 15:48:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13103435 X-Patchwork-Delegate: palmer@dabbelt.com 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5FE66C67871 for ; Mon, 16 Jan 2023 15:58:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PfuCjhc4NEegZ7yqc7DnqSj8Xiy9YAZcYlcT+r1X7dM=; b=V/mw6xNAB77iaf KId6q4w4+Ozkx+FN0TLtArdU5WguYgpGHn6T986a7mxWV5LaiYPUv6n3vEsCYPxUknw/QkcrcInKk FOY9GUzDX+W9bDntQlaJSRlQMoCb69CG/2mrZA0MVO3QNBGUSQTvDN/uV2Ap2341HUdNdux1Pvjyb b4SBiGcxig4qG8Bmq/BmbMoC01FxGDcyFr97x/5L3Tl4sLo75ZVkms1KW43/UO/RzEtK1sXUMJY9n u8IKYLNvOfEXLnsO+siz8uV3yPeirFahUlMvCPG23qqTC6mzQjk+6BJUoZ49MTOtEosOU7x3nAXfj Fz5XZepQJlPZYs4T+yUQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHRsT-00BAzb-Oe; Mon, 16 Jan 2023 15:58:29 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHRsR-00BAyO-2S for linux-riscv@lists.infradead.org; Mon, 16 Jan 2023 15:58:28 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id BFF72B8105D; Mon, 16 Jan 2023 15:58:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2488DC433D2; Mon, 16 Jan 2023 15:58:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673884704; bh=Q3aUPyCmgVUYIBmI6uVtAlDrofg5WEVa3xPWnM7xs/M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Mru8Lkmegyc0W+Cn7bxVnvtPm1xWBYH3fluAbrGMdkbbNt/NvYr31nj1Lo0WFK8OK WLAXR6ak/NHop4MfGbN0yv7WVHA4tPAslu0oVlhBZufCvB0U6aKbsETQ3JyGG7pcqz H9uPrPJMx0+2CdIWAKbeLkZWQNl9gcnuJwypJSbFYkBxQDRU1wijQ4Z9tfVxzqYxxR cnI2nljWFBubmVIl49xtqSxI0mpWS+cs+OYgCY5AVvzeR1Rdwx8oYCZfdjYDtvk2T3 s0dbEX8AebX5tmswx0SZzF+glmHu/vWiY9T0ubXpNxUzAUuQzcCHvPXKvj1IZpG4ts ArFTUMJNvxT6Q== From: Jisheng Zhang To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Masahiro Yamada , Kees Cook , Nathan Chancellor Cc: linux-riscv@lists.infradead.org Subject: [PATCH 4/4] riscv: select ARCH_WANT_LD_ORPHAN_WARN for !XIP_KERNEL Date: Mon, 16 Jan 2023 23:48:00 +0800 Message-Id: <20230116154800.2396-5-jszhang@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230116154800.2396-1-jszhang@kernel.org> References: <20230116154800.2396-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230116_075827_281886_79157022 X-CRM114-Status: UNSURE ( 8.85 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Now, after that all the sections are explicitly described and declared in vmlinux.lds.S, we can enable ld orphan warnings for !XIP_KERNEL to prevent from missing any new sections in future. Signed-off-by: Jisheng Zhang --- arch/riscv/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index e2b656043abf..335e0c45cced 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -46,6 +46,7 @@ config RISCV select ARCH_WANT_FRAME_POINTERS select ARCH_WANT_GENERAL_HUGETLB select ARCH_WANT_HUGE_PMD_SHARE if 64BIT + select ARCH_WANT_LD_ORPHAN_WARN if !XIP_KERNEL select ARCH_WANTS_THP_SWAP if HAVE_ARCH_TRANSPARENT_HUGEPAGE select BINFMT_FLAT_NO_DATA_START_OFFSET if !MMU select BUILDTIME_TABLE_SORT if MMU