aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2020-03-08 21:41:10 -0700
committerLang Hames <lhames@gmail.com>2020-03-09 18:33:32 -0700
commit3f981cdde90fada6a6aa0f6ebe2f53105b80d523 (patch)
tree7317e62f304a460ff5134a832db49b35f1bb22a6 /llvm/lib
parente241573d5972d34a323fa5c64774c4207340beb3 (diff)
downloadllvm-3f981cdde90fada6a6aa0f6ebe2f53105b80d523.zip
llvm-3f981cdde90fada6a6aa0f6ebe2f53105b80d523.tar.gz
llvm-3f981cdde90fada6a6aa0f6ebe2f53105b80d523.tar.bz2
[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
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/MC/MCMachOStreamer.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCMachOStreamer.cpp b/llvm/lib/MC/MCMachOStreamer.cpp
index e69beb7..cc62a22 100644
--- a/llvm/lib/MC/MCMachOStreamer.cpp
+++ b/llvm/lib/MC/MCMachOStreamer.cpp
@@ -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.