Skip to content

os: Fix C++ exception support for relocatable ELF binaries#7186

Open
pcs1265 wants to merge 1 commit intoSamsung:masterfrom
pcs1265:260304_fix_elf_exception
Open

os: Fix C++ exception support for relocatable ELF binaries#7186
pcs1265 wants to merge 1 commit intoSamsung:masterfrom
pcs1265:260304_fix_elf_exception

Conversation

@pcs1265
Copy link
Member

@pcs1265 pcs1265 commented Mar 10, 2026

This commit fixes linker error while build procedure when CONFIG_ELF is enabled and add exception data section handling for ELF binary loader.

The linker error:

LD: tinyara
make[1]: Leaving directory '/root/tizenrt/os/arch/arm/src'
CP: tinyara.bin
Preparing final ../build/output/bin/app1 binary
Verify ../build/output/bin/common
Undefined Symbols in ../build/output/bin/common
         U __exidx_end  unwind-arm.c:0
         U __exidx_start        unwind-arm.c:0
         w __gnu_Unwind_Find_exidx      unwind-arm.c:0
make: *** [post] Error 1
Makefile.unix:542: recipe for target 'post' failed

The section required for exception data is relocated in "R_ARM_TARGET2" type, so added that type relocation support to ELF binary loader.

and ARMV7M_TARGET2_PREL config is not used correctly, removed it.

NOTE : As described in help message of LIBCXX_EXCEPTION can be used with docker version 2.0.0 or later.

@pcs1265 pcs1265 force-pushed the 260304_fix_elf_exception branch 3 times, most recently from 34ab397 to 31ff739 Compare March 13, 2026 10:26
This commit fixes linker error while build procedure when CONFIG_ELF is enabled and add exception data section handling for ELF binary loader.

The linker error:
```
LD: tinyara
make[1]: Leaving directory '/root/tizenrt/os/arch/arm/src'
CP: tinyara.bin
Preparing final ../build/output/bin/app1 binary
Verify ../build/output/bin/common
Undefined Symbols in ../build/output/bin/common
         U __exidx_end  unwind-arm.c:0
         U __exidx_start        unwind-arm.c:0
         w __gnu_Unwind_Find_exidx      unwind-arm.c:0
make: *** [post] Error 1
Makefile.unix:542: recipe for target 'post' failed
```

The section required for exception data is relocated in "R_ARM_TARGET2" type, so added that type relocation support to ELF binary loader.

and `ARMV7M_TARGET2_PREL` config is not used correctly, removed it.

NOTE : As described in help message of LIBCXX_EXCEPTION can be used with docker version 2.0.0 or later.
@pcs1265 pcs1265 force-pushed the 260304_fix_elf_exception branch from 31ff739 to 0f7c42e Compare March 13, 2026 10:38
@pcs1265 pcs1265 changed the title [DO NOT MERGE] os: Fix C++ exception support for ELF binaries os: Fix C++ exception support for relocatable ELF binaries Mar 13, 2026
@pcs1265 pcs1265 marked this pull request as ready for review March 13, 2026 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant