[lld] [lld-macho] Fix crash with DWARF section-relative relocations (PR #168075)
Joel Reymont via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 28 05:22:33 PST 2025
joelreymont wrote:
This PR attempts to prevent `lld-macho` from crashing when it encounters DWARF section‑relative relocations. Today, OCaml’s DWARF output can produce relocations that `lld` doesn’t rewrite correctly, and `dsymutil` rejects or strips them, leaving linked Mach‑O binaries (and dSYMs) without usable debug info.
The change adjusts `lld`’s handling of these relocations so DWARF is preserved end‑to‑end: no crash during linking, relocations rewritten properly for `dsymutil`, and the final binary/dSYM retains complete debug info.
This avoids having to skip or downgrade post‑link DWARF checks due to missing debug sections.
https://github.com/llvm/llvm-project/pull/168075
More information about the llvm-commits
mailing list