[llvm-branch-commits] [lld] ELF: Only rewrite non-preemptible IFUNCs to IPLT functions if a non-IRELATIVE relocation is needed. (PR #133531)

Peter Collingbourne via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Apr 10 15:55:35 PDT 2025


================
@@ -1964,6 +1979,26 @@ void elf::postScanRelocations(Ctx &ctx) {
   for (ELFFileBase *file : ctx.objectFiles)
     for (Symbol *sym : file->getLocalSymbols())
       fn(*sym);
+
+  // Now that we have checked all ifunc symbols for demotion to regular function
+  // symbols, move IRELATIVE relocations to the right place:
+  // - Relocations for non-demoted ifuncs are added to .rela.dyn
+  // - Relocations for demoted ifuncs are turned into RELATIVE relocations
+  //   or static relocations in PDEs
----------------
pcc wrote:

Done

https://github.com/llvm/llvm-project/pull/133531


More information about the llvm-branch-commits mailing list