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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9A2BC636D4 for ; Tue, 7 Feb 2023 16:42:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231670AbjBGQmy (ORCPT ); Tue, 7 Feb 2023 11:42:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231622AbjBGQmu (ORCPT ); Tue, 7 Feb 2023 11:42:50 -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 7BBC676AF for ; Tue, 7 Feb 2023 08:42:47 -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 EBEFF60F3B for ; Tue, 7 Feb 2023 16:42:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9818EC4339B; Tue, 7 Feb 2023 16:42:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675788166; bh=/VdpoMtMa66d53ADOA7T8FLFwQUFmoaRRMXtxeZ3tF0=; h=From:To:Cc:Subject:Date:From; b=QZo0j0je9ovFBf+nj0zqSX8Nw/eWDl4xGzmPRNuxid5gjjSvPSYAGJCH/7FUqP930 ebpKqlcINwH2r3v5abAMfocaKqTOWBzRoVsPfTCW3jhaAgfzGr5Ke65ht53tPEtAQI B312PEFjIp6/ksBh3TY9QAnfH5gl2I4Coko5AWHbQZkjeHdyViwajaUBlUvKck4HA2 M5nrGMj8FwR3qrqnRJupNZqENoX5/NHqmxlTYcXVoA8jG2+wdQkcELPzY69s1QDXg5 V/m6ou6W+Gafzo+LGiUrw/YN3KJSgEfgRM8jMS6zBNRlUQYjEbYJOeqrRBO7eGW4Ux ekxANYooet6pg== From: Masahiro Yamada To: Richard Weinberger , Anton Ivanov , Johannes Berg , linux-um@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , SeongJae Park , Palmer Dabbelt Subject: [PATCH] UML: define RUNTIME_DISCARD_EXIT Date: Wed, 8 Feb 2023 01:41:56 +0900 Message-Id: <20230207164156.537378-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With CONFIG_VIRTIO_UML=y, GNU ld < 2.36 fails to link UML vmlinux (w/wo CONFIG_LD_SCRIPT_STATIC). `.exit.text' referenced in section `.uml.exitcall.exit' of arch/um/drivers/virtio_uml.o: defined in discarded section `.exit.text' of arch/um/drivers/virtio_uml.o collect2: error: ld returned 1 exit status This fix is similar to the following commits: - 4b9880dbf3bd ("powerpc/vmlinux.lds: Define RUNTIME_DISCARD_EXIT") - a494398bde27 ("s390: define RUNTIME_DISCARD_EXIT to fix link error with GNU ld < 2.36") - c1c551bebf92 ("sh: define RUNTIME_DISCARD_EXIT") Fixes: 99cb0d917ffa ("arch: fix broken BuildID for arm64 and riscv") Reported-by: SeongJae Park Signed-off-by: Masahiro Yamada --- arch/um/kernel/vmlinux.lds.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/um/kernel/vmlinux.lds.S b/arch/um/kernel/vmlinux.lds.S index 16e49bfa2b42..53d719c04ba9 100644 --- a/arch/um/kernel/vmlinux.lds.S +++ b/arch/um/kernel/vmlinux.lds.S @@ -1,4 +1,4 @@ - +#define RUNTIME_DISCARD_EXIT KERNEL_STACK_SIZE = 4096 * (1 << CONFIG_KERNEL_STACK_ORDER); #ifdef CONFIG_LD_SCRIPT_STATIC -- 2.34.1