[PATCH] um: fix CONFIG_GCOV for built-in code

Kees Cook kees at kernel.org
Wed Sep 23 20:42:24 PDT 2026


On Mon, 27 Jul 2026 13:55:15 -0600, Alex Hung wrote:
> 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.
> 
> [...]

Applied to for-next/hardening, thanks! Only a 5 year delay. :P
What else is needed from the original series to get the full coverage?
https://lore.kernel.org/all/20210312095526.197739-1-johannes@sipsolutions.net/

[1/1] um: fix CONFIG_GCOV for built-in code
      https://git.kernel.org/kees/c/760f96b7f54b

Take care,

-Kees

-- 
Kees Cook




More information about the linux-um mailing list