Simplify output section ownership management.
One reason why we are (ab)using OutputSectionFactory class is
because it owns output sections. Technically there's no need
to have it own sections. So, this patch transfers the ownership
to Out<ELFT>.
llvm-svn: 278452
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp
index 3485737..8371fe4 100644
--- a/lld/ELF/OutputSections.cpp
+++ b/lld/ELF/OutputSections.cpp
@@ -1765,7 +1765,7 @@
case InputSectionBase<ELFT>::Layout:
llvm_unreachable("Invalid section type");
}
- OwningSections.emplace_back(Sec);
+ Out<ELFT>::Pool.emplace_back(Sec);
return {Sec, true};
}