Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1516950rdh; Mon, 25 Sep 2023 15:40:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGFFzJRYuNMYA6OmWrQTWblhH7ar81pwNOmSSyS3ZZ7koFom1ud0ob5eNdr0+pdFNNVgRTs X-Received: by 2002:a17:90a:6547:b0:269:46d7:f1db with SMTP id f7-20020a17090a654700b0026946d7f1dbmr7649684pjs.32.1695681618518; Mon, 25 Sep 2023 15:40:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695681618; cv=none; d=google.com; s=arc-20160816; b=Cq39Hjhu6YJStcsle9C8hzanfmdTqyXY9L72675GEQj3399MKyBVCHJCNrJviDkRxD nyhmc9mJmVflD4EEffZfSw8wHScp5POuTEcDo/CmtBmHtUxplW4roq4LVPsno7eyZhbi IqNARR46eVgie6eU74qsnoAOnRM/CjKGE2X3puXcf5No5OAg0Glvu4T0thhJWxPCVFtp oYICEaA+uU8n1OnTRU7vHv1RT8gg5clpTsvtgMGEen6cFjl8TCyg9e4uCxKMsEcoZa0V ftNABFS1bnLXzDXOt/a+OheB4jEENgFLhvuFbsg11jeXtj1+hAfV4/uWXngu/QFUuQ67 CH2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=I2D8zMZDc7yri2pOW8Ve0CIG2JRH8QwY5alDJsKqV6c=; fh=Hu5Z85mCjwbIpQ6O7J4KtGQomc/bitxjLDlxDRGGJ5w=; b=XJhEWfNEi/A76VV1uCVyip6eWt7KaclzIcz9nCiyFRCGyKYkNgLLJiRpuMuY+lkuA2 pYsdBoUpj/xKaQ2CUsCJc+C51/zf8ZEN3CZpc+DYX8/M/pCxjZysoVvCV09H8Ff48Wjs /S5lQMQaxlMlGj8UlWUaobTakGS0vdMVRR24Cz6CxtDrbs3uUOrAFNe3rAFbVKsnKyB7 ZdVdOIW+2BseB5GxFCrucL/8BemNAMpC/oIxMFj51aRh86RymDY2JnBVtARVoSdpWDSM 1g8ONb/z+kyw9m2wwFWKEsyUzTXTTQWwmaCkE3elvzPF9fbsZom2Z4FtmH7GlqOt1YXd 2WUw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id on17-20020a17090b1d1100b002777ccd05bcsi66643pjb.25.2023.09.25.15.40.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 15:40:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 0DFA68087CB8; Mon, 25 Sep 2023 15:35:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232432AbjIYWfc (ORCPT + 99 others); Mon, 25 Sep 2023 18:35:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232992AbjIYWfb (ORCPT ); Mon, 25 Sep 2023 18:35:31 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F8E1192; Mon, 25 Sep 2023 15:35:24 -0700 (PDT) X-QQ-mid: bizesmtp69t1695681314trhnno76 Received: from linux-lab-host.localdomain ( [116.30.124.152]) by bizesmtp.qq.com (ESMTP) with id ; Tue, 26 Sep 2023 06:35:13 +0800 (CST) X-QQ-SSF: 01200000002000E0Y000B00A0000000 X-QQ-FEAT: 5q30pvLz2ifym5SLIzsh144Znm6wRlu+bPV0w9peTQtfsIPVYY0hXdp41PdCD qNzUX3VU0ZbZvFxqzdl781ox5Wff3pzWuKKNI6Te1Y8Odq1dErSA2qLbFA/SMI2cKUrzOVs JqSkwphfZ1OdgeG+SXhsqzaC3EdPtZ01WiX3xWijTjjHsIaAgg69GAJkp+9VvBK+LXtqy1j nrLN7pG00O3beVVn6nNJXOacEGL+QVJsdzrevmusz0g8QdKt9Gmkrc6JmfWCThmyuCXGiVh gjxq5yWAioV+s2WgKuEpfsGOozhlcqRN+oC8EBu5Z9jN5LH+6xf8e1VBtfxSu4YLC8kyaQi XdE5S4RGw+7MohBQiYCuUk9wCwPZJByKg1RLiR97lDnE03vxkhVdJMeJFQ4NQ== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 1656431424344420643 From: Zhangjin Wu To: linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-riscv@lists.infradead.org, Arnd Bergmann Cc: falcon@tinylab.org, palmer@rivosinc.com, paul.walmsley@sifive.com, paulburton@kernel.org, paulmck@kernel.org, tsbogend@alpha.franken.de, w@1wt.eu, =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Tim Bird Subject: [PATCH v1 1/7] DCE: add debug support Date: Tue, 26 Sep 2023 06:35:11 +0800 Message-Id: <36d7ee5122e3a9c2b307cf6ab1a9508860fd7710.1695679700.git.falcon@tinylab.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 25 Sep 2023 15:35:34 -0700 (PDT) Enable --print-gc-sections for --gc-sections to monitor which sections are really eliminated. Signed-off-by: Zhangjin Wu --- Makefile | 3 +++ init/Kconfig | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/Makefile b/Makefile index 57698d048e2c..a4e522b747cb 100644 --- a/Makefile +++ b/Makefile @@ -938,6 +938,9 @@ ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION KBUILD_CFLAGS_KERNEL += -ffunction-sections -fdata-sections KBUILD_RUSTFLAGS_KERNEL += -Zfunction-sections=y LDFLAGS_vmlinux += --gc-sections +ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION_DEBUG +LDFLAGS_vmlinux += --print-gc-sections +endif endif ifdef CONFIG_SHADOW_CALL_STACK diff --git a/init/Kconfig b/init/Kconfig index 6d35728b94b2..4350d8ba7db4 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -1404,6 +1404,13 @@ config LD_DEAD_CODE_DATA_ELIMINATION present. This option is not well tested yet, so use at your own risk. +config LD_DEAD_CODE_DATA_ELIMINATION_DEBUG + bool "Debug dead code and data elimination (EXPERIMENTAL)" + depends on LD_DEAD_CODE_DATA_ELIMINATION + default n + help + Enable --print-gc-sections for --gc-sections + config LD_ORPHAN_WARN def_bool y depends on ARCH_WANT_LD_ORPHAN_WARN -- 2.25.1