diff --git a/boards/xtensa/esp32/common/scripts/esp32_sections.ld b/boards/xtensa/esp32/common/scripts/esp32_sections.ld index b94e7b3b179..3fe8f0e666b 100644 --- a/boards/xtensa/esp32/common/scripts/esp32_sections.ld +++ b/boards/xtensa/esp32/common/scripts/esp32_sections.ld @@ -460,6 +460,26 @@ SECTIONS _sheap = ABSOLUTE(.); } >dram0_0_seg AT>ROM + /* This section will be used by the debugger and disassembler to get more + * information about raw data present in the code. + * Indeed, it may be required to add some padding at some points in the + * code in order to align a branch/jump destination on a particular bound. + * Padding these instructions will generate null bytes that shall be + * interpreted as data, and not code by the debugger or disassembler. + * This section will only be present in the ELF file, not in the final + * binary. + */ + + .xt.prop 0 : + { + KEEP (*(.xt.prop .gnu.linkonce.prop.*)) + } + + .xt.lit 0 : + { + KEEP (*(.xt.lit .gnu.linkonce.p.*)) + } + _image_drom_vma = ADDR(.flash.rodata); _image_drom_lma = LOADADDR(.flash.rodata); _image_drom_size = LOADADDR(.flash.rodata) + SIZEOF(.flash.rodata) - _image_drom_lma; diff --git a/boards/xtensa/esp32s2/common/scripts/esp32s2_sections.ld b/boards/xtensa/esp32s2/common/scripts/esp32s2_sections.ld index 8c5643675f8..bb30e6f1016 100644 --- a/boards/xtensa/esp32s2/common/scripts/esp32s2_sections.ld +++ b/boards/xtensa/esp32s2/common/scripts/esp32s2_sections.ld @@ -382,6 +382,28 @@ SECTIONS _sheap = ABSOLUTE(.); } >dram0_0_seg AT>ROM + + + /* This section will be used by the debugger and disassembler to get more + * information about raw data present in the code. + * Indeed, it may be required to add some padding at some points in the + * code in order to align a branch/jump destination on a particular bound. + * Padding these instructions will generate null bytes that shall be + * interpreted as data, and not code by the debugger or disassembler. + * This section will only be present in the ELF file, not in the final + * binary. + */ + + .xt.prop 0 : + { + KEEP (*(.xt.prop .gnu.linkonce.prop.*)) + } + + .xt.lit 0 : + { + KEEP (*(.xt.lit .gnu.linkonce.p.*)) + } + _image_drom_vma = ADDR(.flash.rodata); _image_drom_lma = LOADADDR(.flash.rodata); _image_drom_size = LOADADDR(.flash.rodata) + SIZEOF(.flash.rodata) - _image_drom_lma; diff --git a/boards/xtensa/esp32s3/common/scripts/esp32s3_sections.ld b/boards/xtensa/esp32s3/common/scripts/esp32s3_sections.ld index 5d2194983a4..614ad82b1eb 100644 --- a/boards/xtensa/esp32s3/common/scripts/esp32s3_sections.ld +++ b/boards/xtensa/esp32s3/common/scripts/esp32s3_sections.ld @@ -495,6 +495,26 @@ SECTIONS _sheap = ABSOLUTE(.); } >dram0_0_seg AT>ROM + /* This section will be used by the debugger and disassembler to get more + * information about raw data present in the code. + * Indeed, it may be required to add some padding at some points in the + * code in order to align a branch/jump destination on a particular bound. + * Padding these instructions will generate null bytes that shall be + * interpreted as data, and not code by the debugger or disassembler. + * This section will only be present in the ELF file, not in the final + * binary. + */ + + .xt.prop 0 : + { + KEEP (*(.xt.prop .gnu.linkonce.prop.*)) + } + + .xt.lit 0 : + { + KEEP (*(.xt.lit .gnu.linkonce.p.*)) + } + /* The alignment of the ".flash.text" output section is forced to * 0x00010000 (64KB) to ensure that it will be allocated at the beginning * of the next available Flash block.