mirror of
https://github.com/esp8266/Arduino.git
synced 2025-05-09 16:41:02 +03:00
Fix placement of code into RAM, enable gc-sections
Related to #856, #826, #803, #734
This commit is contained in:
parent
1ea2722d9d
commit
fe04165bbe
@ -16,18 +16,18 @@ compiler.sdk.path={runtime.platform.path}/tools/sdk
|
|||||||
compiler.cpreprocessor.flags=-D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-I{compiler.sdk.path}/include"
|
compiler.cpreprocessor.flags=-D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-I{compiler.sdk.path}/include"
|
||||||
|
|
||||||
compiler.c.cmd=xtensa-lx106-elf-gcc
|
compiler.c.cmd=xtensa-lx106-elf-gcc
|
||||||
compiler.c.flags=-c -Os -g -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -falign-functions=4 -MMD -std=gnu99
|
compiler.c.flags=-c -Os -g -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -falign-functions=4 -MMD -std=gnu99 -ffunction-sections -fdata-sections
|
||||||
|
|
||||||
compiler.S.cmd=xtensa-lx106-elf-gcc
|
compiler.S.cmd=xtensa-lx106-elf-gcc
|
||||||
compiler.S.flags=-c -g -x assembler-with-cpp -MMD
|
compiler.S.flags=-c -g -x assembler-with-cpp -MMD
|
||||||
|
|
||||||
compiler.c.elf.flags=-g -Os -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" "-T{build.flash_ld}" -Wl,-wrap,system_restart_local -Wl,-wrap,register_chipv6_phy
|
compiler.c.elf.flags=-g -Os -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" "-T{build.flash_ld}" -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,register_chipv6_phy
|
||||||
|
|
||||||
compiler.c.elf.cmd=xtensa-lx106-elf-gcc
|
compiler.c.elf.cmd=xtensa-lx106-elf-gcc
|
||||||
compiler.c.elf.libs=-lm -lgcc -lhal -lphy -lnet80211 -llwip -lwpa -lmain -lpp -lsmartconfig -lwps -lcrypto -laxtls
|
compiler.c.elf.libs=-lm -lgcc -lhal -lphy -lnet80211 -llwip -lwpa -lmain -lpp -lsmartconfig -lwps -lcrypto -laxtls
|
||||||
|
|
||||||
compiler.cpp.cmd=xtensa-lx106-elf-g++
|
compiler.cpp.cmd=xtensa-lx106-elf-g++
|
||||||
compiler.cpp.flags=-c -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -MMD
|
compiler.cpp.flags=-c -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -MMD -ffunction-sections -fdata-sections
|
||||||
|
|
||||||
compiler.as.cmd=xtensa-lx106-elf-as
|
compiler.as.cmd=xtensa-lx106-elf-as
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ typedef enum {
|
|||||||
|
|
||||||
#ifdef ICACHE_FLASH
|
#ifdef ICACHE_FLASH
|
||||||
#define ICACHE_FLASH_ATTR __attribute__((section(".irom0.text")))
|
#define ICACHE_FLASH_ATTR __attribute__((section(".irom0.text")))
|
||||||
#define ICACHE_RAM_ATTR __attribute__((section(".text")))
|
#define ICACHE_RAM_ATTR __attribute__((section(".iram.text")))
|
||||||
#define ICACHE_RODATA_ATTR __attribute__((section(".irom.text")))
|
#define ICACHE_RODATA_ATTR __attribute__((section(".irom.text")))
|
||||||
#else
|
#else
|
||||||
#define ICACHE_FLASH_ATTR
|
#define ICACHE_FLASH_ATTR
|
||||||
|
@ -150,12 +150,11 @@ SECTIONS
|
|||||||
.irom0.text : ALIGN(4)
|
.irom0.text : ALIGN(4)
|
||||||
{
|
{
|
||||||
_irom0_text_start = ABSOLUTE(.);
|
_irom0_text_start = ABSOLUTE(.);
|
||||||
*core_esp8266_*.o(.literal*, .text*)
|
*.c.o(.literal*, .text*)
|
||||||
*spiffs*.o(.literal*, .text*)
|
|
||||||
*.cpp.o(.literal*, .text*)
|
*.cpp.o(.literal*, .text*)
|
||||||
*libm.a:(.literal .text .literal.* .text.*)
|
*libm.a:(.literal .text .literal.* .text.*)
|
||||||
*libsmartconfig.a:(.literal .text .literal.* .text.*)
|
*libsmartconfig.a:(.literal .text .literal.* .text.*)
|
||||||
*(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text)
|
*(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text .irom.text.*)
|
||||||
_irom0_text_end = ABSOLUTE(.);
|
_irom0_text_end = ABSOLUTE(.);
|
||||||
_flash_code_end = ABSOLUTE(.);
|
_flash_code_end = ABSOLUTE(.);
|
||||||
} >irom0_0_seg :irom0_0_phdr
|
} >irom0_0_seg :irom0_0_phdr
|
||||||
@ -192,6 +191,8 @@ SECTIONS
|
|||||||
*(.init.literal)
|
*(.init.literal)
|
||||||
*(.init)
|
*(.init)
|
||||||
*(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
|
*(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
|
||||||
|
*.cpp.o(.iram.text)
|
||||||
|
*.c.o(.iram.text)
|
||||||
*(.fini.literal)
|
*(.fini.literal)
|
||||||
*(.fini)
|
*(.fini)
|
||||||
*(.gnu.version)
|
*(.gnu.version)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user