summaryrefslogtreecommitdiffstats
path: root/lld/ELF/SyntheticSections.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/SyntheticSections.cpp')
-rw-r--r--lld/ELF/SyntheticSections.cpp32
1 files changed, 1 insertions, 31 deletions
diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp
index 095a538d8bf..4e6b3c92a73 100644
--- a/lld/ELF/SyntheticSections.cpp
+++ b/lld/ELF/SyntheticSections.cpp
@@ -1387,7 +1387,7 @@ template <class ELFT> void SymbolTableSection<ELFT>::writeTo(uint8_t *Buf) {
ESym->st_size = Body->getSize<ELFT>();
ESym->st_value = Body->getVA<ELFT>();
- if (const OutputSection *OutSec = getOutputSection(Body)) {
+ if (const OutputSection *OutSec = Body->getOutputSection<ELFT>()) {
ESym->st_shndx = OutSec->SectionIndex;
// This piece of code should go away as it doesn't make sense,
@@ -1428,36 +1428,6 @@ template <class ELFT> void SymbolTableSection<ELFT>::writeTo(uint8_t *Buf) {
}
template <class ELFT>
-const OutputSection *
-SymbolTableSection<ELFT>::getOutputSection(SymbolBody *Sym) {
- switch (Sym->kind()) {
- case SymbolBody::DefinedSyntheticKind:
- return cast<DefinedSynthetic>(Sym)->Section;
- case SymbolBody::DefinedRegularKind: {
- auto &D = cast<DefinedRegular<ELFT>>(*Sym);
- if (D.Section)
- return D.Section->template getOutputSection<ELFT>();
- break;
- }
- case SymbolBody::DefinedCommonKind:
- if (!Config->DefineCommon)
- return nullptr;
- return In<ELFT>::Common->OutSec;
- case SymbolBody::SharedKind: {
- auto &SS = cast<SharedSymbol>(*Sym);
- if (SS.NeedsCopy)
- return SS.Section->OutSec;
- break;
- }
- case SymbolBody::UndefinedKind:
- case SymbolBody::LazyArchiveKind:
- case SymbolBody::LazyObjectKind:
- break;
- }
- return nullptr;
-}
-
-template <class ELFT>
GnuHashTableSection<ELFT>::GnuHashTableSection()
: SyntheticSection(SHF_ALLOC, SHT_GNU_HASH, sizeof(uintX_t), ".gnu.hash") {
this->Entsize = ELFT::Is64Bits ? 0 : 4;
OpenPOWER on IntegriCloud