llvm-project
86f2ec03 - [llvm][DWARFLinker] Don't attach DW_AT_dwo_id to CUs (#105186)

Commit
1 year ago
[llvm][DWARFLinker] Don't attach DW_AT_dwo_id to CUs (#105186) This fixes a verifier error uncovered as a result of https://github.com/llvm/llvm-project/pull/101775. When compiling with `-gmodules`, Clang will create a skeleton CU that contains a `DW_AT_dwo_id` and a `DW_AT_dwo_name` corresponding to the path of the `.pcm` that carries the type definitions referenced in the non-skeleton CU (see the [gmodules LLDB docs](https://lldb.llvm.org/resources/extensions.html) for more details). The non-skeleton CU will also contain a `DW_AT_dwo_id` that matches that of the skeleton. `dsymutil` effectively undoes the `-gmodules` work, replacing all the module type references with definitions. I.e., we no longer create a skeleton `.dwo` CU. Prior to this patch `dsymutil` did not strip out the `DW_AT_dwo_id` on the non-skeleton CU. This now (since https://github.com/llvm/llvm-project/pull/101775) causes verification errors such as: ``` Verifying .debug_names... error: Name Index @ 0x0: Entry @ 0x9a unable to load .dwo file "None" for DWARF unit @ 0x0. error: output verification failed for x86_64 make: *** [a.out.dSYM] Error 1 ``` ...because the verifier sees the DWO ID but can't find a matching `.dwo` unit. This patch simply strips the `DW_AT_dwo_id` from the main CU.
Author
Parents
Loading