[Lldb-commits] [PATCH] D54747: Discard debuginfo for object files empty after GC

Reid Kleckner via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu May 16 13:58:53 PDT 2019

rnk added a comment.

There's another use case worth considering here, which is -fmodules-debuginfo. In that situation, a standalone object file is emitted that contains nothing but DWARF .debug_info sections, and the object is fed to the linker. If the linker drops it with --gc-sections, it's not going to work. Here's a transcript of me trying to use this feature:

Note that t.o (the normal object) only contains a forward declaration of Foo, and the complete definition is provided in the debug-info-only module object file, t2.o in this case.

I think, before this change, passing an object with only .debug_info in it (and --gc-sections) used to retain that debug info. I think we need a way to keep doing that going forward. I think that might mean we need a new flag for this new behavior, or we should revert this patch altogether, and recommend that people who want smaller debug info use tools like dsymutil, dwz, DWP, or other format aware things that can remove unreferenced or duplicate DWARF.




More information about the lldb-commits mailing list