ELF2: Reduce code repetition.

llvm-svn: 249882
This commit is contained in:
Rui Ueyama 2015-10-09 19:34:55 +00:00
parent 444576d4c4
commit d888d10cf4
2 changed files with 12 additions and 45 deletions

View File

@ -20,51 +20,6 @@ using namespace llvm::ELF;
using namespace lld;
using namespace lld::elf2;
template <> DynamicSection<ELF32BE> *Out<ELF32BE>::Dynamic = nullptr;
template <> DynamicSection<ELF32LE> *Out<ELF32LE>::Dynamic = nullptr;
template <> DynamicSection<ELF64BE> *Out<ELF64BE>::Dynamic = nullptr;
template <> DynamicSection<ELF64LE> *Out<ELF64LE>::Dynamic = nullptr;
template <> GotSection<ELF32BE> *Out<ELF32BE>::Got = nullptr;
template <> GotSection<ELF32LE> *Out<ELF32LE>::Got = nullptr;
template <> GotSection<ELF64BE> *Out<ELF64BE>::Got = nullptr;
template <> GotSection<ELF64LE> *Out<ELF64LE>::Got = nullptr;
template <> HashTableSection<ELF32BE> *Out<ELF32BE>::HashTab = nullptr;
template <> HashTableSection<ELF32LE> *Out<ELF32LE>::HashTab = nullptr;
template <> HashTableSection<ELF64BE> *Out<ELF64BE>::HashTab = nullptr;
template <> HashTableSection<ELF64LE> *Out<ELF64LE>::HashTab = nullptr;
template <> InterpSection<false> *Out<ELF32BE>::Interp = nullptr;
template <> InterpSection<false> *Out<ELF32LE>::Interp = nullptr;
template <> InterpSection<true> *Out<ELF64BE>::Interp = nullptr;
template <> InterpSection<true> *Out<ELF64LE>::Interp = nullptr;
template <> OutputSection<ELF32BE> *Out<ELF32BE>::Bss = nullptr;
template <> OutputSection<ELF32LE> *Out<ELF32LE>::Bss = nullptr;
template <> OutputSection<ELF64BE> *Out<ELF64BE>::Bss = nullptr;
template <> OutputSection<ELF64LE> *Out<ELF64LE>::Bss = nullptr;
template <> PltSection<ELF32BE> *Out<ELF32BE>::Plt = nullptr;
template <> PltSection<ELF32LE> *Out<ELF32LE>::Plt = nullptr;
template <> PltSection<ELF64BE> *Out<ELF64BE>::Plt = nullptr;
template <> PltSection<ELF64LE> *Out<ELF64LE>::Plt = nullptr;
template <> RelocationSection<ELF32BE> *Out<ELF32BE>::RelaDyn = nullptr;
template <> RelocationSection<ELF32LE> *Out<ELF32LE>::RelaDyn = nullptr;
template <> RelocationSection<ELF64BE> *Out<ELF64BE>::RelaDyn = nullptr;
template <> RelocationSection<ELF64LE> *Out<ELF64LE>::RelaDyn = nullptr;
template <> StringTableSection<false> *Out<ELF32BE>::DynStrTab = nullptr;
template <> StringTableSection<false> *Out<ELF32LE>::DynStrTab = nullptr;
template <> StringTableSection<true> *Out<ELF64BE>::DynStrTab = nullptr;
template <> StringTableSection<true> *Out<ELF64LE>::DynStrTab = nullptr;
template <> StringTableSection<false> *Out<ELF32BE>::StrTab = nullptr;
template <> StringTableSection<false> *Out<ELF32LE>::StrTab = nullptr;
template <> StringTableSection<true> *Out<ELF64BE>::StrTab = nullptr;
template <> StringTableSection<true> *Out<ELF64LE>::StrTab = nullptr;
template <> SymbolTableSection<ELF32BE> *Out<ELF32BE>::DynSymTab = nullptr;
template <> SymbolTableSection<ELF32LE> *Out<ELF32LE>::DynSymTab = nullptr;
template <> SymbolTableSection<ELF64BE> *Out<ELF64BE>::DynSymTab = nullptr;
template <> SymbolTableSection<ELF64LE> *Out<ELF64LE>::DynSymTab = nullptr;
template <> SymbolTableSection<ELF32BE> *Out<ELF32BE>::SymTab = nullptr;
template <> SymbolTableSection<ELF32LE> *Out<ELF32LE>::SymTab = nullptr;
template <> SymbolTableSection<ELF64BE> *Out<ELF64BE>::SymTab = nullptr;
template <> SymbolTableSection<ELF64LE> *Out<ELF64LE>::SymTab = nullptr;
template <bool Is64Bits>
OutputSectionBase<Is64Bits>::OutputSectionBase(StringRef Name, uint32_t sh_type,
uintX_t sh_flags)

View File

@ -295,6 +295,18 @@ template <class ELFT> struct Out {
static SymbolTableSection<ELFT> *DynSymTab;
static SymbolTableSection<ELFT> *SymTab;
};
template <class ELFT> DynamicSection<ELFT> *Out<ELFT>::Dynamic;
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;
template <class ELFT> OutputSection<ELFT> *Out<ELFT>::Bss;
template <class ELFT> PltSection<ELFT> *Out<ELFT>::Plt;
template <class ELFT> RelocationSection<ELFT> *Out<ELFT>::RelaDyn;
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;
template <class ELFT> SymbolTableSection<ELFT> *Out<ELFT>::SymTab;
}
}
#endif