From e02dc0f3a8bb1ca0170720504dfa7898e6a0567c Mon Sep 17 00:00:00 2001 From: anjiahao Date: Thu, 9 Jan 2025 18:22:51 +0800 Subject: [PATCH] bug fix pic:elf do not generate unwind table modlib_read: Read 64 bytes from offset 192665 modlib_symvalue: ERROR: SHN_UNDEF: Exported symbol "__gnu_Unwind_Find_exidx" not found modlib_relocate: ERROR: Section 2 reloc 12: Failed to get value of symbol[246]: -2 elf_loadbinary: Failed to bind symbols program binary: -2 builtin_loadbinary: Loading file: /pic/hello Signed-off-by: anjiahao --- arch/arm/src/common/Toolchain.defs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm/src/common/Toolchain.defs b/arch/arm/src/common/Toolchain.defs index f38ab852f0928..512618a7d9b9a 100644 --- a/arch/arm/src/common/Toolchain.defs +++ b/arch/arm/src/common/Toolchain.defs @@ -552,6 +552,11 @@ LDMODULEFLAGS = -r -T $(call CONVERT_PATH,$(TOPDIR)/libs/libc/elf/gnu-elf.ld) CELFFLAGS = $(CFLAGS) -fvisibility=hidden -mlong-calls # --target1-abs CXXELFFLAGS = $(CXXFLAGS)-fvisibility=hidden -mlong-calls +ifeq ($(CONFIG_UNWINDER_ARM),y) + CELFFLAGS += -fno-unwind-tables -fno-asynchronous-unwind-tables + CXXELFFLAGS += -fno-unwind-tables -fno-asynchronous-unwind-tables +endif + ifeq ($(CONFIG_PIC),y) CFLAGS += --fixed-r10 CELFFLAGS += $(PICFLAGS) -mpic-register=r10