Loading lld/ELF/Chunks.cpp +6 −5 Original line number Diff line number Diff line Loading @@ -20,11 +20,6 @@ template <class ELFT> SectionChunk<ELFT>::SectionChunk(object::ELFFile<ELFT> *Obj, const Elf_Shdr *Header) : Obj(Obj), Header(Header) { // Initialize SectionName. ErrorOr<StringRef> Name = Obj->getSectionName(Header); error(Name); SectionName = *Name; Align = Header->sh_addralign; } Loading @@ -38,6 +33,12 @@ template <class ELFT> void SectionChunk<ELFT>::writeTo(uint8_t *Buf) { // FIXME: Relocations } template <class ELFT> StringRef SectionChunk<ELFT>::getSectionName() const { ErrorOr<StringRef> Name = Obj->getSectionName(Header); error(Name); return *Name; } namespace lld { namespace elf2 { template class SectionChunk<object::ELF32LE>; Loading lld/ELF/Chunks.h +1 −6 Original line number Diff line number Diff line Loading @@ -41,10 +41,6 @@ public: uint32_t getAlign() { return Align; } void setOutputSectionOff(uint64_t V) { OutputSectionOff = V; } // Returns the section name if this is a section chunk. // It is illegal to call this function on non-section chunks. virtual StringRef getSectionName() const = 0; protected: // The offset from beginning of the output sections this chunk was assigned // to. The writer sets a value. Loading @@ -64,7 +60,7 @@ public: SectionChunk(llvm::object::ELFFile<ELFT> *Obj, const Elf_Shdr *Header); size_t getSize() const override { return Header->sh_size; } void writeTo(uint8_t *Buf) override; StringRef getSectionName() const override { return SectionName; } StringRef getSectionName() const; const Elf_Shdr *getSectionHdr() const { return Header; } private: Loading @@ -72,7 +68,6 @@ private: llvm::object::ELFFile<ELFT> *Obj; const Elf_Shdr *Header; StringRef SectionName; }; } // namespace elf2 Loading Loading
lld/ELF/Chunks.cpp +6 −5 Original line number Diff line number Diff line Loading @@ -20,11 +20,6 @@ template <class ELFT> SectionChunk<ELFT>::SectionChunk(object::ELFFile<ELFT> *Obj, const Elf_Shdr *Header) : Obj(Obj), Header(Header) { // Initialize SectionName. ErrorOr<StringRef> Name = Obj->getSectionName(Header); error(Name); SectionName = *Name; Align = Header->sh_addralign; } Loading @@ -38,6 +33,12 @@ template <class ELFT> void SectionChunk<ELFT>::writeTo(uint8_t *Buf) { // FIXME: Relocations } template <class ELFT> StringRef SectionChunk<ELFT>::getSectionName() const { ErrorOr<StringRef> Name = Obj->getSectionName(Header); error(Name); return *Name; } namespace lld { namespace elf2 { template class SectionChunk<object::ELF32LE>; Loading
lld/ELF/Chunks.h +1 −6 Original line number Diff line number Diff line Loading @@ -41,10 +41,6 @@ public: uint32_t getAlign() { return Align; } void setOutputSectionOff(uint64_t V) { OutputSectionOff = V; } // Returns the section name if this is a section chunk. // It is illegal to call this function on non-section chunks. virtual StringRef getSectionName() const = 0; protected: // The offset from beginning of the output sections this chunk was assigned // to. The writer sets a value. Loading @@ -64,7 +60,7 @@ public: SectionChunk(llvm::object::ELFFile<ELFT> *Obj, const Elf_Shdr *Header); size_t getSize() const override { return Header->sh_size; } void writeTo(uint8_t *Buf) override; StringRef getSectionName() const override { return SectionName; } StringRef getSectionName() const; const Elf_Shdr *getSectionHdr() const { return Header; } private: Loading @@ -72,7 +68,6 @@ private: llvm::object::ELFFile<ELFT> *Obj; const Elf_Shdr *Header; StringRef SectionName; }; } // namespace elf2 Loading