diff options
-rw-r--r-- | lld/ELF/SyntheticSections.cpp | 1 | ||||
-rw-r--r-- | lld/ELF/SyntheticSections.h | 3 | ||||
-rw-r--r-- | lld/ELF/Target.cpp | 4 | ||||
-rw-r--r-- | lld/ELF/Writer.cpp | 14 |
4 files changed, 11 insertions, 11 deletions
diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index 072f945b4ba..be8b12c9f76 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -2245,6 +2245,7 @@ BssSection *InX::Bss; BssSection *InX::BssRelRo; BuildIdSection *InX::BuildId; InputSection *InX::Common; +SyntheticSection *InX::Dynamic; StringTableSection *InX::DynStrTab; InputSection *InX::Interp; GdbIndexSection *InX::GdbIndex; diff --git a/lld/ELF/SyntheticSections.h b/lld/ELF/SyntheticSections.h index 1098c58a3ba..006ba420c97 100644 --- a/lld/ELF/SyntheticSections.h +++ b/lld/ELF/SyntheticSections.h @@ -750,6 +750,7 @@ struct InX { static BssSection *BssRelRo; static BuildIdSection *BuildId; static InputSection *Common; + static SyntheticSection *Dynamic; static StringTableSection *DynStrTab; static InputSection *Interp; static GdbIndexSection *GdbIndex; @@ -764,7 +765,6 @@ struct InX { }; template <class ELFT> struct In : public InX { - static DynamicSection<ELFT> *Dynamic; static SymbolTableSection<ELFT> *DynSymTab; static EhFrameHeader<ELFT> *EhFrameHdr; static GnuHashTableSection<ELFT> *GnuHashTab; @@ -780,7 +780,6 @@ template <class ELFT> struct In : public InX { static VersionNeedSection<ELFT> *VerNeed; }; -template <class ELFT> DynamicSection<ELFT> *In<ELFT>::Dynamic; template <class ELFT> SymbolTableSection<ELFT> *In<ELFT>::DynSymTab; template <class ELFT> EhFrameHeader<ELFT> *In<ELFT>::EhFrameHdr; template <class ELFT> GnuHashTableSection<ELFT> *In<ELFT>::GnuHashTab; diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp index 21efc226a12..6ba6d5b7763 100644 --- a/lld/ELF/Target.cpp +++ b/lld/ELF/Target.cpp @@ -429,7 +429,7 @@ RelExpr X86TargetInfo::adjustRelaxExpr(uint32_t Type, const uint8_t *Data, } void X86TargetInfo::writeGotPltHeader(uint8_t *Buf) const { - write32le(Buf, In<ELF32LE>::Dynamic->getVA()); + write32le(Buf, InX::Dynamic->getVA()); } void X86TargetInfo::writeGotPlt(uint8_t *Buf, const SymbolBody &S) const { @@ -718,7 +718,7 @@ void X86_64TargetInfo<ELFT>::writeGotPltHeader(uint8_t *Buf) const { // required, but it is documented in the psabi and the glibc dynamic linker // seems to use it (note that this is relevant for linking ld.so, not any // other program). - write64le(Buf, In<ELFT>::Dynamic->getVA()); + write64le(Buf, InX::Dynamic->getVA()); } template <class ELFT> diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index 54688dc0865..faa6997357e 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -313,7 +313,7 @@ template <class ELFT> void Writer<ELFT>::createSyntheticSections() { auto Add = [](InputSectionBase *Sec) { InputSections.push_back(Sec); }; InX::DynStrTab = make<StringTableSection>(".dynstr", true); - In<ELFT>::Dynamic = make<DynamicSection<ELFT>>(); + InX::Dynamic = make<DynamicSection<ELFT>>(); In<ELFT>::RelaDyn = make<RelocationSection<ELFT>>( Config->IsRela ? ".rela.dyn" : ".rel.dyn", Config->ZCombreloc); InX::ShStrTab = make<StringTableSection>(".shstrtab", false); @@ -393,7 +393,7 @@ template <class ELFT> void Writer<ELFT>::createSyntheticSections() { Add(In<ELFT>::HashTab); } - Add(In<ELFT>::Dynamic); + Add(InX::Dynamic); Add(InX::DynStrTab); Add(In<ELFT>::RelaDyn); } @@ -626,7 +626,7 @@ template <class ELFT> bool elf::isRelroSection(const OutputSection *Sec) { // .dynamic section contains data for the dynamic linker, and // there's no need to write to it at runtime, so it's better to put // it into RELRO. - if (Sec == In<ELFT>::Dynamic->OutSec) + if (Sec == InX::Dynamic->OutSec) return true; // .bss.rel.ro is used for copy relocations for read-only symbols. @@ -1110,7 +1110,7 @@ template <class ELFT> void Writer<ELFT>::finalizeSections() { // Even the author of gold doesn't remember why gold behaves that way. // https://sourceware.org/ml/binutils/2002-03/msg00360.html if (In<ELFT>::DynSymTab) - addRegular<ELFT>("_DYNAMIC", In<ELFT>::Dynamic, 0); + addRegular<ELFT>("_DYNAMIC", InX::Dynamic, 0); // Define __rel[a]_iplt_{start,end} symbols if needed. addRelIpltSymbols(); @@ -1188,7 +1188,7 @@ template <class ELFT> void Writer<ELFT>::finalizeSections() { InX::MipsGot, InX::IgotPlt, InX::GotPlt, In<ELFT>::RelaDyn, In<ELFT>::RelaIplt, In<ELFT>::RelaPlt, InX::Plt, InX::Iplt, In<ELFT>::EhFrameHdr, - In<ELFT>::VerSym, In<ELFT>::VerNeed, In<ELFT>::Dynamic}, + In<ELFT>::VerSym, In<ELFT>::VerNeed, InX::Dynamic}, [](SyntheticSection *SS) { SS->finalizeContents(); }); // Some architectures use small displacements for jump instructions. @@ -1355,8 +1355,8 @@ template <class ELFT> std::vector<PhdrEntry> Writer<ELFT>::createPhdrs() { // Add an entry for .dynamic. if (In<ELFT>::DynSymTab) - AddHdr(PT_DYNAMIC, In<ELFT>::Dynamic->OutSec->getPhdrFlags()) - ->add(In<ELFT>::Dynamic->OutSec); + AddHdr(PT_DYNAMIC, InX::Dynamic->OutSec->getPhdrFlags()) + ->add(InX::Dynamic->OutSec); // PT_GNU_RELRO includes all sections that should be marked as // read-only by dynamic linker after proccessing relocations. |