[llvm] [LLVM][DWARF] Add support for .gnu_debuglink (PR #77715)

Kevin Frei via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 18 12:25:40 PST 2024


================
@@ -127,6 +127,9 @@ class DWARFContext : public DIContext {
 
   std::unique_ptr<const DWARFObject> DObj;
 
+  /// Binary containing debug information after objcopy --only-keep-debug
+  object::OwningBinary<object::ObjectFile> GnuLink;
----------------
kevinfrei wrote:

Debuginfod (the "protocol") is actually quite underspecified for this scenario (I'm in the middle of adding full support for split, stripped, and "only-keep-debug" symbol acquisition through libdebuginfod) You *can't* replace the original binary with the .gnu.debuglink binary, because there's a high probability that the linked binary is missing a bunch of stuff from the stripped binary.

>From what I've gathered they appear to be used as the "original split dwarf" because a common use is to make the .gnu.debuglink point to the an "objcopy --only-keep-debug" version of the binary, so it doesn't have anything *except* the DWARF data (there's almost no overlap between the --strip-debug and --only-keep-debug versions of the binary, and I *think* you need both do actually debug stuff...)

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


More information about the llvm-commits mailing list