diff --git a/llvm/tools/llvm-profgen/ProfiledBinary.cpp b/llvm/tools/llvm-profgen/ProfiledBinary.cpp index 7ea17c2ea9a7d9..7cc318ccffa6ee 100644 --- a/llvm/tools/llvm-profgen/ProfiledBinary.cpp +++ b/llvm/tools/llvm-profgen/ProfiledBinary.cpp @@ -43,12 +43,12 @@ static const Target *getTarget(const ObjectFile *Obj) { } template -static uint64_t getELFImageLMAForSec(const ELFFile *Obj, +static uint64_t getELFImageLMAForSec(const ELFFile &Obj, const object::ELFSectionRef &Sec, StringRef FileName) { // Search for a PT_LOAD segment containing the requested section. Return this // segment's p_addr as the image load address for the section. - const auto &PhdrRange = unwrapOrError(Obj->program_headers(), FileName); + const auto &PhdrRange = unwrapOrError(Obj.program_headers(), FileName); for (const typename ELFT::Phdr &Phdr : PhdrRange) if ((Phdr.p_type == ELF::PT_LOAD) && (Phdr.p_vaddr <= Sec.getAddress()) && (Phdr.p_vaddr + Phdr.p_memsz > Sec.getAddress()))