Skip to content

Commit

Permalink
[MC] Allow Stackmap sections after DWARF in MachO.
Browse files Browse the repository at this point in the history
Summary:
Mixing stackmaps and DWARF in a single file triggers an assertion in
MCMachOStreamer as stackmap sections are emitted in AsmPrinter::emitEndOfAsmFile
after the DWARF sections have already been emitted.

Since it should be safe to emit stackmap sections after DWARF sections this
patch relaxes the assertion to allow that.

Reviewers: aprantl, dblaikie, echristo

Subscribers: hiraditya, ributzka, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D75836
  • Loading branch information
lhames committed Mar 10, 2020
1 parent e241573 commit 3f981cd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion llvm/lib/MC/MCMachOStreamer.cpp
Expand Up @@ -155,7 +155,9 @@ void MCMachOStreamer::ChangeSection(MCSection *Section,
if (SegName == "__DWARF")
CreatedADWARFSection = true;
else if (Created && DWARFMustBeAtTheEnd && !canGoAfterDWARF(MSec))
assert(!CreatedADWARFSection && "Creating regular section after DWARF");
assert((!CreatedADWARFSection ||
Section == getContext().getObjectFileInfo()->getStackMapSection())
&& "Creating regular section after DWARF");

// Output a linker-local symbol so we don't need section-relative local
// relocations. The linker hates us when we do that.
Expand Down

0 comments on commit 3f981cd

Please sign in to comment.