[lld] [llvm] [dyndbg][LLD][ELF] Initial LLD support for dynamic debugging (PR #214188)

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 7 09:06:36 PDT 2026


================
@@ -1914,6 +1918,41 @@ template <class ELFT> void Writer<ELFT>::finalizeSections() {
     // called after processSymbolAssignments() because it needs to know whether
     // a linker-script-defined symbol is absolute.
     scanRelocations<ELFT>(ctx);
+
+    // Process symbols referenced by the embedded unoptimized part of dynamic
+    // debugging.
+    if (ctx.hasDynDbg) {
+      bool ignoreUnresolved =
----------------
smithp35 wrote:

This is using slightly different logic to the existing undefined symbol reporting in `RelocScan::maybeReportUndefined()` https://github.com/llvm/llvm-project/blob/main/lld/ELF/Relocations.cpp#L657

While I don't think we can easily extract into a single code-path would be good to try and match as close as we can. For example:
* undefined weak symbols with version suffixes are reported.
* ctx.arg.noinhibitExec causes a Warning rather than an error.

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


More information about the llvm-commits mailing list