From 12baeaa22dc4d3d7a40b64cad7edeafd3420a8f9 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 25 Mar 2018 10:13:50 -0600 Subject: [PATCH] apps/examples/elf: Add an option to strip debug symbols even if the debug symbols are enabled in the base code. --- examples/elf/Kconfig | 11 +++++++++++ examples/elf/tests/Makefile | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/examples/elf/Kconfig b/examples/elf/Kconfig index 8bcb24eed..9832a3edf 100644 --- a/examples/elf/Kconfig +++ b/examples/elf/Kconfig @@ -48,6 +48,17 @@ config EXAMPLES_ELF_DEVPATH endif # EXAMPLES_ELF_ROMFS +config EXAMPLES_ELF_NOSTRIP + bool "Do not strip debug symbols" + default n + depends on DEBUG_SYMBOLS + ---help--- + By default, if debug symbols are enabled (via CONFIG_DEBUG_SYMBOLS), then the + ELF executables will also retain debug symbols in the resulting ELF binaries. + Select this option if you do not want that behavior, this option will permit + debug symbols in the base code but will strip debug symbols out of the ELF + binaries for a smaller ROM file system image. + config EXAMPLES_ELF_SYSCALL bool "Link with SYSCALL library" default n diff --git a/examples/elf/tests/Makefile b/examples/elf/tests/Makefile index 165dfaf05..a062ab187 100644 --- a/examples/elf/tests/Makefile +++ b/examples/elf/tests/Makefile @@ -101,7 +101,7 @@ build: $(foreach DIR, $(BUILD_SUBDIRS), $(DIR)_build) install: $(foreach DIR, $(BUILD_SUBDIRS), $(DIR)_install) ifneq ($(STRIP),) -ifneq ($(CONFIG_DEBUG_SYMBOLS),y) +ifneq ($(CONFIG_EXAMPLES_ELF_NOSTRIP),y) $(Q) $(STRIP) $(wildcard $(FSIMG_SUBDIR)/*) endif endif