Skip to content

Commit 2487fe9

Browse files
thughesjhedberg
authored andcommitted
include: linker: Set eh_frame size to 0 when C++ exceptions are disabled
When building Zephyr with CONFIG_CPP_EXCEPTIONS=n and linking against a libc++ built with support for exceptions, lld complains that the eh_frame-related symbols are missing: ld.lld: error: undefined symbol: __eh_frame_start ld.lld: error: undefined symbol: __eh_frame_end ld.lld: error: undefined symbol: __eh_frame_hdr_start ld.lld: error: undefined symbol: __eh_frame_hdr_end libunwind handles the zero size: https://github.com/llvm/llvm-project/blob/76e71e05d2687f602695931b2fbf25e4e262dcc4/libunwind/src/AddressSpace.hpp#L520-L526 https://github.com/llvm/llvm-project/blob/76e71e05d2687f602695931b2fbf25e4e262dcc4/libunwind/src/EHHeaderParser.hpp#L61-L64 Signed-off-by: Tom Hughes <[email protected]>
1 parent 2e9f29a commit 2487fe9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/zephyr/linker/cplusplus-rom.ld

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,9 @@
3030
#endif /* CONFIG_CPP */
3131

3232
#if !defined(CONFIG_CPP_EXCEPTIONS)
33+
PROVIDE(__eh_frame_start = 0);
34+
PROVIDE(__eh_frame_end = 0);
35+
PROVIDE(__eh_frame_hdr_start = 0);
36+
PROVIDE(__eh_frame_hdr_end = 0);
3337
/DISCARD/ : { *(.eh_frame) }
3438
#endif

0 commit comments

Comments
 (0)