[llvm-dev] [RFC] - Deduplication of debug information in linkers (LLD).

George Rimar via llvm-dev llvm-dev at lists.llvm.org
Wed Dec 6 03:15:39 PST 2017


>If you're interested in things you can do in the linker for this - you might consider something more aggressive: Fully DWARF aware deduplication.

>
>This could be done hopefully by reusing some of the code in the dsymutil implementation in LLVM.
>
>This would be much more effective (and without the possible context-sensitive tradeoffs) than using type units.
>Though it'd possibly have a big tradeoff in link time and/or linker memory usage (I'm not sure how much dsymutil needs/uses of either).

+ Rui.

I think LLD development direction vector currently is to avoid teaching linker about things it naturally should not be aware off.
Like it should ideally work with sections as pieces and should not know about content. That is not always possible,
for example we have to look inside .eh_frame to deuplicate FDEs, but that is probably what we would want to avoid in general.

>It doesn't seem especially important to implement the DWARF5 types -> debug_info thing for this situation, the type units
>as they are (in debug_types) offer the same size benefits here. But sure, if anyone wanted to implement it at some point, that'd be fine.

But there is no .debug_types in DWARF5, so it is depricated approach as far I understand.

>I think Paul covered some of the reasons type units might not be a reasonable default.
>
>One additional reason is that if you use Split DWARF (another great way to massively reduce the amount of debug info going to the linker)
>type units are mostly /just/ overhead in the .dwo files: since the debug info is not linked, there's no opportunity to remove the
>duplication anyway (unless you're making a DWP - like a >dsym file)

Yeah. Looks -gsplit-dwarf? and -fdebug-types-section are harmfull together. Probably it worth to restrict using of them together or
emit a warning (both clang and gcc silently allows the combination and output has size penalty you describing).

But then does it make sence to emit multiple .debug_info sections with -gsplit-dwarf, so that objects will contain skeleton .debug_info and
.debug_info sections with type units as described in DWARF5. So that linker will be able to do deduplication of
types on a sections level as expected ?

George.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171206/1acea48a/attachment.html>


More information about the llvm-dev mailing list