Split addSection into two small functions. NFCI.
addSection function was hard to read because it behaves differently
depending on its arguments but what exactly it does is not clear.
Now it should be better. Still, it is not clear (not what but) why
it does what it does, but I'll take a look at it later.
llvm-svn: 315124
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index 1bbdb01..6cfbc5d 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -458,7 +458,7 @@
});
log(toString(S) + " is being placed in '" + Name + "'");
if (I == End) {
- Factory.addInputSec(S, Name);
+ Factory.addInputSec(S, Name, nullptr);
assert(S->getOutputSection()->SectionIndex == INT_MAX);
} else {
OutputSection *Sec = cast<OutputSection>(*I);