[clang] [compiler-rt] [llvm] [AIX] Implement the ifunc attribute. (PR #153049)

Wael Yehia via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 12 13:50:12 PST 2026


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


More information about the cfe-commits mailing list