Skip to content

Commit

Permalink
SoC: Fix undefined symbol when link cpp for clang __eh_frame_start/__…
Browse files Browse the repository at this point in the history
…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 <[email protected]>
  • Loading branch information
fanghuaqi committed Apr 20, 2024
1 parent 50104b7 commit 7adf7e0
Show file tree
Hide file tree
Showing 13 changed files with 91 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = .;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = .;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = .;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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*)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = .;
Expand Down

0 comments on commit 7adf7e0

Please sign in to comment.