[Lldb-commits] [PATCH] D147627: [lldb][ObjectFileELF] Improve error output for unsupported arch/relocations
Stefan Gränitz via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Thu Apr 13 05:30:35 PDT 2023
sgraenitz marked an inline comment as done.
sgraenitz added a comment.
Thanks for your feedback
================
Comment at: lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:2704
+ default:
+ assert(false && "unexpected relocation type");
+ break;
----------------
DavidSpickett wrote:
> 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.
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.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D147627/new/
https://reviews.llvm.org/D147627
More information about the lldb-commits
mailing list