[PATCH] D75836: [MC] Allow Stackmap sections after DWARF in MachO.

Lang Hames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 8 22:23:32 PDT 2020


lhames created this revision.
lhames added reviewers: aprantl, dblaikie, echristo.
Herald added subscribers: ributzka, hiraditya.
Herald added a project: LLVM.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D75836

Files:
  llvm/lib/MC/MCMachOStreamer.cpp


Index: llvm/lib/MC/MCMachOStreamer.cpp
===================================================================
--- llvm/lib/MC/MCMachOStreamer.cpp
+++ llvm/lib/MC/MCMachOStreamer.cpp
@@ -155,7 +155,9 @@
   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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75836.249029.patch
Type: text/x-patch
Size: 717 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200309/b67ed5d1/attachment.bin>


More information about the llvm-commits mailing list