[llvm] 3f981cd - [MC] Allow Stackmap sections after DWARF in MachO.
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 9 18:34:15 PDT 2020
Author: Lang Hames
Date: 2020-03-09T18:33:32-07:00
New Revision: 3f981cdde90fada6a6aa0f6ebe2f53105b80d523
URL: https://github.com/llvm/llvm-project/commit/3f981cdde90fada6a6aa0f6ebe2f53105b80d523
DIFF: https://github.com/llvm/llvm-project/commit/3f981cdde90fada6a6aa0f6ebe2f53105b80d523.diff
LOG: [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
Added:
Modified:
llvm/lib/MC/MCMachOStreamer.cpp
Removed:
################################################################################
diff --git a/llvm/lib/MC/MCMachOStreamer.cpp b/llvm/lib/MC/MCMachOStreamer.cpp
index e69beb7b479a..cc62a2277d1e 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.
More information about the llvm-commits
mailing list