diff options
Diffstat (limited to 'lld/ELF/OutputSections.h')
-rw-r--r-- | lld/ELF/OutputSections.h | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/lld/ELF/OutputSections.h b/lld/ELF/OutputSections.h index a8c597b03bf..40bcb9fc3c5 100644 --- a/lld/ELF/OutputSections.h +++ b/lld/ELF/OutputSections.h @@ -117,6 +117,23 @@ private: }; template <class ELFT> +class GotPltSection final : public OutputSectionBase<ELFT::Is64Bits> { + typedef OutputSectionBase<ELFT::Is64Bits> Base; + typedef typename Base::uintX_t uintX_t; + +public: + GotPltSection(); + void finalize() override; + void writeTo(uint8_t *Buf) override; + void addEntry(SymbolBody *Sym); + bool empty() const; + uintX_t getEntryAddr(const SymbolBody &B) const; + +private: + std::vector<const SymbolBody *> Entries; +}; + +template <class ELFT> class PltSection final : public OutputSectionBase<ELFT::Is64Bits> { typedef OutputSectionBase<ELFT::Is64Bits> Base; typedef typename Base::uintX_t uintX_t; @@ -172,7 +189,7 @@ class RelocationSection final : public OutputSectionBase<ELFT::Is64Bits> { typedef typename llvm::object::ELFFile<ELFT>::uintX_t uintX_t; public: - RelocationSection(bool IsRela); + RelocationSection(StringRef Name, bool IsRela); void addReloc(const DynamicReloc<ELFT> &Reloc) { Relocs.push_back(Reloc); } void finalize() override; void writeTo(uint8_t *Buf) override; @@ -284,6 +301,7 @@ private: // until Writer is initialized. template <class ELFT> struct Out { static DynamicSection<ELFT> *Dynamic; + static GotPltSection<ELFT> *GotPlt; static GotSection<ELFT> *Got; static HashTableSection<ELFT> *HashTab; static InterpSection<ELFT::Is64Bits> *Interp; @@ -292,6 +310,7 @@ template <class ELFT> struct Out { static uint8_t *OpdBuf; static PltSection<ELFT> *Plt; static RelocationSection<ELFT> *RelaDyn; + static RelocationSection<ELFT> *RelaPlt; static StringTableSection<ELFT::Is64Bits> *DynStrTab; static StringTableSection<ELFT::Is64Bits> *StrTab; static SymbolTableSection<ELFT> *DynSymTab; @@ -299,6 +318,7 @@ template <class ELFT> struct Out { }; template <class ELFT> DynamicSection<ELFT> *Out<ELFT>::Dynamic; +template <class ELFT> GotPltSection<ELFT> *Out<ELFT>::GotPlt; template <class ELFT> GotSection<ELFT> *Out<ELFT>::Got; template <class ELFT> HashTableSection<ELFT> *Out<ELFT>::HashTab; template <class ELFT> InterpSection<ELFT::Is64Bits> *Out<ELFT>::Interp; @@ -307,6 +327,7 @@ template <class ELFT> OutputSection<ELFT> *Out<ELFT>::Opd; template <class ELFT> uint8_t *Out<ELFT>::OpdBuf; template <class ELFT> PltSection<ELFT> *Out<ELFT>::Plt; template <class ELFT> RelocationSection<ELFT> *Out<ELFT>::RelaDyn; +template <class ELFT> RelocationSection<ELFT> *Out<ELFT>::RelaPlt; template <class ELFT> StringTableSection<ELFT::Is64Bits> *Out<ELFT>::DynStrTab; template <class ELFT> StringTableSection<ELFT::Is64Bits> *Out<ELFT>::StrTab; template <class ELFT> SymbolTableSection<ELFT> *Out<ELFT>::DynSymTab; |