Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support R_ARM_PREL31 relocation #1851

Closed
dcoles opened this issue Oct 8, 2022 · 4 comments
Closed

Support R_ARM_PREL31 relocation #1851

dcoles opened this issue Oct 8, 2022 · 4 comments

Comments

@dcoles
Copy link
Contributor

dcoles commented Oct 8, 2022

Describe the enhancement you're suggesting.

LLVM generates R_ARM_PREL31 relocations for .ARM.exidx.* symbols for section unwinding. This is needed to support features like Rust's panic = "unwind" and C++ exception unwinding.

The workaround is to set panic = "abort" for Rust programs and -fno-exceptions flag for C++, so the program will immediately abort instead of trying to unwind the stack.

This is not a critical issue now that #1850 has been merged, but it would still be nice to support eventually.

Anything else?

I might take a look at implementing this in the future, but since abort and exceptions typically just trigger furi_crash, it's not particularly urgent.

@hedger
Copy link
Member

hedger commented Oct 9, 2022

Reference implementation: https://opensource.apple.com/source/gdb/gdb-768/src/bfd/elf32-arm.c.auto.html, look for R_ARM_PREL31.

@DrZlo13
Copy link
Member

DrZlo13 commented Oct 9, 2022

I don't think it's a thing worth wasting time on. Stack unwinding takes up a lot of valuable memory, which increases load time and makes it impossible to write large programs.

It also requires writing support libraries for stack unwinding, AFAIK.

@skotopes
Copy link
Member

Yep, clearly not for embed.

@dcoles
Copy link
Contributor Author

dcoles commented Oct 15, 2022

Thanks for the feedback. I'll keep an eye out if I see anything else that generates R_ARM_PREL31 relocations.

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

No branches or pull requests

4 participants