From 7adf7e0e594703db7ca1af0462712aa81cb4aa13 Mon Sep 17 00:00:00 2001 From: Huaqi Fang <578567190@qq.com> Date: Fri, 19 Apr 2024 19:43:17 +0800 Subject: [PATCH] SoC: Fix undefined symbol when link cpp for clang __eh_frame_start/__eh_frame_hdr_start/__eh_frame_end/__eh_frame_hdr_end see https://github.com/llvm-mirror/libunwind/blob/master/src/AddressSpace.hpp#L108 Signed-off-by: Huaqi Fang <578567190@qq.com> --- .../Board/nuclei_fpga_eval/Source/GCC/gcc_evalsoc_ddr.ld | 7 +++++++ .../Board/nuclei_fpga_eval/Source/GCC/gcc_evalsoc_flash.ld | 7 +++++++ .../nuclei_fpga_eval/Source/GCC/gcc_evalsoc_flashxip.ld | 7 +++++++ .../Board/nuclei_fpga_eval/Source/GCC/gcc_evalsoc_ilm.ld | 7 +++++++ .../Board/nuclei_fpga_eval/Source/GCC/gcc_evalsoc_sram.ld | 7 +++++++ .../gd32vf103c_dlink/Source/GCC/gcc_gd32vf103_flashxip.ld | 7 +++++++ .../Source/GCC/gcc_gd32vf103x8_flashxip.ld | 7 +++++++ .../Source/GCC/gcc_gd32vf103xb_flashxip.ld | 7 +++++++ .../Source/GCC/gcc_gd32vf103_flashxip.ld | 7 +++++++ .../gd32vf103v_eval/Source/GCC/gcc_gd32vf103_flashxip.ld | 7 +++++++ .../gd32vf103v_rvstar/Source/GCC/gcc_gd32vf103_flashxip.ld | 7 +++++++ .../gd32vw553h_eval/Source/GCC/gcc_gd32vw55x_flashxip.ld | 7 +++++++ .../Board/gd32vw553h_eval/Source/GCC/gcc_gd32vw55x_sram.ld | 7 +++++++ 13 files changed, 91 insertions(+) diff --git a/SoC/evalsoc/Board/nuclei_fpga_eval/Source/GCC/gcc_evalsoc_ddr.ld b/SoC/evalsoc/Board/nuclei_fpga_eval/Source/GCC/gcc_evalsoc_ddr.ld index a9dd618a..314ba285 100644 --- a/SoC/evalsoc/Board/nuclei_fpga_eval/Source/GCC/gcc_evalsoc_ddr.ld +++ b/SoC/evalsoc/Board/nuclei_fpga_eval/Source/GCC/gcc_evalsoc_ddr.ld @@ -129,6 +129,13 @@ SECTIONS *(.rdata) *(.rodata .rodata.*) *(.gnu.linkonce.r.*) + /* Fix undefined symbol: __eh_frame_start/__eh_frame_hdr_start/__eh_frame_end/__eh_frame_hdr_end */ + PROVIDE_HIDDEN (__eh_frame_hdr_start = .); + *(.eh_frame_hdr) + PROVIDE_HIDDEN (__eh_frame_hdr_end = .); + PROVIDE_HIDDEN (__eh_frame_start = .); + *(.eh_frame) + PROVIDE_HIDDEN (__eh_frame_end = .); /* below sections are used for rt-thread */ . = ALIGN(8); __rt_init_start = .; diff --git a/SoC/evalsoc/Board/nuclei_fpga_eval/Source/GCC/gcc_evalsoc_flash.ld b/SoC/evalsoc/Board/nuclei_fpga_eval/Source/GCC/gcc_evalsoc_flash.ld index b30e693a..079499ef 100644 --- a/SoC/evalsoc/Board/nuclei_fpga_eval/Source/GCC/gcc_evalsoc_flash.ld +++ b/SoC/evalsoc/Board/nuclei_fpga_eval/Source/GCC/gcc_evalsoc_flash.ld @@ -127,6 +127,13 @@ SECTIONS *(.rdata) *(.rodata .rodata.*) *(.gnu.linkonce.r.*) + /* Fix undefined symbol: __eh_frame_start/__eh_frame_hdr_start/__eh_frame_end/__eh_frame_hdr_end */ + PROVIDE_HIDDEN (__eh_frame_hdr_start = .); + *(.eh_frame_hdr) + PROVIDE_HIDDEN (__eh_frame_hdr_end = .); + PROVIDE_HIDDEN (__eh_frame_start = .); + *(.eh_frame) + PROVIDE_HIDDEN (__eh_frame_end = .); /* below sections are used for rt-thread */ . = ALIGN(8); __rt_init_start = .; diff --git a/SoC/evalsoc/Board/nuclei_fpga_eval/Source/GCC/gcc_evalsoc_flashxip.ld b/SoC/evalsoc/Board/nuclei_fpga_eval/Source/GCC/gcc_evalsoc_flashxip.ld index f626ee3d..6097b7fc 100644 --- a/SoC/evalsoc/Board/nuclei_fpga_eval/Source/GCC/gcc_evalsoc_flashxip.ld +++ b/SoC/evalsoc/Board/nuclei_fpga_eval/Source/GCC/gcc_evalsoc_flashxip.ld @@ -140,6 +140,13 @@ SECTIONS PROVIDE( __global_pointer$ = . + 0x800 ); *(.sdata .sdata.* .sdata*) *(.gnu.linkonce.s.*) + /* Fix undefined symbol: __eh_frame_start/__eh_frame_hdr_start/__eh_frame_end/__eh_frame_hdr_end */ + PROVIDE_HIDDEN (__eh_frame_hdr_start = .); + *(.eh_frame_hdr) + PROVIDE_HIDDEN (__eh_frame_hdr_end = .); + PROVIDE_HIDDEN (__eh_frame_start = .); + *(.eh_frame) + PROVIDE_HIDDEN (__eh_frame_end = .); . = ALIGN(8); } >RAM AT>ROM diff --git a/SoC/evalsoc/Board/nuclei_fpga_eval/Source/GCC/gcc_evalsoc_ilm.ld b/SoC/evalsoc/Board/nuclei_fpga_eval/Source/GCC/gcc_evalsoc_ilm.ld index f3ab3eac..127a7499 100644 --- a/SoC/evalsoc/Board/nuclei_fpga_eval/Source/GCC/gcc_evalsoc_ilm.ld +++ b/SoC/evalsoc/Board/nuclei_fpga_eval/Source/GCC/gcc_evalsoc_ilm.ld @@ -126,6 +126,13 @@ SECTIONS *(.rdata) *(.rodata .rodata.*) *(.gnu.linkonce.r.*) + /* Fix undefined symbol: __eh_frame_start/__eh_frame_hdr_start/__eh_frame_end/__eh_frame_hdr_end */ + PROVIDE_HIDDEN (__eh_frame_hdr_start = .); + *(.eh_frame_hdr) + PROVIDE_HIDDEN (__eh_frame_hdr_end = .); + PROVIDE_HIDDEN (__eh_frame_start = .); + *(.eh_frame) + PROVIDE_HIDDEN (__eh_frame_end = .); /* below sections are used for rt-thread */ . = ALIGN(8); __rt_init_start = .; diff --git a/SoC/evalsoc/Board/nuclei_fpga_eval/Source/GCC/gcc_evalsoc_sram.ld b/SoC/evalsoc/Board/nuclei_fpga_eval/Source/GCC/gcc_evalsoc_sram.ld index dc0c0d83..c3d7280c 100644 --- a/SoC/evalsoc/Board/nuclei_fpga_eval/Source/GCC/gcc_evalsoc_sram.ld +++ b/SoC/evalsoc/Board/nuclei_fpga_eval/Source/GCC/gcc_evalsoc_sram.ld @@ -130,6 +130,13 @@ SECTIONS *(.rodata .rodata.*) *(.gnu.linkonce.r.*) /* below sections are used for rt-thread */ + /* Fix undefined symbol: __eh_frame_start/__eh_frame_hdr_start/__eh_frame_end/__eh_frame_hdr_end */ + PROVIDE_HIDDEN (__eh_frame_hdr_start = .); + *(.eh_frame_hdr) + PROVIDE_HIDDEN (__eh_frame_hdr_end = .); + PROVIDE_HIDDEN (__eh_frame_start = .); + *(.eh_frame) + PROVIDE_HIDDEN (__eh_frame_end = .); . = ALIGN(8); __rt_init_start = .; KEEP(*(SORT(.rti_fn*))) diff --git a/SoC/gd32vf103/Board/gd32vf103c_dlink/Source/GCC/gcc_gd32vf103_flashxip.ld b/SoC/gd32vf103/Board/gd32vf103c_dlink/Source/GCC/gcc_gd32vf103_flashxip.ld index 430a717e..071836d4 100644 --- a/SoC/gd32vf103/Board/gd32vf103c_dlink/Source/GCC/gcc_gd32vf103_flashxip.ld +++ b/SoC/gd32vf103/Board/gd32vf103c_dlink/Source/GCC/gcc_gd32vf103_flashxip.ld @@ -183,6 +183,13 @@ SECTIONS PROVIDE( __global_pointer$ = . + 0x800 ); *(.sdata .sdata.* .sdata*) *(.gnu.linkonce.s.*) + /* Fix undefined symbol: __eh_frame_start/__eh_frame_hdr_start/__eh_frame_end/__eh_frame_hdr_end */ + PROVIDE_HIDDEN (__eh_frame_hdr_start = .); + *(.eh_frame_hdr) + PROVIDE_HIDDEN (__eh_frame_hdr_end = .); + PROVIDE_HIDDEN (__eh_frame_start = .); + *(.eh_frame) + PROVIDE_HIDDEN (__eh_frame_end = .); . = ALIGN(8); } >RAM AT>ROM diff --git a/SoC/gd32vf103/Board/gd32vf103c_longan_nano/Source/GCC/gcc_gd32vf103x8_flashxip.ld b/SoC/gd32vf103/Board/gd32vf103c_longan_nano/Source/GCC/gcc_gd32vf103x8_flashxip.ld index 7b4b2c07..412508a2 100644 --- a/SoC/gd32vf103/Board/gd32vf103c_longan_nano/Source/GCC/gcc_gd32vf103x8_flashxip.ld +++ b/SoC/gd32vf103/Board/gd32vf103c_longan_nano/Source/GCC/gcc_gd32vf103x8_flashxip.ld @@ -183,6 +183,13 @@ SECTIONS PROVIDE( __global_pointer$ = . + 0x800 ); *(.sdata .sdata.* .sdata*) *(.gnu.linkonce.s.*) + /* Fix undefined symbol: __eh_frame_start/__eh_frame_hdr_start/__eh_frame_end/__eh_frame_hdr_end */ + PROVIDE_HIDDEN (__eh_frame_hdr_start = .); + *(.eh_frame_hdr) + PROVIDE_HIDDEN (__eh_frame_hdr_end = .); + PROVIDE_HIDDEN (__eh_frame_start = .); + *(.eh_frame) + PROVIDE_HIDDEN (__eh_frame_end = .); . = ALIGN(8); } >RAM AT>ROM diff --git a/SoC/gd32vf103/Board/gd32vf103c_longan_nano/Source/GCC/gcc_gd32vf103xb_flashxip.ld b/SoC/gd32vf103/Board/gd32vf103c_longan_nano/Source/GCC/gcc_gd32vf103xb_flashxip.ld index 84d67889..49e6d361 100644 --- a/SoC/gd32vf103/Board/gd32vf103c_longan_nano/Source/GCC/gcc_gd32vf103xb_flashxip.ld +++ b/SoC/gd32vf103/Board/gd32vf103c_longan_nano/Source/GCC/gcc_gd32vf103xb_flashxip.ld @@ -183,6 +183,13 @@ SECTIONS PROVIDE( __global_pointer$ = . + 0x800 ); *(.sdata .sdata.* .sdata*) *(.gnu.linkonce.s.*) + /* Fix undefined symbol: __eh_frame_start/__eh_frame_hdr_start/__eh_frame_end/__eh_frame_hdr_end */ + PROVIDE_HIDDEN (__eh_frame_hdr_start = .); + *(.eh_frame_hdr) + PROVIDE_HIDDEN (__eh_frame_hdr_end = .); + PROVIDE_HIDDEN (__eh_frame_start = .); + *(.eh_frame) + PROVIDE_HIDDEN (__eh_frame_end = .); . = ALIGN(8); } >RAM AT>ROM diff --git a/SoC/gd32vf103/Board/gd32vf103c_t_display/Source/GCC/gcc_gd32vf103_flashxip.ld b/SoC/gd32vf103/Board/gd32vf103c_t_display/Source/GCC/gcc_gd32vf103_flashxip.ld index 7fe44b1e..8bfdd5eb 100644 --- a/SoC/gd32vf103/Board/gd32vf103c_t_display/Source/GCC/gcc_gd32vf103_flashxip.ld +++ b/SoC/gd32vf103/Board/gd32vf103c_t_display/Source/GCC/gcc_gd32vf103_flashxip.ld @@ -183,6 +183,13 @@ SECTIONS PROVIDE( __global_pointer$ = . + 0x800 ); *(.sdata .sdata.* .sdata*) *(.gnu.linkonce.s.*) + /* Fix undefined symbol: __eh_frame_start/__eh_frame_hdr_start/__eh_frame_end/__eh_frame_hdr_end */ + PROVIDE_HIDDEN (__eh_frame_hdr_start = .); + *(.eh_frame_hdr) + PROVIDE_HIDDEN (__eh_frame_hdr_end = .); + PROVIDE_HIDDEN (__eh_frame_start = .); + *(.eh_frame) + PROVIDE_HIDDEN (__eh_frame_end = .); . = ALIGN(8); } >RAM AT>ROM diff --git a/SoC/gd32vf103/Board/gd32vf103v_eval/Source/GCC/gcc_gd32vf103_flashxip.ld b/SoC/gd32vf103/Board/gd32vf103v_eval/Source/GCC/gcc_gd32vf103_flashxip.ld index 430a717e..071836d4 100644 --- a/SoC/gd32vf103/Board/gd32vf103v_eval/Source/GCC/gcc_gd32vf103_flashxip.ld +++ b/SoC/gd32vf103/Board/gd32vf103v_eval/Source/GCC/gcc_gd32vf103_flashxip.ld @@ -183,6 +183,13 @@ SECTIONS PROVIDE( __global_pointer$ = . + 0x800 ); *(.sdata .sdata.* .sdata*) *(.gnu.linkonce.s.*) + /* Fix undefined symbol: __eh_frame_start/__eh_frame_hdr_start/__eh_frame_end/__eh_frame_hdr_end */ + PROVIDE_HIDDEN (__eh_frame_hdr_start = .); + *(.eh_frame_hdr) + PROVIDE_HIDDEN (__eh_frame_hdr_end = .); + PROVIDE_HIDDEN (__eh_frame_start = .); + *(.eh_frame) + PROVIDE_HIDDEN (__eh_frame_end = .); . = ALIGN(8); } >RAM AT>ROM diff --git a/SoC/gd32vf103/Board/gd32vf103v_rvstar/Source/GCC/gcc_gd32vf103_flashxip.ld b/SoC/gd32vf103/Board/gd32vf103v_rvstar/Source/GCC/gcc_gd32vf103_flashxip.ld index 430a717e..071836d4 100644 --- a/SoC/gd32vf103/Board/gd32vf103v_rvstar/Source/GCC/gcc_gd32vf103_flashxip.ld +++ b/SoC/gd32vf103/Board/gd32vf103v_rvstar/Source/GCC/gcc_gd32vf103_flashxip.ld @@ -183,6 +183,13 @@ SECTIONS PROVIDE( __global_pointer$ = . + 0x800 ); *(.sdata .sdata.* .sdata*) *(.gnu.linkonce.s.*) + /* Fix undefined symbol: __eh_frame_start/__eh_frame_hdr_start/__eh_frame_end/__eh_frame_hdr_end */ + PROVIDE_HIDDEN (__eh_frame_hdr_start = .); + *(.eh_frame_hdr) + PROVIDE_HIDDEN (__eh_frame_hdr_end = .); + PROVIDE_HIDDEN (__eh_frame_start = .); + *(.eh_frame) + PROVIDE_HIDDEN (__eh_frame_end = .); . = ALIGN(8); } >RAM AT>ROM diff --git a/SoC/gd32vw55x/Board/gd32vw553h_eval/Source/GCC/gcc_gd32vw55x_flashxip.ld b/SoC/gd32vw55x/Board/gd32vw553h_eval/Source/GCC/gcc_gd32vw55x_flashxip.ld index 1a1b4a73..7e0205d9 100644 --- a/SoC/gd32vw55x/Board/gd32vw553h_eval/Source/GCC/gcc_gd32vw55x_flashxip.ld +++ b/SoC/gd32vw55x/Board/gd32vw553h_eval/Source/GCC/gcc_gd32vw55x_flashxip.ld @@ -169,6 +169,13 @@ SECTIONS PROVIDE( __global_pointer$ = . + 0x800 ); *(.sdata .sdata.* .sdata*) *(.gnu.linkonce.s.*) + /* Fix undefined symbol: __eh_frame_start/__eh_frame_hdr_start/__eh_frame_end/__eh_frame_hdr_end */ + PROVIDE_HIDDEN (__eh_frame_hdr_start = .); + *(.eh_frame_hdr) + PROVIDE_HIDDEN (__eh_frame_hdr_end = .); + PROVIDE_HIDDEN (__eh_frame_start = .); + *(.eh_frame) + PROVIDE_HIDDEN (__eh_frame_end = .); . = ALIGN(8); } >RAM AT>ROM diff --git a/SoC/gd32vw55x/Board/gd32vw553h_eval/Source/GCC/gcc_gd32vw55x_sram.ld b/SoC/gd32vw55x/Board/gd32vw553h_eval/Source/GCC/gcc_gd32vw55x_sram.ld index d6143d9d..fb70934a 100644 --- a/SoC/gd32vw55x/Board/gd32vw553h_eval/Source/GCC/gcc_gd32vw55x_sram.ld +++ b/SoC/gd32vw55x/Board/gd32vw553h_eval/Source/GCC/gcc_gd32vw55x_sram.ld @@ -75,6 +75,13 @@ SECTIONS *(.rdata) *(.rodata .rodata.*) *(.gnu.linkonce.r.*) + /* Fix undefined symbol: __eh_frame_start/__eh_frame_hdr_start/__eh_frame_end/__eh_frame_hdr_end */ + PROVIDE_HIDDEN (__eh_frame_hdr_start = .); + *(.eh_frame_hdr) + PROVIDE_HIDDEN (__eh_frame_hdr_end = .); + PROVIDE_HIDDEN (__eh_frame_start = .); + *(.eh_frame) + PROVIDE_HIDDEN (__eh_frame_end = .); /* below sections are used for rt-thread */ . = ALIGN(4); __rt_init_start = .;