]> granicus.if.org Git - esp-idf/commitdiff
linker scripts: Add explicit symbols for _iram_start and _flash_cache_start
authorAngus Gratton <angus@espressif.com>
Tue, 21 Mar 2017 08:29:57 +0000 (16:29 +0800)
committerAngus Gratton <angus@espressif.com>
Tue, 21 Mar 2017 08:45:13 +0000 (16:45 +0800)
This is to avoid confusion when idf_monitor prints the first symbol in each section, ie "WindowOverflow4" or similar,
when bootloader prints the section mapping address.

Closes #447 https://github.com/espressif/esp-idf/issues/447

components/esp32/ld/esp32.common.ld

index bc28e5ca99c9803c1cb0ab7e8f2f8cb8ce94a5ce..4b1a359631ba33fe3f282b4e38c559e3a6654830 100644 (file)
@@ -71,6 +71,10 @@ SECTIONS
     *(.init.literal)
     *(.init)
     _init_end = ABSOLUTE(.);
+
+    /* This goes here, not at top of linker script, so addr2line finds it last,
+       and uses it in preference to the first symbol in IRAM */
+    _iram_start = ABSOLUTE(0);
   } > iram0_0_seg
 
   .iram0.text :
@@ -193,5 +197,11 @@ SECTIONS
     *(.gnu.version)
     _text_end = ABSOLUTE(.);
     _etext = .;
+
+    /* Similar to _iram_start, this symbol goes here so it is
+       resolved by addr2line in preference to the first symbol in
+       the flash.text segment.
+    */
+    _flash_cache_start = ABSOLUTE(0);
   } >iram0_2_seg
 }