From 359af26736b1a612f6df7959860e55c59bedfb39 Mon Sep 17 00:00:00 2001 From: Frantisek Hrbata Date: Wed, 20 Mar 2024 17:39:49 +0100 Subject: [PATCH] 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 --- components/riscv/vectors.S | 2 +- components/riscv/vectors_intc.S | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/riscv/vectors.S b/components/riscv/vectors.S index 6c4e931f28..0b46681416 100644 --- a/components/riscv/vectors.S +++ b/components/riscv/vectors.S @@ -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 diff --git a/components/riscv/vectors_intc.S b/components/riscv/vectors_intc.S index 327de97b0b..b4bd8350f2 100644 --- a/components/riscv/vectors_intc.S +++ b/components/riscv/vectors_intc.S @@ -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. *