llvm-objcopy: Remove unused field. NFCI.

Differential Revision: https://reviews.llvm.org/D59126

llvm-svn: 355892
This commit is contained in:
Peter Collingbourne 2019-03-12 02:17:01 +00:00
parent 930d46a2ef
commit bf92b3f480
2 changed files with 3 additions and 9 deletions

View File

@ -901,9 +901,7 @@ template <class ELFT> void ELFBuilder<ELFT>::setParentSegment(Segment &Child) {
template <class ELFT> void ELFBuilder<ELFT>::readProgramHeaders() {
uint32_t Index = 0;
for (const auto &Phdr : unwrapOrError(ElfFile.program_headers())) {
ArrayRef<uint8_t> 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;

View File

@ -312,10 +312,6 @@ public:
uint32_t Index;
uint64_t OriginalOffset;
Segment *ParentSegment = nullptr;
ArrayRef<uint8_t> Contents;
explicit Segment(ArrayRef<uint8_t> Data) : Contents(Data) {}
Segment() {}
const SectionBase *firstSection() const {
if (!Sections.empty())
@ -827,8 +823,8 @@ public:
Ptr->Index = Sections.size();
return *Ptr;
}
Segment &addSegment(ArrayRef<uint8_t> Data) {
Segments.emplace_back(llvm::make_unique<Segment>(Data));
Segment &addSegment() {
Segments.emplace_back(llvm::make_unique<Segment>());
return *Segments.back();
}
};