Strip the debug information if CONFIG_DEBUG_SYMBOLS isn't enable.

This commit is contained in:
Xiang Xiao 2020-03-22 09:46:58 -05:00 committed by GitHub
parent da31673ddf
commit d614ee8efa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 30 deletions

View File

@ -112,8 +112,6 @@ endef
define ELFLD define ELFLD
@echo "LD: $2" @echo "LD: $2"
$(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) $(ARCHCRT0OBJ) $1 $(LDLIBS) -o $2 $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) $(ARCHCRT0OBJ) $1 $(LDLIBS) -o $2
# $(Q) $(STRIP) $2
$(Q) chmod +x $2
endef endef
$(AOBJS): %$(SUFFIX)$(OBJEXT): %.S $(AOBJS): %$(SUFFIX)$(OBJEXT): %.S
@ -157,6 +155,9 @@ ifeq ($(WINTOOL),y)
$(call ELFLD,$(firstword $(PROGOBJ)),"${shell cygpath -w $(firstword $(PROGLIST))}") $(call ELFLD,$(firstword $(PROGOBJ)),"${shell cygpath -w $(firstword $(PROGLIST))}")
else else
$(call ELFLD,$(firstword $(PROGOBJ)),$(firstword $(PROGLIST))) $(call ELFLD,$(firstword $(PROGOBJ)),$(firstword $(PROGLIST)))
endif
ifneq ($(CONFIG_DEBUG_SYMBOLS),y)
$(Q) $(STRIP) $(firstword $(PROGLIST))
endif endif
$(eval PROGLIST=$(filter-out $(firstword $(PROGLIST)),$(PROGLIST))) $(eval PROGLIST=$(filter-out $(firstword $(PROGLIST)),$(PROGLIST)))
$(eval PROGOBJ=$(filter-out $(firstword $(PROGOBJ)),$(PROGOBJ))) $(eval PROGOBJ=$(filter-out $(firstword $(PROGOBJ)),$(PROGOBJ)))

View File

@ -94,17 +94,6 @@ config EXAMPLES_ELF_DEVPATH
file system containing the ELF executables to be tested. Default: file system containing the ELF executables to be tested. Default:
"/dev/ram0" for ROMFS, "/dev/mmcsd0" for the external file system. "/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 config EXAMPLES_ELF_SYSCALL
bool "Link with SYSCALL library" bool "Link with SYSCALL library"
default n default n

View File

@ -94,11 +94,9 @@ build: $(foreach DIR, $(BUILD_SUBDIRS), $(DIR)_build)
# Install each program in the file system image directory # Install each program in the file system image directory
install: $(foreach DIR, $(BUILD_SUBDIRS), $(DIR)_install) 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)/*) $(Q) $(STRIP) $(wildcard $(FSIMG_SUBDIR)/*)
endif endif
endif
# Create the file system image directory # Create the file system image directory

View File

@ -114,17 +114,6 @@ config EXAMPLES_MODULE_BINDIR
The full, absolute path to the location for the binaries can be The full, absolute path to the location for the binaries can be
located in a pre-mounted external file system. 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 config EXAMPLES_MODULE_LIBC
bool "Link with LIBC" bool "Link with LIBC"
default n default n

View File

@ -76,11 +76,9 @@ build: $(foreach DIR, $(BUILD_SUBDIRS), $(DIR)_build)
# Install each program in the fsroot directory # Install each program in the fsroot directory
install: $(foreach DIR, $(BUILD_SUBDIRS), $(DIR)_install) install: $(foreach DIR, $(BUILD_SUBDIRS), $(DIR)_install)
ifneq ($(STRIP),) ifneq ($(CONFIG_DEBUG_SYMBOLS),y)
ifneq ($(CONFIG_EXAMPLES_MODULE_NOSTRIP),y)
$(Q) $(STRIP) $(wildcard $(FSIMG_SUBDIR)$(DELIM)*) $(Q) $(STRIP) $(wildcard $(FSIMG_SUBDIR)$(DELIM)*)
endif endif
endif
# Create the fsroot directory # Create the fsroot directory