Received: by 2002:ac8:1418:0:b0:3ab:920c:4c8b with SMTP id k24csp440245qtj; Thu, 19 Jan 2023 08:14:23 -0800 (PST) X-Google-Smtp-Source: AMrXdXsel54pupyYdIrW+BJM+39wzf68vE3bcSVZRGBJtAcH8NAtFLK3gy+0PKzV4SaNA59zPpFR X-Received: by 2002:a17:902:848d:b0:192:fe4b:da3a with SMTP id c13-20020a170902848d00b00192fe4bda3amr11004130plo.10.1674144863727; Thu, 19 Jan 2023 08:14:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674144863; cv=none; d=google.com; s=arc-20160816; b=XvuoSiMr1zH1kfx5kF+uLXKq/AIPvuNI+8a/rnD5A7QckbDNOget358/wrv/YGb+J9 AS34gBn9u2LgewI6M+RA4m1lA/SvPu4Tx/O3ulhSr4I3ibdwpSg0BVzHnKPb4Sjzgu1R lqBWazP8KcmS93t/3J/R8ZequVpvQZhC0IL2ENcoVi9FuCpzPzsYpWm7R2ki12+aZH3X pSKMNgHnww7NTJmiGUxqv/Ot0gJdnY4k9VJzDhPbZsLE0etX7klAajm/lBi3NMghJwjx y+MCzYqZE+5Uofnzkzl1a65N5IbmxwWNTzzYiQu9cRURsMZ5bDlj1qTCFLHyVO8ZUrF2 P1tA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0ZNN5q+0UFtU5iDr8Ap93uhylhyvgSN/GhY/uvlK6/I=; b=LRLHEyD6unGl4rFBIW7aE3FUqZA2BhLqfS/FF06tmpRasVF5wLMAdDu+WZoGz0F9/o FU4wTjWTrXIqtybTrVFhPyJBKidQQFf8i9GRkDPQMppvsD/h3LpY2/IXFSBHqGTLKt9m 9oPKN+Skppw4kf4eBEOtoZU6mjxwofFK/KlFvi6jl+puufNb/dGhaSHBLVTr+w2UH61w KUjqdw9xBED+8iqEU8CrcQSGmw0uxh2YS2LjIidcr8a9qfM1E7bu4aWejKO3EhQ44AFf oLgY4SP2zFsE19gw5zf5DM1wNcThhvgmcPgkmZ+/hfC9nkqcbt+jHdGAgfBsqulO8+3m rTVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rGvlB0Cv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q20-20020a170902b11400b00187073496b4si37344928plr.136.2023.01.19.08.14.18; Thu, 19 Jan 2023 08:14:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rGvlB0Cv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229948AbjASQFN (ORCPT + 45 others); Thu, 19 Jan 2023 11:05:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229750AbjASQEp (ORCPT ); Thu, 19 Jan 2023 11:04:45 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D2DC66ED6 for ; Thu, 19 Jan 2023 08:04:40 -0800 (PST) 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 34B9C61CB2 for ; Thu, 19 Jan 2023 16:04:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9C585C433F0; Thu, 19 Jan 2023 16:04:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674144279; bh=J6NfBaiAHaZuC3c1U8Q2mwYoiCAI9Bs41guM1DxDgPc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rGvlB0CvLLTbE3PEOLaWlAM8hyCbtspLIpmMAXkQE65qKeOs1S5YQ6tFOIDNNMTzm +mfaKlbigHE/gP4UIVpLKkUE8RGRAFTkwiUgY7UbGhAwFnghvwDYSxA3c8c+df+tEU +TXbI3TJkWdTzjtp+4PwcoQY1uuf+slEpGzFUMAiEhuex7y9DTZRa3elnetXCqZEcg J6QyYJbwP7Ni+xJqI5I5SWy/e+hvTRPVgwtDMy3tasF8/13mclwc4BQKJhm/3nNxXs bV1G5T1YvVXfIcg3yoatppjIV7UlRoU3+cbjKK09/GhIkXKDRLZhxjqvpxAcSI/CyH gPkwFYrYYBfMA== From: Jisheng Zhang To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Masahiro Yamada , Kees Cook , Nathan Chancellor Cc: Conor Dooley , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/5] riscv: lds: define RUNTIME_DISCARD_EXIT Date: Thu, 19 Jan 2023 23:54:13 +0800 Message-Id: <20230119155417.2600-2-jszhang@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230119155417.2600-1-jszhang@kernel.org> References: <20230119155417.2600-1-jszhang@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 --- 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" -- 2.38.1