diff --git a/soc/espressif/esp32/default.ld b/soc/espressif/esp32/default.ld index 919e8a9ef0f..dec0309cb2c 100644 --- a/soc/espressif/esp32/default.ld +++ b/soc/espressif/esp32/default.ld @@ -47,6 +47,10 @@ user_dram_2_seg_len = SRAM1_USER_SIZE; #undef GROUP_ROM_LINK_IN #define GROUP_ROM_LINK_IN(vregion, lregion) > RODATA_REGION AT > lregion +/* Make sure new sections have consistent alignment between input and output sections */ +#undef SECTION_PROLOGUE +#define SECTION_PROLOGUE SECTION_DATA_PROLOGUE + MEMORY { #ifdef CONFIG_BOOTLOADER_MCUBOOT diff --git a/soc/espressif/esp32c3/default.ld b/soc/espressif/esp32c3/default.ld index cd7308c1593..62b16137224 100644 --- a/soc/espressif/esp32c3/default.ld +++ b/soc/espressif/esp32c3/default.ld @@ -41,6 +41,10 @@ user_dram_seg_len = user_idram_size; #undef GROUP_ROM_LINK_IN #define GROUP_ROM_LINK_IN(vregion, lregion) > RODATA_REGION AT > lregion +/* Make sure new sections have consistent alignment between input and output sections */ +#undef SECTION_PROLOGUE +#define SECTION_PROLOGUE SECTION_DATA_PROLOGUE + /* Global symbols required for espressif hal build */ MEMORY { diff --git a/soc/espressif/esp32c6/default.ld b/soc/espressif/esp32c6/default.ld index a1ec65aa1df..9d0b5f2ac21 100644 --- a/soc/espressif/esp32c6/default.ld +++ b/soc/espressif/esp32c6/default.ld @@ -34,6 +34,10 @@ user_sram_size = (user_sram_end - user_sram_org); #undef GROUP_ROM_LINK_IN #define GROUP_ROM_LINK_IN(vregion, lregion) > CACHED_REGION AT > lregion +/* Make sure new sections have consistent alignment between input and output sections */ +#undef SECTION_PROLOGUE +#define SECTION_PROLOGUE SECTION_DATA_PROLOGUE + /* TODO: add RTC support */ #define RESERVE_RTC_MEM 0 diff --git a/soc/espressif/esp32s2/default.ld b/soc/espressif/esp32s2/default.ld index 8621e65d227..5eadcd96803 100644 --- a/soc/espressif/esp32s2/default.ld +++ b/soc/espressif/esp32s2/default.ld @@ -42,6 +42,10 @@ user_dram_seg_len = user_idram_size; #undef GROUP_ROM_LINK_IN #define GROUP_ROM_LINK_IN(vregion, lregion) > RODATA_REGION AT > lregion +/* Make sure new sections have consistent alignment between input and output sections */ +#undef SECTION_PROLOGUE +#define SECTION_PROLOGUE SECTION_DATA_PROLOGUE + #define RESERVE_RTC_MEM 0 MEMORY diff --git a/soc/espressif/esp32s3/default.ld b/soc/espressif/esp32s3/default.ld index ada1c12b93e..8f002c4b869 100644 --- a/soc/espressif/esp32s3/default.ld +++ b/soc/espressif/esp32s3/default.ld @@ -41,6 +41,10 @@ user_dram_seg_len = user_idram_size; #undef GROUP_ROM_LINK_IN #define GROUP_ROM_LINK_IN(vregion, lregion) > RODATA_REGION AT > lregion +/* Make sure new sections have consistent alignment between input and output sections */ +#undef SECTION_PROLOGUE +#define SECTION_PROLOGUE SECTION_DATA_PROLOGUE + MEMORY { #ifdef CONFIG_BOOTLOADER_MCUBOOT