Skip to content

Conversation

@anjiahao1
Copy link
Contributor

Summary

Nuttx's ELF dynamic loading cannot yet parse ARM exidx, so do not generate it yet.

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

Impact

ELF compilation on ARM

Testing

mps3-an546 build with pic, load hello elf.

@github-actions github-actions bot added Arch: arm Issues related to ARM (32-bit) architecture Size: XS The size of the change in this PR is very small labels Dec 17, 2025
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 <anjiahao@xiaomi.com>
Copy link
Contributor

@acassis acassis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anjiahao1 nice to fix some ELF usage case, so without ELF .exidx we cannot have backtracing, crash dumps and C++ exception support on ELF binaries, right?

Please add this note to https://nuttx.apache.org/docs/latest/guides/partially_linked_elf.html

Copy link
Contributor

@cederom cederom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @anjiahao1 just some minor description update please :-)

  • From the description it is unclear what behavior was before and after. Please update git commit and PR description to something like below. This will help users who encounter similar problem to find and apply you fix :-)
    arch/arm: Add arm toolchain unwinder configuration option.
    
    Nuttx's ELF dynamic loading cannot yet parse ARM exidx.
    Option is added not generate it yet to fix build/runtime(?).
    
    Before:
    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
    
    After: 
    builtin_loadbinary: Loading file: /pic/hello
    
  • I agree with @acassis Documentation needs an update too to stay in sync with the code.

Copy link
Contributor

@linguini1 linguini1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please provide some logs for your test?

CELFFLAGS = $(CFLAGS) -fvisibility=hidden -mlong-calls # --target1-abs
CXXELFFLAGS = $(CXXFLAGS)-fvisibility=hidden -mlong-calls

ifeq ($(CONFIG_UNWINDER_ARM),y)
Copy link
Contributor

@anchao anchao Dec 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If unwind table support in ELF is not intended to be implemented, supplementary comments can be added. In addition, a statement indicating the lack of support should be included in the ELF chapter, preferably with details specified down to the ELF allocation type level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: arm Issues related to ARM (32-bit) architecture Size: XS The size of the change in this PR is very small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants