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

George Rimar via llvm-dev llvm-dev at lists.llvm.org
Thu Dec 7 06:56:04 PST 2017


>>*nod* That's been the historic ELF+DWARF approach, but both MacOS (with dsyms+DWARF) and Windows

>>(COFF+CodeView+PDB) don't do it that way, and instead involve the linker to a degree.
>>Mostly I'm wondering if it'd be reasonable to (and if anyone would be interested in doing it) do
>>something more like the PDB support - fully debug-aware linking.
>
>Honestly saying I only know how ELF linker works and may be my thoughts below are silly for some reason or duplicating
>some already existent approach. Looking at what .dwp do, looks there are two main things reducing size debug data:
>1) "It must allow for the removal of duplicate type units".
>2) "It must allow for the removal of duplicate strings".
>
>Linker already deduplicates strings by itself, though it can delegate it to some API for debug sections.
>And what it could probably do is call some library API. Linker could give it a some set (or all of)
>.debug_* sections so this library would rebuild and optimize the dwarf data, eliminate duplicates, and
>return optimized debug sections back to linker. Then linker would perform relocations and emit the result to output.
>

Though probably resolving relocations can be a problem here. May be linker could pass already relocated sections for
final optimization/deduplication and some additional information probably, but anyways I see it can be not that simple now :)

George.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171207/5433af89/attachment.html>


More information about the llvm-dev mailing list