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/Symbols.cpp b/lld/ELF/Symbols.cpp
index f59132a..1c8c9a8 100644
--- a/lld/ELF/Symbols.cpp
+++ b/lld/ELF/Symbols.cpp
@@ -12,6 +12,7 @@
#include "InputFiles.h"
#include "InputSection.h"
#include "OutputSections.h"
+#include "SyntheticSections.h"
#include "Target.h"
#include "llvm/ADT/STLExtras.h"
@@ -69,8 +70,7 @@
return VA;
}
case SymbolBody::DefinedCommonKind:
- return InputSection<ELFT>::CommonInputSection->OutSec->getVA() +
- InputSection<ELFT>::CommonInputSection->OutSecOff +
+ return In<ELFT>::Common->OutSec->getVA() + In<ELFT>::Common->OutSecOff +
cast<DefinedCommon>(Body).Offset;
case SymbolBody::SharedKind: {
auto &SS = cast<SharedSymbol<ELFT>>(Body);