fix: mark .exception_vectors* as executable and allocatable

It seems gcc is not producing debug information for sections which
are not properly marked as "ax", resulting in missing debug info
for _vector_table, _interrupt_handler and _panic_handler. This can be
verified e.g. with

readelf --debug=info ./build/esp-idf/riscv/CMakeFiles/__idf_riscv.dir/vectors.S.obj
readelf -SW ./build/esp-idf/riscv/CMakeFiles/__idf_riscv.dir/vectors.S.obj

for hello_world example on esp32c3 target. Mark the .exception_vectors.text and
.exception_vectors_table.text sections as writable and allocatable so the debug
info sections are generated.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
This commit is contained in:
Frantisek Hrbata 2024-03-20 17:39:49 +01:00
parent 22ee3e8aa6
commit 359af26736
2 changed files with 2 additions and 2 deletions

View File

@ -124,7 +124,7 @@
.global gdbstub_handle_debug_int
#endif
.section .exception_vectors.text
.section .exception_vectors.text, "ax"
/* Exception handler.*/
.type _panic_handler, @function

View File

@ -30,7 +30,7 @@
.global _interrupt_handler
.global _panic_handler
.section .exception_vectors_table.text
.section .exception_vectors_table.text, "ax"
/* This is the vector table. MTVEC points here.
*