This was requested in comments for D93209:
https://reviews.llvm.org/D93209#inline-871192
D93209 fixes an issue with ELFFile<ELFT>::getEntry,
after what getSymbol starts calling report_fatal_error for previously
missed invalid cases.
This patch makes it return Expected<> and updates callers.
For few of them I had to add new report_fatal_error calls. But I see no
way to avoid it currently. The change would affects too many places, e.g:
getSymbolBinding and other methods are used from ELFSymbolRef
which is used too many places across LLVM.
Just return EF.template getEntry<Elf_Sym>(Sym.d.a, Sym.d.b);