Skip to content

Commit

Permalink
Strip the debug information if CONFIG_DEBUG_SYMBOLS isn't enable.
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxiang781216 committed Mar 22, 2020
1 parent da31673 commit d614ee8
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 30 deletions.
5 changes: 3 additions & 2 deletions Application.mk
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ endef
define ELFLD
@echo "LD: $2"
$(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) $(ARCHCRT0OBJ) $1 $(LDLIBS) -o $2
# $(Q) $(STRIP) $2
$(Q) chmod +x $2
endef

$(AOBJS): %$(SUFFIX)$(OBJEXT): %.S
Expand Down Expand Up @@ -157,6 +155,9 @@ ifeq ($(WINTOOL),y)
$(call ELFLD,$(firstword $(PROGOBJ)),"${shell cygpath -w $(firstword $(PROGLIST))}")
else
$(call ELFLD,$(firstword $(PROGOBJ)),$(firstword $(PROGLIST)))
endif
ifneq ($(CONFIG_DEBUG_SYMBOLS),y)
$(Q) $(STRIP) $(firstword $(PROGLIST))
endif
$(eval PROGLIST=$(filter-out $(firstword $(PROGLIST)),$(PROGLIST)))
$(eval PROGOBJ=$(filter-out $(firstword $(PROGOBJ)),$(PROGOBJ)))
Expand Down
11 changes: 0 additions & 11 deletions examples/elf/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,6 @@ config EXAMPLES_ELF_DEVPATH
file system containing the ELF executables to be tested. Default:
"/dev/ram0" for ROMFS, "/dev/mmcsd0" for the external file system.

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
Expand Down
4 changes: 1 addition & 3 deletions examples/elf/tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,9 @@ build: $(foreach DIR, $(BUILD_SUBDIRS), $(DIR)_build)
# Install each program in the file system image directory

install: $(foreach DIR, $(BUILD_SUBDIRS), $(DIR)_install)
ifneq ($(STRIP),)
ifneq ($(CONFIG_EXAMPLES_ELF_NOSTRIP),y)
ifneq ($(CONFIG_DEBUG_SYMBOLS),y)
$(Q) $(STRIP) $(wildcard $(FSIMG_SUBDIR)/*)
endif
endif

# Create the file system image directory

Expand Down
11 changes: 0 additions & 11 deletions examples/module/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,6 @@ config EXAMPLES_MODULE_BINDIR
The full, absolute path to the location for the binaries can be
located in a pre-mounted external file system.

config EXAMPLES_MODULE_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_MODULE_LIBC
bool "Link with LIBC"
default n
Expand Down
4 changes: 1 addition & 3 deletions examples/module/drivers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,9 @@ build: $(foreach DIR, $(BUILD_SUBDIRS), $(DIR)_build)
# Install each program in the fsroot directory

install: $(foreach DIR, $(BUILD_SUBDIRS), $(DIR)_install)
ifneq ($(STRIP),)
ifneq ($(CONFIG_EXAMPLES_MODULE_NOSTRIP),y)
ifneq ($(CONFIG_DEBUG_SYMBOLS),y)
$(Q) $(STRIP) $(wildcard $(FSIMG_SUBDIR)$(DELIM)*)
endif
endif

# Create the fsroot directory

Expand Down

0 comments on commit d614ee8

Please sign in to comment.