diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a9b4f4d09c..b26ac8a5bcc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - ESP32-S3: Fix calculation of PSRAM start address - Fixed wrong variable access (FOSC CLK calibration for ESP32-C6 #593) - Fixed [trap location in ram](https://github.com/esp-rs/esp-hal/pull/605#issuecomment-1604039683) (#605) +- Fixed a possible overlap of `.data` and `.rwtext` (#616) + ### Changed - Improve examples documentation (#533) diff --git a/esp-hal-common/ld/sections/rodata.x b/esp-hal-common/ld/sections/rodata.x index 2d9bd9c050a..1bdb9e8150c 100644 --- a/esp-hal-common/ld/sections/rodata.x +++ b/esp-hal-common/ld/sections/rodata.x @@ -8,10 +8,13 @@ SECTIONS { *(.rodata .rodata.*) *(.srodata .srodata.*) _rodata_end = ABSOLUTE(.); + . = ALIGN(4); } > RODATA .rodata.wifi : ALIGN(4) { + . = ALIGN(4); *( .rodata_wlog_*.* ) + . = ALIGN(4); } > RODATA } \ No newline at end of file diff --git a/esp-hal-common/ld/sections/rtc_fast.x b/esp-hal-common/ld/sections/rtc_fast.x index 59df8341e4a..3bf5e1dd2f7 100644 --- a/esp-hal-common/ld/sections/rtc_fast.x +++ b/esp-hal-common/ld/sections/rtc_fast.x @@ -3,7 +3,8 @@ SECTIONS { .rtc_fast.text : { . = ALIGN(4); - *(.rtc_fast.literal .rtc_fast.text .rtc_fast.literal.* .rtc_fast.text.*) + *(.rtc_fast.literal .rtc_fast.text .rtc_fast.literal.* .rtc_fast.text.*) + . = ALIGN(4); } > RTC_FAST_RWTEXT AT > RODATA .rtc_fast.data : @@ -12,6 +13,7 @@ SECTIONS { _rtc_fast_data_start = ABSOLUTE(.); *(.rtc_fast.data .rtc_fast.data.*) _rtc_fast_data_end = ABSOLUTE(.); + . = ALIGN(4); } > RTC_FAST_RWDATA AT > RODATA .rtc_fast.bss (NOLOAD) : @@ -20,11 +22,13 @@ SECTIONS { _rtc_fast_bss_start = ABSOLUTE(.); *(.rtc_fast.bss .rtc_fast.bss.*) _rtc_fast_bss_end = ABSOLUTE(.); + . = ALIGN(4); } > RTC_FAST_RWDATA .rtc_fast.noinit (NOLOAD) : { . = ALIGN(4); *(.rtc_fast.noinit .rtc_fast.noinit.*) + . = ALIGN(4); } > RTC_FAST_RWDATA } \ No newline at end of file diff --git a/esp-hal-common/ld/sections/rtc_slow.x b/esp-hal-common/ld/sections/rtc_slow.x index 0f90c5f271e..035e95ca9a5 100644 --- a/esp-hal-common/ld/sections/rtc_slow.x +++ b/esp-hal-common/ld/sections/rtc_slow.x @@ -3,7 +3,8 @@ SECTIONS { .rtc_slow.text : { . = ALIGN(4); - *(.rtc_slow.literal .rtc_slow.text .rtc_slow.literal.* .rtc_slow.text.*) + *(.rtc_slow.literal .rtc_slow.text .rtc_slow.literal.* .rtc_slow.text.*) + . = ALIGN(4); } > rtc_slow_seg AT > RODATA .rtc_slow.data : @@ -12,6 +13,7 @@ SECTIONS { _rtc_slow_data_start = ABSOLUTE(.); *(.rtc_slow.data .rtc_slow.data.*) _rtc_slow_data_end = ABSOLUTE(.); + . = ALIGN(4); } > rtc_slow_seg AT > RODATA .rtc_slow.bss (NOLOAD) : @@ -20,11 +22,13 @@ SECTIONS { _rtc_slow_bss_start = ABSOLUTE(.); *(.rtc_slow.bss .rtc_slow.bss.*) _rtc_slow_bss_end = ABSOLUTE(.); + . = ALIGN(4); } > rtc_slow_seg .rtc_slow.noinit (NOLOAD) : { . = ALIGN(4); *(.rtc_slow.noinit .rtc_slow.noinit.*) + . = ALIGN(4); } > rtc_slow_seg } \ No newline at end of file diff --git a/esp-hal-common/ld/sections/rwdata.x b/esp-hal-common/ld/sections/rwdata.x index 61a1b024f59..eda4cd3325a 100644 --- a/esp-hal-common/ld/sections/rwdata.x +++ b/esp-hal-common/ld/sections/rwdata.x @@ -9,6 +9,7 @@ SECTIONS { *(.data .data.*); *(.data1) _data_end = ABSOLUTE(.); + . = ALIGN(4); } > RWDATA AT > RODATA /* LMA of .data */ @@ -32,18 +33,21 @@ SECTIONS { *(.gnu.linkonce.b.*) *(COMMON) _bss_end = ABSOLUTE(.); + . = ALIGN(4); } > RWDATA .noinit (NOLOAD) : ALIGN(4) { . = ALIGN(4); *(.noinit .noinit.*) + . = ALIGN(4); } > RWDATA .data.wifi : { . = ALIGN(4); *( .dram1 .dram1.*) + . = ALIGN(4); } > RWDATA AT > RODATA /* must be last segment using RWDATA */ diff --git a/esp-hal-common/ld/sections/rwtext.x b/esp-hal-common/ld/sections/rwtext.x index 6cb5f5f0851..974b0b6c106 100644 --- a/esp-hal-common/ld/sections/rwtext.x +++ b/esp-hal-common/ld/sections/rwtext.x @@ -5,6 +5,7 @@ SECTIONS { { . = ALIGN (4); *(.rwtext.literal .rwtext .rwtext.literal.* .rwtext.*) + . = ALIGN(4); } > RWTEXT .rwtext.wifi : @@ -16,5 +17,6 @@ SECTIONS { *( .wifislpiram .wifislpiram.*) *( .phyiram .phyiram.*) *( .iram1 .iram1.*) + . = ALIGN(4); } > RWTEXT AT > RODATA } \ No newline at end of file