Skip to content

Commit dbacb0e

Browse files
author
Nicolas Pitre
committed
kconfig option for TRIM_UNUSED_KSYMS
The config option to enable it all. Signed-off-by: Nicolas Pitre <[email protected]> Acked-by: Rusty Russell <[email protected]>
1 parent dd92478 commit dbacb0e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

init/Kconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2012,6 +2012,22 @@ config MODULE_COMPRESS_XZ
20122012

20132013
endchoice
20142014

2015+
config TRIM_UNUSED_KSYMS
2016+
bool "Trim unused exported kernel symbols"
2017+
depends on MODULES && !UNUSED_SYMBOLS
2018+
help
2019+
The kernel and some modules make many symbols available for
2020+
other modules to use via EXPORT_SYMBOL() and variants. Depending
2021+
on the set of modules being selected in your kernel configuration,
2022+
many of those exported symbols might never be used.
2023+
2024+
This option allows for unused exported symbols to be dropped from
2025+
the build. In turn, this provides the compiler more opportunities
2026+
(especially when using LTO) for optimizing the code and reducing
2027+
binary size. This might have some security advantages as well.
2028+
2029+
If unsure say N.
2030+
20152031
endif # MODULES
20162032

20172033
config MODULES_TREE_LOOKUP

0 commit comments

Comments
 (0)