compile/opt: add config DEBUG_OPT_UNUSED_SECTIONS

Enable this option to optimization the unused input sections with the
linker by compiling with " -ffunction-sections -fdata-sections ", and
linking with " --gc-sections ".

Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
chao.an
2022-04-21 18:10:40 +08:00
committed by Xiang Xiao
parent 56ecd44f63
commit 64d7326ed5
46 changed files with 149 additions and 93 deletions
+13
View File
@@ -1956,6 +1956,19 @@ config DEBUG_OPTLEVEL
This string represents the custom optimization level that will be
used if DEBUG_CUSTOMOPT.
config DEBUG_OPT_UNUSED_SECTIONS
bool "Optimization to eliminate the unused input sections"
default y
depends on ARCH_TOOLCHAIN_GNU
---help---
Use these options on systems where the linker can perform optimizations
to improve locality of reference in the instruction space. Most systems
using the ELF object format have linkers with such optimizations.
Enable this option to optimization the unused input sections with the
linker by compiling with " -ffunction-sections -fdata-sections ", and
linking with " --gc-sections ".
endmenu # Build Setup
menu "System Type"