mirror of
https://github.com/esp8266/Arduino.git
synced 2025-08-09 22:24:14 +03:00
Makefile: use -f{function,data}-sections, don’t rename sections
Platform- and application-specific section placement is best done in the application makefiles and linker scripts. On the other hand, compiling with split sections allows code and data usage to be reduced without tuning specific options in config file.
This commit is contained in:
8
Makefile
8
Makefile
@@ -43,6 +43,8 @@ CFLAGS+=-std=c99 -DESP8266
|
||||
|
||||
CFLAGS += -Wall -Os -g -O2 -Wpointer-arith -Wl,-EL -nostdlib -mlongcalls -mno-text-section-literals -D__ets__ -DICACHE_FLASH
|
||||
|
||||
CFLAGS += -ffunction-sections -fdata-sections
|
||||
|
||||
MFORCE32 := $(shell $(CC) --help=target | grep mforce-l32)
|
||||
ifneq ($(MFORCE32),)
|
||||
# If the compiler supports the -mforce-l32 flag, the compiler will generate correct code for loading
|
||||
@@ -62,12 +64,6 @@ all: $(AXTLS_AR)
|
||||
$(AXTLS_AR): | $(BIN_DIR)
|
||||
|
||||
$(AXTLS_AR): $(OBJ_FILES)
|
||||
for file in $(OBJ_FILES); do \
|
||||
$(OBJCOPY) \
|
||||
--rename-section .text=.irom0.text \
|
||||
--rename-section .literal=.irom0.literal \
|
||||
$$file; \
|
||||
done
|
||||
$(AR) cru $@ $^
|
||||
|
||||
$(BIN_DIR):
|
||||
|
Reference in New Issue
Block a user