File tree 2 files changed +3
-9
lines changed
llvm/tools/llvm-objcopy/ELF
2 files changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -901,9 +901,7 @@ template <class ELFT> void ELFBuilder<ELFT>::setParentSegment(Segment &Child) {
901
901
template <class ELFT > void ELFBuilder<ELFT>::readProgramHeaders() {
902
902
uint32_t Index = 0 ;
903
903
for (const auto &Phdr : unwrapOrError (ElfFile.program_headers ())) {
904
- ArrayRef<uint8_t > Data{ElfFile.base () + Phdr.p_offset ,
905
- (size_t )Phdr.p_filesz };
906
- Segment &Seg = Obj.addSegment (Data);
904
+ Segment &Seg = Obj.addSegment ();
907
905
Seg.Type = Phdr.p_type ;
908
906
Seg.Flags = Phdr.p_flags ;
909
907
Seg.OriginalOffset = Phdr.p_offset ;
Original file line number Diff line number Diff line change @@ -312,10 +312,6 @@ class Segment {
312
312
uint32_t Index;
313
313
uint64_t OriginalOffset;
314
314
Segment *ParentSegment = nullptr ;
315
- ArrayRef<uint8_t > Contents;
316
-
317
- explicit Segment (ArrayRef<uint8_t > Data) : Contents(Data) {}
318
- Segment () {}
319
315
320
316
const SectionBase *firstSection () const {
321
317
if (!Sections.empty ())
@@ -827,8 +823,8 @@ class Object {
827
823
Ptr ->Index = Sections.size ();
828
824
return *Ptr ;
829
825
}
830
- Segment &addSegment (ArrayRef< uint8_t > Data ) {
831
- Segments.emplace_back (llvm::make_unique<Segment>(Data ));
826
+ Segment &addSegment () {
827
+ Segments.emplace_back (llvm::make_unique<Segment>());
832
828
return *Segments.back ();
833
829
}
834
830
};
You can’t perform that action at this time.
0 commit comments