forked from OSchip/llvm-project
llvm-objcopy: Remove unused field. NFCI.
Differential Revision: https://reviews.llvm.org/D59126 llvm-svn: 355892
This commit is contained in:
parent
930d46a2ef
commit
bf92b3f480
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue