Linux 4.7 Adds Option To Remove Exported Kernel Symbols That Go Unused
Normally the Kbuild pull requests for the Linux kernel merge windows tend to not be too noteworthy, but it's a bit different this time around for Linux 4.7.
The Kbuild changes for Linux 4.7 add the new CONFIG_TRIM_UNUSED_KSYMS option. Enabling this option will do a two-pass build where exported kernel symbols not used in that kernel's configuration are then removed/unexported.
With CONFIG_TRIM_UNUSED_KSYMS removing exported kernel symbols that aren't used by a particular kernel build, it's possible to further reduce the size of the generated kernel binary. Additionally, if pushing the kernel through Link Time Optimizations (LTO), removing the unused exported kernel symbols has the potential of offering more savings. It's also possible that removing such unused symbols could help with security aspects too.
This CONFIG_TRIM_UNUSED_KSYMS effort was led by Linaro and will be present in Linux 4.7. The Kbuild 4.7 PR can be found via the kernel mailing list.
The Kbuild changes for Linux 4.7 add the new CONFIG_TRIM_UNUSED_KSYMS option. Enabling this option will do a two-pass build where exported kernel symbols not used in that kernel's configuration are then removed/unexported.
With CONFIG_TRIM_UNUSED_KSYMS removing exported kernel symbols that aren't used by a particular kernel build, it's possible to further reduce the size of the generated kernel binary. Additionally, if pushing the kernel through Link Time Optimizations (LTO), removing the unused exported kernel symbols has the potential of offering more savings. It's also possible that removing such unused symbols could help with security aspects too.
This CONFIG_TRIM_UNUSED_KSYMS effort was led by Linaro and will be present in Linux 4.7. The Kbuild 4.7 PR can be found via the kernel mailing list.
