mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
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:
@@ -47,7 +47,7 @@ CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
|
||||
CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
|
||||
AFLAGS := $(CFLAGS) -D__ASSEMBLY__
|
||||
|
||||
CFLAGS += -ffunction-sections -fdata-sections
|
||||
CFLAGS +=
|
||||
|
||||
NXFLATLDFLAGS1 = -r -Wl,-d -Wl,-warn-common
|
||||
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -Wl,-no-check-sections
|
||||
@@ -56,5 +56,3 @@ LDNXFLATFLAGS = -e main -s 2048
|
||||
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
||||
LDFLAGS += -g
|
||||
endif
|
||||
|
||||
LDFLAGS += --gc-sections
|
||||
|
||||
Reference in New Issue
Block a user