Skip to content

Commit 9c23f6a

Browse files
stephanosionashif
authored andcommitted
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 <[email protected]>
1 parent 9118a7a commit 9c23f6a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/arch/riscv/common/linker.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ SECTIONS
227227
} GROUP_DATA_LINK_IN(RAMABLE_REGION, RAMABLE_REGION)
228228

229229
#include <linker/common-noinit.ld>
230-
#include <linker/cplusplus-ram.ld>
231230

232231
SECTION_DATA_PROLOGUE(_DATA_SECTION_NAME,,)
233232
{
@@ -271,6 +270,7 @@ SECTIONS
271270

272271
#include <linker/common-ram.ld>
273272
#include <linker/kobject-data.ld>
273+
#include <linker/cplusplus-ram.ld>
274274

275275
/* Located in generated directory. This file is populated by the
276276
* zephyr_linker_sources() Cmake function.

0 commit comments

Comments
 (0)