summaryrefslogtreecommitdiff
path: root/lib/MC/MCWinCOFFStreamer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/MC/MCWinCOFFStreamer.cpp')
-rw-r--r--lib/MC/MCWinCOFFStreamer.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/lib/MC/MCWinCOFFStreamer.cpp b/lib/MC/MCWinCOFFStreamer.cpp
index c2583d95c5eda..8582d9adafb84 100644
--- a/lib/MC/MCWinCOFFStreamer.cpp
+++ b/lib/MC/MCWinCOFFStreamer.cpp
@@ -257,20 +257,13 @@ void MCWinCOFFStreamer::EmitLocalCommonSymbol(MCSymbol *S, uint64_t Size,
auto *Symbol = cast<MCSymbolCOFF>(S);
MCSection *Section = getContext().getObjectFileInfo()->getBSSSection();
- getAssembler().registerSection(*Section);
- if (Section->getAlignment() < ByteAlignment)
- Section->setAlignment(ByteAlignment);
-
- getAssembler().registerSymbol(*Symbol);
+ PushSection();
+ SwitchSection(Section);
+ EmitValueToAlignment(ByteAlignment, 0, 1, 0);
+ EmitLabel(Symbol);
Symbol->setExternal(false);
-
- if (ByteAlignment != 1)
- new MCAlignFragment(ByteAlignment, /*Value=*/0, /*ValueSize=*/0,
- ByteAlignment, Section);
-
- MCFillFragment *Fragment = new MCFillFragment(
- /*Value=*/0, Size, Section);
- Symbol->setFragment(Fragment);
+ EmitZeros(Size);
+ PopSection();
}
void MCWinCOFFStreamer::EmitZerofill(MCSection *Section, MCSymbol *Symbol,