From cda8da622d688c8ab3ad22c1e75e0584d7739087 Mon Sep 17 00:00:00 2001 From: Philip Gladstone Date: Sat, 7 Apr 2018 16:44:42 -0400 Subject: [PATCH] Put each ICACHE_RAM_ATTR function in its own section. (#2334) * Put each ICACHE_RAM_ATTR function in its own section. * Chached the macro names to be less likely to cause problems --- app/include/user_config.h | 4 +++- ld/nodemcu.ld | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/include/user_config.h b/app/include/user_config.h index 0160d840..85db96d8 100644 --- a/app/include/user_config.h +++ b/app/include/user_config.h @@ -52,7 +52,9 @@ extern void luaL_assertfail(const char *file, int line, const char *message); #define ICACHE_STORE_TYPEDEF_ATTR __attribute__((aligned(4),packed)) #define ICACHE_STORE_ATTR __attribute__((aligned(4))) -#define ICACHE_RAM_ATTR __attribute__((section(".iram0.text"))) +#define ICACHE_RAM_STRING(x) ICACHE_RAM_STRING2(x) +#define ICACHE_RAM_STRING2(x) #x +#define ICACHE_RAM_ATTR __attribute__((section(".iram0.text." __FILE__ "." ICACHE_RAM_STRING(__LINE__)))) #ifdef GPIO_SAFE_NO_INTR_ENABLE #define NO_INTR_CODE ICACHE_RAM_ATTR __attribute__ ((noinline)) #else diff --git a/ld/nodemcu.ld b/ld/nodemcu.ld index 9488045a..9c0a0dc1 100644 --- a/ld/nodemcu.ld +++ b/ld/nodemcu.ld @@ -121,7 +121,7 @@ SECTIONS /* *libwpa.a:*(.literal .text) - tested that safe to keep in iROM */ /* *libwps.a:*(.literal .text) - tested that safe to keep in iROM */ - *(.iram.text .iram0.text) + *(.iram.text .iram0.text .iram0.text.*) *(.stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)