Skip to content

Commit 213bad1

Browse files
marekmatejaescolar
authored andcommitted
soc: espressif: add missing linker symbols
Provide missing symbols to the default linker scripts. Signed-off-by: Marek Matej <[email protected]>
1 parent a0d1b77 commit 213bad1

File tree

4 files changed

+17
-26
lines changed

4 files changed

+17
-26
lines changed

soc/espressif/esp32/default.ld

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,6 @@ SECTIONS
789789
*(.dynamic)
790790
*(.gnu.version_d)
791791
. = ALIGN(4);
792-
_rodata_end = ABSOLUTE(.);
793792
__rodata_region_end = ABSOLUTE(.);
794793
/* Literals are also RO data. */
795794
_lit4_start = ABSOLUTE(.);
@@ -846,6 +845,7 @@ SECTIONS
846845
_stext = .;
847846
_instruction_reserved_start = ABSOLUTE(.); /* This is a symbol marking the flash.text start, this can be used for mmu driver to maintain virtual address */
848847
_text_start = ABSOLUTE(.);
848+
__text_region_start = ABSOLUTE(.);
849849

850850
#ifndef CONFIG_ESP32_WIFI_IRAM_OPT
851851
*libnet80211.a:( .wifi0iram .wifi0iram.* .wifislpiram .wifislpiram.*)
@@ -864,6 +864,7 @@ SECTIONS
864864
. = ALIGN(4);
865865
_text_end = ABSOLUTE(.);
866866
_instruction_reserved_end = ABSOLUTE(.); /* This is a symbol marking the flash.text end, this can be used for mmu driver to maintain virtual address */
867+
__text_region_end = ABSOLUTE(.);
867868
_etext = .;
868869
} GROUP_DATA_LINK_IN(FLASH_CODE_REGION, ROMABLE_REGION)
869870

soc/espressif/esp32c3/default.ld

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ SECTIONS
658658
*(.rodata_desc .rodata_desc.*)
659659
*(.rodata_custom_desc .rodata_custom_desc.*)
660660

661-
__rodata_region_start = .;
661+
__rodata_region_start = ABSOLUTE(.);
662662

663663
. = ALIGN(4);
664664
#include <snippets-rodata.ld>
@@ -684,7 +684,7 @@ SECTIONS
684684
*(.xt_except_desc_end)
685685
*(.dynamic)
686686
*(.gnu.version_d)
687-
__rodata_region_end = .;
687+
__rodata_region_end = ABSOLUTE(.);
688688
_rodata_end = ABSOLUTE(.);
689689
/* Literals are also RO data. */
690690
_lit4_start = ABSOLUTE(.);
@@ -745,6 +745,7 @@ SECTIONS
745745
_instruction_reserved_start = ABSOLUTE(.);
746746
_text_start = ABSOLUTE(.);
747747
_instruction_reserved_start = ABSOLUTE(.);
748+
__text_region_start = ABSOLUTE(.);
748749

749750
#if !defined(CONFIG_ESP32_WIFI_IRAM_OPT)
750751
*libnet80211.a:( .wifi0iram .wifi0iram.* .wifislpiram .wifislpiram.*)
@@ -765,24 +766,19 @@ SECTIONS
765766

766767
*(.gnu.version)
767768

768-
/** CPU will try to prefetch up to 16 bytes of
769-
* of instructions. This means that any configuration (e.g. MMU, PMS) must allow
770-
* safe access to up to 16 bytes after the last real instruction, add
771-
* dummy bytes to ensure this
772-
*/
769+
/* CPU will try to prefetch up to 16 bytes of
770+
* of instructions. This means that any configuration (e.g. MMU, PMS) must allow
771+
* safe access to up to 16 bytes after the last real instruction, add
772+
* dummy bytes to ensure this
773+
*/
773774
. += 16;
774775

775776
_instruction_reserved_end = ABSOLUTE(.);
776777
_text_end = ABSOLUTE(.);
777778
_instruction_reserved_end = ABSOLUTE(.);
779+
__text_region_end = ABSOLUTE(.);
778780
_etext = .;
779781

