From 760f96b7f54beb8dc6f85d97ac7854fddba86835 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Mon, 27 Jul 2026 13:55:15 -0600 Subject: [PATCH] um: fix CONFIG_GCOV for built-in code With contemporary toolchains, CONFIG_GCOV doesn't work because gcov now relies on both init and exit handlers, but those are discarded from the binary. Fix the linker scripts to keep them instead, so that CONFIG_GCOV can work again. Note that this does not make it work in modules yet, since we don't call their exit handlers. Note: the .init_array.* wildcard and the RUNTIME_DISCARD_EXIT define are already present in this tree; only the matching .fini_array.* wildcard remained to be added. Signed-off-by: Johannes Berg Signed-off-by: Alex Hung Tested-by: Mariia Nikitash Link: https://patch.msgid.link/20260727195515.2306731-1-alex.hung@amd.com Signed-off-by: Kees Cook --- arch/um/include/asm/common.lds.S | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/um/include/asm/common.lds.S b/arch/um/include/asm/common.lds.S index fd481ac371de..2ed213913afe 100644 --- a/arch/um/include/asm/common.lds.S +++ b/arch/um/include/asm/common.lds.S @@ -91,6 +91,7 @@ .fini_array : { __fini_array_start = .; *(.fini_array) + *(.fini_array.*) __fini_array_end = .; }