================ @@ -1117,9 +1166,11 @@ void ELFObjectFile<ELFT>::getRelocationTypeName( template <class ELFT> Expected<int64_t> ELFObjectFile<ELFT>::getRelocationAddend(DataRefImpl Rel) const { - if (getRelSection(Rel)->sh_type != ELF::SHT_RELA) - return createError("Section is not SHT_RELA"); - return (int64_t)getRela(Rel)->r_addend; + if (getRelSection(Rel)->sh_type == ELF::SHT_RELA) + return (int64_t)getRela(Rel)->r_addend; + if (getRelSection(Rel)->sh_type == ELF::SHT_CREL) ---------------- MaskRay wrote:
I have reverted this file. Sorry for leaving it in the initial patch. This code is used by `.getAddend()` in the files (not core binary utilities). * llvm/lib/Object/RelocationResolver.cpp * llvm/lib/XRay/InstrumentationMap.cpp * llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp Since they are all for static relocations, we can assume `r_addend`. However, I agree that having an error checking would be nice. https://github.com/llvm/llvm-project/pull/91280 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits