summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/ELF/Writer.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index f79d400ec78..16a9e8d4cf4 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -650,25 +650,22 @@ OutputSectionFactory<ELFT>::create(InputSectionBase<ELFT> *C,
OutputSectionBase<ELFT> *&Sec = Map[Key];
if (Sec)
return {Sec, false};
- Sec = createAux(C, Key);
- return {Sec, true};
-}
-template <class ELFT>
-OutputSectionBase<ELFT> *
-OutputSectionFactory<ELFT>::createAux(InputSectionBase<ELFT> *C,
- const SectionKey<ELFT::Is64Bits> &Key) {
switch (C->SectionKind) {
case InputSectionBase<ELFT>::Regular:
- return new OutputSection<ELFT>(Key.Name, Key.Type, Key.Flags);
+ Sec = new OutputSection<ELFT>(Key.Name, Key.Type, Key.Flags);
+ break;
case InputSectionBase<ELFT>::EHFrame:
- return new EHOutputSection<ELFT>(Key.Name, Key.Type, Key.Flags);
+ Sec = new EHOutputSection<ELFT>(Key.Name, Key.Type, Key.Flags);
+ break;
case InputSectionBase<ELFT>::Merge:
- return new MergeOutputSection<ELFT>(Key.Name, Key.Type, Key.Flags);
+ Sec = new MergeOutputSection<ELFT>(Key.Name, Key.Type, Key.Flags);
+ break;
case InputSectionBase<ELFT>::MipsReginfo:
- return new MipsReginfoOutputSection<ELFT>();
+ Sec = new MipsReginfoOutputSection<ELFT>();
+ break;
}
- llvm_unreachable("Unknown output section type");
+ return {Sec, true};
}
template <class ELFT>
OpenPOWER on IntegriCloud