ObjectFileELF::ApplyRelocations() considered all 32-bit input objects to be i386 and didn't provide good error messages for AArch32 objects. Please find an example in https://github.com/llvm/llvm-project/issues/61948
While we are here, let' improve the situation for unsupported architectures as well. I think we should report the error here too and not silently fail (or crash with assertions enabled).
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Agreed.
The tangled web of switch statements makes my head spin so if you ever feel like tackling that please do :)
lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | ||
---|---|---|
2705 | Should this report error also? Given that you want it to not crash. Though it did that already, you must have had reason to change it. |
Thanks for your feedback
lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | ||
---|---|---|
2705 | I think the relocation types that can occur in debug sections are considered an invariant. If we see other relocation types, we got on a wrong track long before. The relocation resolver that exists in LLVM nowadays follows a support/resolve approach, which gives it a cleaner structure, but it comes down to the same behavior eventually: https://github.com/llvm/llvm-project/blob/release/16.x/llvm/lib/Object/RelocationResolver.cpp#L287-L299 I think it's best to keep this as is: Bail out with the assertion in development builds and ignore it silently in release builds. |
Should this report error also? Given that you want it to not crash.
Though it did that already, you must have had reason to change it.