Remove DefinedCommon::Section.
Since CommonInputSection is a singleton class, we don't need
to store pointers to all DefinedCommon symbols.
llvm-svn: 277410
diff --git a/lld/ELF/Symbols.cpp b/lld/ELF/Symbols.cpp
index 6d7e797..b1056f8 100644
--- a/lld/ELF/Symbols.cpp
+++ b/lld/ELF/Symbols.cpp
@@ -63,10 +63,10 @@
return VA - Out<ELFT>::TlsPhdr->p_vaddr;
return VA;
}
- case SymbolBody::DefinedCommonKind: {
- auto &D = cast<DefinedCommon<ELFT>>(Body);
- return D.Section->OutSec->getVA() + D.Section->OutSecOff + D.Offset;
- }
+ case SymbolBody::DefinedCommonKind:
+ return CommonInputSection<ELFT>::X->OutSec->getVA() +
+ CommonInputSection<ELFT>::X->OutSecOff +
+ cast<DefinedCommon<ELFT>>(Body).Offset;
case SymbolBody::SharedKind: {
auto &SS = cast<SharedSymbol<ELFT>>(Body);
if (!SS.NeedsCopyOrPltAddr)