================
@@ -2856,6 +2856,15 @@ bool AsmPrinter::doFinalization(Module &M) {
   // sections after DWARF.
   for (const auto &IFunc : M.ifuncs())
     emitGlobalIFunc(M, IFunc);
+  if (TM.getTargetTriple().isOSBinFormatXCOFF() && hasDebugInfo()) {
----------------
w2yehia wrote:

According to this comment 
  https://reviews.llvm.org/D95518#inline-917608
in patch "[Debug-Info][XCOFF] support dwarf for XCOFF for assembly output"
 > we need an end symbol for all instructions in the current CU, so we have to 
 > add it in 
 > PPCAIXAsmPrinter::doFinalization() which runs after all functions being 
 > handled by AsmPrinter::runOnMachineFunction()

Since now we're adding more code (in the .text section) during ifunc lowering, 
this code had to be moved to after ifunc lowering, which still occurs before 
debug info is generated.

Without this change, you would hit an assertion:
```
Assertion failed: !Section->hasEnded() && "Section already ended", file  
/home/wyehia/Source/llvm-project/llvm/lib/MC/MCStreamer.cpp, line 1370, virtual 
void llvm::MCStreamer::switchSection(MCSection *, uint32_t)
```

https://github.com/llvm/llvm-project/pull/153049
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to