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

User avatar
By eriksl
#22477 I am running into the following problem. Almost all of my code runs in flash, no need for timing critical code. When I continue to add code there, I see the iram0 grow, still, to the point where it no longer fits. The culprit seems to be that a.o. functions from libgcc are pulled in (e.g. fp conversions) and apparently they're quite big.

Solution is quite simple, I think, move those functions to flash. Implementation is a bit harder ;)

There are two approaches I know of:
- change the linker script (see Mike Gore's posting), works for complete libraries, but not for discrete symbols (but if there is a way, please yell)
- recompile libgcc with certain functions in irom0_text segment, preferrable, I think, but not that easy

Are there other ways to achieve the same?
User avatar
By wififofum
#22523 In the makefile of UDK by CHERTS there is a section to create irom versions of libgcc and libc. Question is how to mark function calls as irom preferred and if they are not already linked into iram then link the irom version.
User avatar
By eriksl
#22832 Exactly. But it doesn't seem to be possible. You can either force a complete lib+section into a certain section or do it compile-time for a certain function, but you can't seem to do it link-time for a certain symbol.
User avatar
By jcmvbkbc
#22837
eriksl wrote:You can either force a complete lib+section into a certain section

Actually lib + object file in lib + section into a certain section.
eriksl wrote:but you can't seem to do it link-time for a certain symbol.

With -ffunction-sections you get each function in its own section...