aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCMachOStreamer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/MC/MCMachOStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCMachOStreamer.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/MC/MCMachOStreamer.cpp b/llvm/lib/MC/MCMachOStreamer.cpp
index 43598ef..8f023bd 100644
--- a/llvm/lib/MC/MCMachOStreamer.cpp
+++ b/llvm/lib/MC/MCMachOStreamer.cpp
@@ -132,8 +132,7 @@ public:
} // end anonymous namespace.
void MCMachOStreamer::changeSection(MCSection *Section, uint32_t Subsection) {
- // Change the section normally.
- changeSectionImpl(Section, Subsection);
+ MCObjectStreamer::changeSection(Section, Subsection);
// Output a linker-local symbol so we don't need section-relative local
// relocations. The linker hates us when we do that.
@@ -161,7 +160,7 @@ void MCMachOStreamer::emitLabel(MCSymbol *Symbol, SMLoc Loc) {
// We have to create a new fragment if this is an atom defining symbol,
// fragments cannot span atoms.
if (cast<MCSymbolMachO>(Symbol)->isSymbolLinkerVisible())
- insert(getContext().allocFragment<MCFragment>());
+ newFragment();
MCObjectStreamer::emitLabel(Symbol, Loc);
@@ -393,7 +392,7 @@ void MCMachOStreamer::emitZerofill(MCSection *Section, MCSymbol *Symbol,
// On darwin all virtual sections have zerofill type. Disallow the usage of
// .zerofill in non-virtual functions. If something similar is needed, use
// .space or .zero.
- if (!Section->isVirtualSection()) {
+ if (!Section->isBssSection()) {
getContext().reportError(
Loc, "The usage of .zerofill is restricted to sections of "
"ZEROFILL type. Use .zero or .space instead.");
@@ -479,7 +478,8 @@ void MCMachOStreamer::finalizeCGProfile() {
// and set its size now so that it's accounted for in layout.
MCSection *CGProfileSection = Asm.getContext().getMachOSection(
"__LLVM", "__cg_profile", 0, SectionKind::getMetadata());
- changeSection(CGProfileSection);
+ // Call the base class changeSection to omit the linker-local label.
+ MCObjectStreamer::changeSection(CGProfileSection);
// For each entry, reserve space for 2 32-bit indices and a 64-bit count.
size_t SectionBytes =
W.getCGProfile().size() * (2 * sizeof(uint32_t) + sizeof(uint64_t));
@@ -511,7 +511,8 @@ void MCMachOStreamer::createAddrSigSection() {
// to be computed immediately after in order for it to be exported correctly.
MCSection *AddrSigSection =
Asm.getContext().getObjectFileInfo()->getAddrSigSection();
- changeSection(AddrSigSection);
+ // Call the base class changeSection to omit the linker-local label.
+ MCObjectStreamer::changeSection(AddrSigSection);
auto *Frag = cast<MCFragment>(AddrSigSection->curFragList()->Head);
// We will generate a series of pointer-sized symbol relocations at offset
// 0x0. Set the section size to be large enough to contain a single pointer