Re: [PATCH v2] kbuild: allow symbol whitelisting with TRIM_UNUSED_KSYMS

From: Nicolas Pitre
Date: Thu Feb 06 2020 - 11:12:16 EST


On Thu, 6 Feb 2020, Jessica Yu wrote:

> Hm, I thought TRIM_UNUSED_KSYMS just *unexports* unused symbols, no?
> "Trimmed from the build" sounds like the symbols are not compiled in
> or dropped completely. Please correct me if I misunderstood.

If they are unexposed, then it doesn't make much sense to keep them
around wasting space. So yes, the compiler is free to optimize away the
unused code at that point.

Please see the first part of the following article where effective
kernel size reduction is is achieved with this feature:

https://lwn.net/Articles/746780/


Nicolas