Index: llvm/trunk/tools/llvm-objcopy/ELF/Object.h =================================================================== --- llvm/trunk/tools/llvm-objcopy/ELF/Object.h +++ llvm/trunk/tools/llvm-objcopy/ELF/Object.h @@ -312,10 +312,6 @@ uint32_t Index; uint64_t OriginalOffset; Segment *ParentSegment = nullptr; - ArrayRef Contents; - - explicit Segment(ArrayRef Data) : Contents(Data) {} - Segment() {} const SectionBase *firstSection() const { if (!Sections.empty()) @@ -827,8 +823,8 @@ Ptr->Index = Sections.size(); return *Ptr; } - Segment &addSegment(ArrayRef Data) { - Segments.emplace_back(llvm::make_unique(Data)); + Segment &addSegment() { + Segments.emplace_back(llvm::make_unique()); return *Segments.back(); } }; Index: llvm/trunk/tools/llvm-objcopy/ELF/Object.cpp =================================================================== --- llvm/trunk/tools/llvm-objcopy/ELF/Object.cpp +++ llvm/trunk/tools/llvm-objcopy/ELF/Object.cpp @@ -901,9 +901,7 @@ template void ELFBuilder::readProgramHeaders() { uint32_t Index = 0; for (const auto &Phdr : unwrapOrError(ElfFile.program_headers())) { - ArrayRef Data{ElfFile.base() + Phdr.p_offset, - (size_t)Phdr.p_filesz}; - Segment &Seg = Obj.addSegment(Data); + Segment &Seg = Obj.addSegment(); Seg.Type = Phdr.p_type; Seg.Flags = Phdr.p_flags; Seg.OriginalOffset = Phdr.p_offset;