Discuss here different C compiler set ups, and compiling executables for the ESP8266

User avatar
By eriksl
#23327
With -ffunction-sections you get each function in its own section...

For MY code. But MY code is not the problem. The code in the libraries is the problem. I don't have functions in iram0. As long as the libraries (gcc/c) are not properly divided over iram and irom, this will remain a problem.
Last edited by eriksl on Wed Jul 15, 2015 8:21 am, edited 1 time in total.
User avatar
By eriksl
#23328
cal wrote:The ROM contains some floating point stuff, too.
Using those has the additional advantage that its interrupt safe.

That code is used automatically, the symbols from the rom are pulled in at the bottom of the ld scripts.
User avatar
By jcmvbkbc
#23359
eriksl wrote:
With -ffunction-sections you get each function in its own section...

For MY code. But MY code is not the problem. The code in the libraries is the problem. I don't have functions in iram0. As long as the libraries (gcc/c) are not properly divided over iram and irom, this will remain a problem.

I think gcc libraries and libc are written in the spirit of C, i.e. one function per source file, which makes the result equivalent to one achievable with -ffunction-sections. But feel free to submit patches for the gcc/libc anyway.

Regarding IRAM/FLASH division, I think it must start in the SDK, clearly separating IRAM-only code from the rest, then clearly marking callback functions as IRAM-only. Then applications may have some hope to automate moving the rest of code to IRAM or FLASH. Without that I can only think of manual case-by-case function moving. Or some hacks like that: https://github.com/anakod/Sming/blob/ma ... rq_check.s applicable only to our code again.
Maybe somebody should suggest SDK developers to think about doing that.