From 213bad1de0fa21a0248faf7b6bd20c143f6626ff Mon Sep 17 00:00:00 2001 From: Marek Matej Date: Thu, 11 Apr 2024 14:18:50 +0200 Subject: [PATCH] soc: espressif: add missing linker symbols Provide missing symbols to the default linker scripts. Signed-off-by: Marek Matej --- soc/espressif/esp32/default.ld | 3 ++- soc/espressif/esp32c3/default.ld | 22 +++++++++------------- soc/espressif/esp32s2/default.ld | 11 ++++------- soc/espressif/esp32s3/default.ld | 7 ++----- 4 files changed, 17 insertions(+), 26 deletions(-) diff --git a/soc/espressif/esp32/default.ld b/soc/espressif/esp32/default.ld index 4f0ac082896..338a90b9964 100644 --- a/soc/espressif/esp32/default.ld +++ b/soc/espressif/esp32/default.ld @@ -789,7 +789,6 @@ SECTIONS *(.dynamic) *(.gnu.version_d) . = ALIGN(4); - _rodata_end = ABSOLUTE(.); __rodata_region_end = ABSOLUTE(.); /* Literals are also RO data. */ _lit4_start = ABSOLUTE(.); @@ -846,6 +845,7 @@ SECTIONS _stext = .; _instruction_reserved_start = ABSOLUTE(.); /* This is a symbol marking the flash.text start, this can be used for mmu driver to maintain virtual address */ _text_start = ABSOLUTE(.); + __text_region_start = ABSOLUTE(.); #ifndef CONFIG_ESP32_WIFI_IRAM_OPT *libnet80211.a:( .wifi0iram .wifi0iram.* .wifislpiram .wifislpiram.*) @@ -864,6 +864,7 @@ SECTIONS . = ALIGN(4); _text_end = ABSOLUTE(.); _instruction_reserved_end = ABSOLUTE(.); /* This is a symbol marking the flash.text end, this can be used for mmu driver to maintain virtual address */ + __text_region_end = ABSOLUTE(.); _etext = .; } GROUP_DATA_LINK_IN(FLASH_CODE_REGION, ROMABLE_REGION) diff --git a/soc/espressif/esp32c3/default.ld b/soc/espressif/esp32c3/default.ld index 120f66d852d..17e88337355 100644 --- a/soc/espressif/esp32c3/default.ld +++ b/soc/espressif/esp32c3/default.ld @@ -658,7 +658,7 @@ SECTIONS *(.rodata_desc .rodata_desc.*) *(.rodata_custom_desc .rodata_custom_desc.*) - __rodata_region_start = .; + __rodata_region_start = ABSOLUTE(.); . = ALIGN(4); #include @@ -684,7 +684,7 @@ SECTIONS *(.xt_except_desc_end) *(.dynamic) *(.gnu.version_d) - __rodata_region_end = .; + __rodata_region_end = ABSOLUTE(.); _rodata_end = ABSOLUTE(.); /* Literals are also RO data. */ _lit4_start = ABSOLUTE(.); @@ -745,6 +745,7 @@ SECTIONS _instruction_reserved_start = ABSOLUTE(.); _text_start = ABSOLUTE(.); _instruction_reserved_start = ABSOLUTE(.); + __text_region_start = ABSOLUTE(.); #if !defined(CONFIG_ESP32_WIFI_IRAM_OPT) *libnet80211.a:( .wifi0iram .wifi0iram.* .wifislpiram .wifislpiram.*) @@ -765,24 +766,19 @@ SECTIONS *(.gnu.version) - /** CPU will try to prefetch up to 16 bytes of - * of instructions. This means that any configuration (e.g. MMU, PMS) must allow - * safe access to up to 16 bytes after the last real instruction, add - * dummy bytes to ensure this - */ + /* CPU will try to prefetch up to 16 bytes of + * of instructions. This means that any configuration (e.g. MMU, PMS) must allow + * safe access to up to 16 bytes after the last real instruction, add + * dummy bytes to ensure this + */ . += 16; _instruction_reserved_end = ABSOLUTE(.); _text_end = ABSOLUTE(.); _instruction_reserved_end = ABSOLUTE(.); + __text_region_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); } GROUP_DATA_LINK_IN(FLASH_CODE_REGION, ROMABLE_REGION) /* --- END OF .flash.text --- */ diff --git a/soc/espressif/esp32s2/default.ld b/soc/espressif/esp32s2/default.ld index 89fb139f19c..0799af2ea4a 100644 --- a/soc/espressif/esp32s2/default.ld +++ b/soc/espressif/esp32s2/default.ld @@ -839,7 +839,7 @@ SECTIONS *(.dynamic) *(.gnu.version_d) . = ALIGN(4); - __rodata_region_end = ABSOLUTE(.); + _rodata_end = ABSOLUTE(.); /* Literals are also RO data. */ _lit4_start = ABSOLUTE(.); *(*.lit4) @@ -868,8 +868,8 @@ SECTIONS { . = ALIGN(CACHE_ALIGN); _image_rodata_end = ABSOLUTE(.); - _rodata_region_end = ABSOLUTE(.); _rodata_reserved_end = ABSOLUTE(.); + __rodata_region_end = ABSOLUTE(.); } GROUP_DATA_LINK_IN(RODATA_REGION, ROMABLE_REGION) @@ -891,6 +891,7 @@ SECTIONS _stext = .; _instruction_reserved_start = ABSOLUTE(.); _text_start = ABSOLUTE(.); + __text_region_start = ABSOLUTE(.); #if !defined(CONFIG_ESP32_WIFI_IRAM_OPT) *libnet80211.a:( .wifi0iram .wifi0iram.* .wifislpiram .wifislpiram.*) @@ -919,13 +920,9 @@ SECTIONS _text_end = ABSOLUTE(.); _instruction_reserved_end = ABSOLUTE(.); /* This is a symbol marking the flash.text end, this can be used for mmu driver to maintain virtual address */ + __text_region_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); } GROUP_DATA_LINK_IN(ROTEXT_REGION, ROMABLE_REGION) /* --- END OF .flash.text --- */ diff --git a/soc/espressif/esp32s3/default.ld b/soc/espressif/esp32s3/default.ld index 120fb083d38..93c9c3044b9 100644 --- a/soc/espressif/esp32s3/default.ld +++ b/soc/espressif/esp32s3/default.ld @@ -744,6 +744,7 @@ SECTIONS _stext = .; _instruction_reserved_start = ABSOLUTE(.); _text_start = ABSOLUTE(.); + __text_region_start = ABSOLUTE(.); #if !defined(CONFIG_ESP32_WIFI_IRAM_OPT) *libnet80211.a:( .wifi0iram .wifi0iram.* .wifislpiram .wifislpiram.*) @@ -771,13 +772,9 @@ SECTIONS _text_end = ABSOLUTE(.); _instruction_reserved_end = ABSOLUTE(.); /* This is a symbol marking the flash.text end, this can be used for mmu driver to maintain virtual address */ + __text_region_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); } GROUP_DATA_LINK_IN(FLASH_CODE_REGION, ROMABLE_REGION) /* This dummy section represents the .flash.text section but in default_rodata_seg.