780-
/**
781-
* Similar to _iram_start, this symbol goes here so it is
782-
* resolved by addr2line in preference to the first symbol in
783-
* the flash.text segment.
784-
*/
785-
//_flash_cache_start = ABSOLUTE(0);
786782
} GROUP_DATA_LINK_IN(FLASH_CODE_REGION, ROMABLE_REGION)
787783

788784
/* --- END OF .flash.text --- */

soc/espressif/esp32s2/default.ld

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ SECTIONS
839839
*(.dynamic)
840840
*(.gnu.version_d)
841841
. = ALIGN(4);
842-
__rodata_region_end = ABSOLUTE(.);
842+
_rodata_end = ABSOLUTE(.);
843843
/* Literals are also RO data. */
844844
_lit4_start = ABSOLUTE(.);
845845
*(*.lit4)
@@ -868,8 +868,8 @@ SECTIONS
868868
{
869869
. = ALIGN(CACHE_ALIGN);
870870
_image_rodata_end = ABSOLUTE(.);
871-
_rodata_region_end = ABSOLUTE(.);
872871
_rodata_reserved_end = ABSOLUTE(.);
872+
__rodata_region_end = ABSOLUTE(.);
873873

874874
} GROUP_DATA_LINK_IN(RODATA_REGION, ROMABLE_REGION)
875875

@@ -891,6 +891,7 @@ SECTIONS
891891
_stext = .;
892892
_instruction_reserved_start = ABSOLUTE(.);
893893
_text_start = ABSOLUTE(.);
894+
__text_region_start = ABSOLUTE(.);
894895

895896
#if !defined(CONFIG_ESP32_WIFI_IRAM_OPT)
896897
*libnet80211.a:( .wifi0iram .wifi0iram.* .wifislpiram .wifislpiram.*)
@@ -919,13 +920,9 @@ SECTIONS
919920

920921
_text_end = ABSOLUTE(.);
921922
_instruction_reserved_end = ABSOLUTE(.); /* This is a symbol marking the flash.text end, this can be used for mmu driver to maintain virtual address */
923+
__text_region_end = ABSOLUTE(.);
922924
_etext = .;
923925

924-
/* Similar to _iram_start, this symbol goes here so it is
925-
* resolved by addr2line in preference to the first symbol in
926-
* the flash.text segment.
927-
*/
928-
_flash_cache_start = ABSOLUTE(0);
929926
} GROUP_DATA_LINK_IN(ROTEXT_REGION, ROMABLE_REGION)
930927

931928
/* --- END OF .flash.text --- */

soc/espressif/esp32s3/default.ld

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,7 @@ SECTIONS
744744
_stext = .;
745745
_instruction_reserved_start = ABSOLUTE(.);
746746
_text_start = ABSOLUTE(.);
747+
__text_region_start = ABSOLUTE(.);
747748

748749
#if !defined(CONFIG_ESP32_WIFI_IRAM_OPT)
749750
*libnet80211.a:( .wifi0iram .wifi0iram.* .wifislpiram .wifislpiram.*)
@@ -771,13 +772,9 @@ SECTIONS
771772

772773
_text_end = ABSOLUTE(.);
773774
_instruction_reserved_end = ABSOLUTE(.); /* This is a symbol marking the flash.text end, this can be used for mmu driver to maintain virtual address */
775+
__text_region_end = ABSOLUTE(.);
774776
_etext = .;
775777

776-
/* Similar to _iram_start, this symbol goes here so it is
777-
* resolved by addr2line in preference to the first symbol in
778-
* the flash.text segment.
779-
*/
780-
//_flash_cache_start = ABSOLUTE(0);
781778
} GROUP_DATA_LINK_IN(FLASH_CODE_REGION, ROMABLE_REGION)
782779

783780
/* This dummy section represents the .flash.text section but in default_rodata_seg.

0 commit comments

Comments
 (0)