Rewrite CommonInputSection as a synthetic input section.
A CommonInputSection is a section containing all common symbols.
That was an input section but was abstracted in a different way
than the synthetic input sections because it was written before
the synthetic input section was invented.
This patch rewrites CommonInputSection as a synthetic input section
so that it behaves better with other sections.
llvm-svn: 286053
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index dd46fae..53d2cc5 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -202,13 +202,9 @@
if (elf::ObjectFile<ELFT> *F = S->getFile())
Filename = sys::path::filename(F->getName());
- if (!I->FilePat.match(Filename) || Pat.ExcludedFilePat.match(Filename))
- continue;
-
- if (Pat.SectionPat.match(S->Name))
+ if (I->FilePat.match(Filename) && !Pat.ExcludedFilePat.match(Filename) &&
+ Pat.SectionPat.match(S->Name))
I->Sections.push_back(S);
- if (Pat.SectionPat.match("COMMON"))
- I->Sections.push_back(InputSection<ELFT>::CommonInputSection);
}
// Sort sections as instructed by SORT-family commands and --sort-section