diff --git a/llvm/include/llvm/Object/ELF.h b/llvm/include/llvm/Object/ELF.h --- a/llvm/include/llvm/Object/ELF.h +++ b/llvm/include/llvm/Object/ELF.h @@ -203,7 +203,7 @@ return getSectionContentsAsArray(Sec); } - Expected> decode_relrs(Elf_Relr_Range relrs) const; + std::vector decode_relrs(Elf_Relr_Range relrs) const; Expected> android_relas(const Elf_Shdr *Sec) const; diff --git a/llvm/lib/Object/ELF.cpp b/llvm/lib/Object/ELF.cpp --- a/llvm/lib/Object/ELF.cpp +++ b/llvm/lib/Object/ELF.cpp @@ -278,7 +278,7 @@ } template -Expected> +std::vector ELFFile::decode_relrs(Elf_Relr_Range relrs) const { // This function decodes the contents of an SHT_RELR packed relocation // section. diff --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp --- a/llvm/tools/llvm-readobj/ELFDumper.cpp +++ b/llvm/tools/llvm-readobj/ELFDumper.cpp @@ -3779,7 +3779,7 @@ } else if (!opts::RawRelr && (Sec.sh_type == ELF::SHT_RELR || Sec.sh_type == ELF::SHT_ANDROID_RELR)) { Elf_Relr_Range Relrs = unwrapOrError(this->FileName, Obj->relrs(&Sec)); - Entries = unwrapOrError(this->FileName, Obj->decode_relrs(Relrs)).size(); + Entries = Obj->decode_relrs(Relrs).size(); } else { Entries = Sec.getEntityCount(); } @@ -4507,9 +4507,7 @@ << " contains " << DynRelrRegion.Size << " bytes:\n"; printRelocHeader(ELF::SHT_REL); Elf_Relr_Range Relrs = this->dumper()->dyn_relrs(); - std::vector RelrRels = - unwrapOrError(this->FileName, Obj->decode_relrs(Relrs)); - for (const Elf_Rel &R : RelrRels) + for (const Elf_Rel &R : Obj->decode_relrs(Relrs)) printDynamicRelocation(Obj, R); } if (DynPLTRelRegion.Size) { @@ -5533,9 +5531,8 @@ printRelrReloc(R); break; } - std::vector RelrRels = - unwrapOrError(this->FileName, Obj->decode_relrs(Relrs)); - for (const Elf_Rel &R : RelrRels) + + for (const Elf_Rel &R : Obj->decode_relrs(Relrs)) printRelReloc(Obj, SecNdx, SymTab, R, ++RelNdx); break; } @@ -6426,9 +6423,7 @@ if (DynRelrRegion.Size > 0) { Elf_Relr_Range Relrs = this->dumper()->dyn_relrs(); - std::vector RelrRels = - unwrapOrError(this->FileName, Obj->decode_relrs(Relrs)); - for (const Elf_Rel &R : RelrRels) + for (const Elf_Rel &R : Obj->decode_relrs(Relrs)) printDynamicRelocation(Obj, R); } if (DynPLTRelRegion.EntSize == sizeof(Elf_Rela))