diff --git a/llvm/lib/Object/RelocationResolver.cpp b/llvm/lib/Object/RelocationResolver.cpp index a28f5943c320d..8cf748aa5681c 100644 --- a/llvm/lib/Object/RelocationResolver.cpp +++ b/llvm/lib/Object/RelocationResolver.cpp @@ -888,7 +888,8 @@ uint64_t resolveRelocation(RelocationResolver Resolver, const RelocationRef &R, return Elf64BEObj->getRelSection(R.getRawDataRefImpl())->sh_type; }; - if (GetRelSectionType() == ELF::SHT_RELA) { + if (GetRelSectionType() == ELF::SHT_RELA || + GetRelSectionType() == ELF::SHT_CREL) { Addend = getELFAddend(R); // LoongArch and RISCV relocations use both LocData and Addend. if (Obj->getArch() != Triple::loongarch32 &&