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

User avatar
By igrr
#1376 I'm looking for a way to put all functions defined in an object file into irom0.text section. Is there a way other than adding ICACHE_FLASH_ATTR (i.e. __attribute__((section(".irom0.text")))) to every function definition?
man ld did not reveal anything for me, unfortunately.
User avatar
By jcmvbkbc
#1385
igrr wrote:I'm looking for a way to put all functions defined in an object file into irom0.text section. Is there a way other than adding ICACHE_FLASH_ATTR (i.e. __attribute__((section(".irom0.text")))) to every function definition?
man ld did not reveal anything for me, unfortunately.

You can add rules to .irom0.text output section that would match .text from your specific source file and exclude it from all other rules that match .text, e.g:
Code: Select all  .text : ALIGN(4)
  {
    _stext = .;
    _text_start = ABSOLUTE(.);
    *(.entry.text)
    *(.init.literal)
    *(.init)
    *(EXCLUDE_FILE(some_file.o) .literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
    *(.fini.literal)
    *(.fini)
    *(.gnu.version)
    _text_end = ABSOLUTE(.);
    _etext = .;
  } >iram1_0_seg :iram1_0_phdr

  .irom0.text : ALIGN(4)
  {
    _irom0_text_start = ABSOLUTE(.);
    *(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text)
    some_file.o(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
    _irom0_text_end = ABSOLUTE(.);
  } >irom0_0_seg :irom0_0_phdr
User avatar
By OpenThings
#1410 This is a GREAT job!
I have using toolchain compile the AT and IoT sample,and run it,now ALL SUCCESS.
Only esptool.py flash the firmware failed. If this OK,will can using linux to do all developing works.
I am using UbuntuKylin 14.04 X64.

Thanks @Zarya @jonsmirl @jcmvbkbc and all contributor.
https://github.com/esp8622
https://github.com/jcmvbkbc/crosstool-NG
User avatar
By igrr
#1415
jcmvbkbc wrote:You can add rules to .irom0.text output section that would match .text from your specific source file and exclude it from all other rules that match .text, e.g:

Oh, thanks a million. That worked great.