Skip to content

Misc - do not set section attribute multiple times - #9334

Merged
mcspr merged 6 commits into
esp8266:masterfrom
mcspr:section-attr-unique
Nov 5, 2026
Merged

mcspr merged 6 commits into
esp8266:masterfrom
mcspr:section-attr-unique

Conversation

@mcspr

@mcspr mcspr commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Since IRAM_ATTR and ICACHE_FLASH_ATTR both generate unique names, header and compilation unit receive different values.

cores/esp8266/core_esp8266_si2c.cpp:268:44: warning: ignoring attribute 'section ("\".iram.text.core_esp8266_si2c.cpp.268.16\"")' because it conflicts with previous 'section ("\".iram.text.core_esp8266_si2c.cpp.148.12\"")' [-Wattributes]
  268 | void IRAM_ATTR Twi::busywait(unsigned int v)
      |                                            ^
cores/esp8266/core_esp8266_si2c.cpp:148:20: note: previous declaration here
  148 |     void IRAM_ATTR busywait(unsigned int v);
      |                    ^~~~~~~~

and etc.

mcspr added 5 commits November 5, 2026 12:29
> cores/esp8266/core_esp8266_si2c.cpp:268:44: warning: ignoring attribute 'section ("\".iram.text.core_esp8266_si2c.cpp.268.16\"")' because it conflicts with previous 'section ("\".iram.text.core_esp8266_si2c.cpp.148.12\"")' [-Wattributes]
>   268 | void IRAM_ATTR Twi::busywait(unsigned int v)
>       |                                            ^
> cores/esp8266/core_esp8266_si2c.cpp:148:20: note: previous declaration here
>   148 |     void IRAM_ATTR busywait(unsigned int v);
>       |                    ^~~~~~~~

etc.
continue fixes of section attribute being set multiple times
also clears up declarations incorrectly placing attr intended for func
> cores/esp8266/core_esp8266_phy.cpp:317:85: warning: ignoring attribute 'section ("\".iram.text.core_esp8266_phy.cpp.317.2\"")' because it conflicts with previous 'section ("\".iram.text.core_esp8266_phy.cpp.303.1\"")' [-Wattributes]
>   317 | extern int IRAM_ATTR __wrap_spi_flash_read(uint32_t addr, uint32_t* dst, size_t size)
>       |                                                                                     ^
> cores/esp8266/core_esp8266_phy.cpp:303:22: note: previous declaration here
>   303 | extern int IRAM_ATTR __wrap_spi_flash_read(uint32_t addr, uint32_t* dst, size_t size);
>       |                      ^~~~~~~~~~~~~~~~~~~~~
@mcspr
mcspr force-pushed the section-attr-unique branch from 3df01c3 to 0a34429 Compare November 5, 2026 09:31
section name is already used as string, do not assume it is a literal
injected somewhere e.g. for asm hints after `.section`
@mcspr
mcspr merged commit 672acde into esp8266:master Nov 5, 2026
28 checks passed
@mcspr
mcspr deleted the section-attr-unique branch November 5, 2026 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant