[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <36d7ee5122e3a9c2b307cf6ab1a9508860fd7710.1695679700.git.falcon@tinylab.org>
Date: Tue, 26 Sep 2023 06:35:11 +0800
From: Zhangjin Wu <falcon@...ylab.org>
To: linux-kernel@...r.kernel.org, linux-mips@...r.kernel.org,
linux-riscv@...ts.infradead.org, Arnd Bergmann <arnd@...db.de>
Cc: falcon@...ylab.org, palmer@...osinc.com, paul.walmsley@...ive.com,
paulburton@...nel.org, paulmck@...nel.org,
tsbogend@...ha.franken.de, w@....eu,
Thomas Weißschuh <linux@...ssschuh.net>,
Tim Bird <tim.bird@...y.com>
Subject: [PATCH v1 1/7] DCE: add debug support
Enable --print-gc-sections for --gc-sections to monitor which sections
are really eliminated.
Signed-off-by: Zhangjin Wu <falcon@...ylab.org>
---
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
Powered by blists - more mailing lists