[MC] Allow Stackmap sections after DWARF in MachO.

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
This commit is contained in:
Lang Hames 2020-03-08 21:41:10 -07:00
parent e241573d59
commit 3f981cdde9
1 changed files with 3 additions and 1 deletions

View File

@ -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.