summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2019-03-06 03:07:57 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2019-03-06 03:07:57 +0000
commit5ee9abd4c80ba45326843fdbc296f0b5d6b78fba (patch)
tree2cdbccf33d01dc744f2614e47dc03718951e86b4
parent704dfd6e28cbcd5ea34e0d12767e36952664302d (diff)
downloadbcm5719-llvm-5ee9abd4c80ba45326843fdbc296f0b5d6b78fba.tar.gz
bcm5719-llvm-5ee9abd4c80ba45326843fdbc296f0b5d6b78fba.zip
ELF: De-template OutputSection::finalize() and MipsGotSection::build(). NFCI.
Differential Revision: https://reviews.llvm.org/D58810 llvm-svn: 355479
-rw-r--r--lld/ELF/OutputSections.cpp13
-rw-r--r--lld/ELF/OutputSections.h2
-rw-r--r--lld/ELF/SyntheticSections.cpp7
-rw-r--r--lld/ELF/SyntheticSections.h2
-rw-r--r--lld/ELF/Writer.cpp4
5 files changed, 8 insertions, 20 deletions
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp
index 96be5a1b4d3..8614a6097e0 100644
--- a/lld/ELF/OutputSections.cpp
+++ b/lld/ELF/OutputSections.cpp
@@ -263,7 +263,6 @@ template <class ELFT> void OutputSection::writeTo(uint8_t *Buf) {
writeInt(Buf + Data->Offset, Data->Expression().getValue(), Data->Size);
}
-template <class ELFT>
static void finalizeShtGroup(OutputSection *OS,
InputSection *Section) {
assert(Config->Relocatable);
@@ -274,12 +273,11 @@ static void finalizeShtGroup(OutputSection *OS,
// sh_info then contain index of an entry in symbol table section which
// provides signature of the section group.
- ObjFile<ELFT> *Obj = Section->getFile<ELFT>();
- ArrayRef<Symbol *> Symbols = Obj->getSymbols();
+ ArrayRef<Symbol *> Symbols = Section->File->getSymbols();
OS->Info = In.SymTab->getSymbolIndex(Symbols[Section->Info]);
}
-template <class ELFT> void OutputSection::finalize() {
+void OutputSection::finalize() {
if (Type == SHT_NOBITS)
for (BaseCommand *Base : SectionCommands)
if (isa<ByteCommand>(Base))
@@ -298,7 +296,7 @@ template <class ELFT> void OutputSection::finalize() {
}
if (Type == SHT_GROUP) {
- finalizeShtGroup<ELFT>(this, First);
+ finalizeShtGroup(this, First);
return;
}
@@ -428,8 +426,3 @@ template void OutputSection::maybeCompress<ELF32LE>();
template void OutputSection::maybeCompress<ELF32BE>();
template void OutputSection::maybeCompress<ELF64LE>();
template void OutputSection::maybeCompress<ELF64BE>();
-
-template void OutputSection::finalize<ELF32LE>();
-template void OutputSection::finalize<ELF32BE>();
-template void OutputSection::finalize<ELF64LE>();
-template void OutputSection::finalize<ELF64BE>();
diff --git a/lld/ELF/OutputSections.h b/lld/ELF/OutputSections.h
index 275b72f10e2..3a76607dc97 100644
--- a/lld/ELF/OutputSections.h
+++ b/lld/ELF/OutputSections.h
@@ -101,7 +101,7 @@ public:
bool ExpressionsUseSymbols = false;
bool InOverlay = false;
- template <class ELFT> void finalize();
+ void finalize();
template <class ELFT> void writeTo(uint8_t *Buf);
template <class ELFT> void maybeCompress();
diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp
index d5514f6e123..a31ef9ad50e 100644
--- a/lld/ELF/SyntheticSections.cpp
+++ b/lld/ELF/SyntheticSections.cpp
@@ -819,7 +819,7 @@ bool MipsGotSection::updateAllocSize() {
return false;
}
-template <class ELFT> void MipsGotSection::build() {
+void MipsGotSection::build() {
if (Gots.empty())
return;
@@ -3192,11 +3192,6 @@ template void PltSection::addEntry<ELF32BE>(Symbol &Sym);
template void PltSection::addEntry<ELF64LE>(Symbol &Sym);
template void PltSection::addEntry<ELF64BE>(Symbol &Sym);
-template void MipsGotSection::build<ELF32LE>();
-template void MipsGotSection::build<ELF32BE>();
-template void MipsGotSection::build<ELF64LE>();
-template void MipsGotSection::build<ELF64BE>();
-
template class elf::MipsAbiFlagsSection<ELF32LE>;
template class elf::MipsAbiFlagsSection<ELF32BE>;
template class elf::MipsAbiFlagsSection<ELF64LE>;
diff --git a/lld/ELF/SyntheticSections.h b/lld/ELF/SyntheticSections.h
index 93a723fbf82..d160d3a96f6 100644
--- a/lld/ELF/SyntheticSections.h
+++ b/lld/ELF/SyntheticSections.h
@@ -190,7 +190,7 @@ public:
// Join separate GOTs built for each input file to generate
// primary and optional multiple secondary GOTs.
- template <class ELFT> void build();
+ void build();
void addEntry(InputFile &File, Symbol &Sym, int64_t Addend, RelExpr Expr);
void addDynTlsEntry(InputFile &File, Symbol &Sym);
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index 5703a63fbde..705ce0f65ba 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -1723,7 +1723,7 @@ template <class ELFT> void Writer<ELFT>::finalizeSections() {
return;
if (In.MipsGot)
- In.MipsGot->build<ELFT>();
+ In.MipsGot->build();
removeUnusedSyntheticSections();
@@ -1835,7 +1835,7 @@ template <class ELFT> void Writer<ELFT>::finalizeSections() {
// at the end because some tags like RELSZ depend on result
// of finalizing other sections.
for (OutputSection *Sec : OutputSections)
- Sec->finalize<ELFT>();
+ Sec->finalize();
}
// Ensure data sections are not mixed with executable sections when
OpenPOWER on IntegriCloud