nios2: Fix C++ exception handling info linking

The NIOS2 architecture linker script was including `cplusplus-ram.ld`
linker script after `__data_ram_end`, 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 <root@stephanos.io>
This commit is contained in:
Stephanos Ioannidis 2021-05-28 23:15:49 +09:00 committed by Kumar Gala
commit bbbc9b132b

View file

@ -226,6 +226,8 @@ SECTIONS
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION) } GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
#include <linker/cplusplus-ram.ld>
__data_ram_end = .; __data_ram_end = .;
SECTION_DATA_PROLOGUE(_BSS_SECTION_NAME,(NOLOAD),) SECTION_DATA_PROLOGUE(_BSS_SECTION_NAME,(NOLOAD),)
@ -250,8 +252,6 @@ SECTIONS
#include <linker/common-noinit.ld> #include <linker/common-noinit.ld>
#include <linker/cplusplus-ram.ld>
/* Define linker symbols */ /* Define linker symbols */
_image_ram_end = .; _image_ram_end = .;
_end = .; /* end of image */ _end = .; /* end of image */