[PATCH] D74169: [WIP][LLD][ELF][DebugInfo] Skeleton implementation of removing obsolete debug info.

Alexey Lapshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 21 04:26:39 PST 2020


avl added a comment.

> That's not possible - the .dwo files are produced during compilation time, before the linker has done any garbage collection.



> (currently even when building the dwp file from dwo files it's not possible to strip the dead debug info - since there's no feedback from the linker that reaches the dwp tool (dwp and linking might be done in parallel on different machines, for instance) - but it'd be possible to implement something more like dsymutil where the linker generates a side-file address mapping/details of the garbage collection and then that is fed into the dwp tool (this would delay running the dwp tool though))

Right. That is not possible in current scheme. Though we could probably change the scheme(if it would be considered beneficial). One alternative is what you were talking about - dsymutil/dwp tool which would take linker report and .dwo files and produce optimized .dwo files. Another alternative is that .dwo files could be optimized during linking time using the same scheme like current proposal. This proposal would take unoptimized .debug* sections of binary and generate optimized contents of destination .debug* sections during linking. Generally, It is possible to take unoptimized .dwo files and make them optimized.

I do not suggest to do it now. That is just possible alternative which could probably be considered if current proposal would show good results.

Another thing, is that this patch could be useful for -gsplit-dwarf even without optimizing .dwo files.
It could skip DW_TAG_skeleton_unit related to deleted code. So that Skeleton file do not have overlapped address ranges like this :

  0x00000014: DW_TAG_skeleton_unit
                DW_AT_dwo_name    ("split1.dwo")
                DW_AT_low_pc      (0x0000000000000000)   <<< not assigned because of deleted code
                DW_AT_high_pc     (0x0000000000000008)
                DW_AT_addr_base   (0x00000008)
  
  0x00000034: DW_TAG_skeleton_unit
                DW_AT_dwo_name    ("split2.dwo")
                DW_AT_low_pc      (0x0000000000000000)   <<< not assigned because of deleted code
                DW_AT_high_pc     (0x0000000000000008)
                DW_AT_addr_base   (0x00000008)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74169/new/

https://reviews.llvm.org/D74169





More information about the llvm-commits mailing list