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

Andrew Ng via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 3 07:00:29 PDT 2026


================
@@ -640,6 +640,26 @@ template <class ELFT> void ObjFile<ELFT>::parse(bool ignoreComdats) {
       continue;
     }
 
+    if (sec.sh_type == SHT_LLVM_DYNDBG_ELF) {
+      // Check for presence of dynamic debugging section and create the input
+      // section but mark for discard.
+      StringRef name = check(obj.getSectionName(sec, shstrtab));
+      if (name == dynDbgSecName) {
+        sections[i] = &InputSection::discarded;
+        dynDbgSec = std::make_unique<InputSection>(*this, sec, name);
+        ctx.hasDynDbg = true;
+
+        // If ICF is enabled, warn and disable it because it's incompatible with
+        // dynamic debugging.
+        if (ctx.arg.icf != ICFLevel::None) {
----------------
nga888 wrote:

Thanks for these changes and improvements. They LGTM, so I have applied your patch to this PR.

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


More information about the llvm-commits mailing list