From d67c1f389d7851e01ddde7c4016f3af0826e46a7 Mon Sep 17 00:00:00 2001 From: Stephanos Ioannidis Date: Tue, 30 Nov 2021 23:06:43 +0900 Subject: [PATCH] riscv: Fix C++ exception handling info linking The RISC-V architecture linker script was including `cplusplus-ram.ld` linker script before `__data_region_start`, and this caused the content of `.gcc_except_table` section to be not copied to the RAM by the `z_data_copy` function; leading to the C++ exception handling malfunction. This commit relocates the `cplusplus-ram.ld` linker script inclusion such that the contents of the relevant sections are properly copied by the `z_data_copy` function. Signed-off-by: Stephanos Ioannidis --- include/arch/riscv/common/linker.ld | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/arch/riscv/common/linker.ld b/include/arch/riscv/common/linker.ld index d032c6e442d..8ae7e0c0381 100644 --- a/include/arch/riscv/common/linker.ld +++ b/include/arch/riscv/common/linker.ld @@ -243,7 +243,6 @@ SECTIONS } GROUP_DATA_LINK_IN(RAMABLE_REGION, RAMABLE_REGION) #include -#include SECTION_DATA_PROLOGUE(_DATA_SECTION_NAME,,) { @@ -287,6 +286,7 @@ SECTIONS #include #include +#include /* Located in generated directory. This file is populated by the * zephyr_linker_sources() Cmake function.