The Compact C Type Format in the GNU toolchain
The Compact C Type Format in the GNU toolchain
Posted Aug 6, 2019 21:24 UTC (Tue) by nix (subscriber, #2304)In reply to: The Compact C Type Format in the GNU toolchain by wahern
Parent article: The Compact C Type Format in the GNU toolchain
If CTF annotations are built into Debian and RPM binary packages by defaultThey are explicitly not marked as debugging sections in the linker and are even kept in when --strip-unneeded for that exact reason :) if CTF is stripped out, it's useless. You might as well use DWARF in that case.
btw, in re the sizes above: the 1.6GiB -> 7MiB figure is for the old non-ld-toolchain deduplicator: the deduplicator in the linker patches above doesn't really deserve the name because it does no cross-TU deduplication whatsoever. A quick check with the GNU ld patches I have in preparation now (still with no deduplicator) shows GNU ld itself clocking in at:
section size addr .interp 28 4195040 .note.gnu.build-id 36 4195068 .note.ABI-tag 32 4195104 .gnu.hash 224 4195136 .dynsym 6384 4195360 .dynstr 3914 4201744 .gnu.version 532 4205658 .gnu.version_r 112 4206192 .rela.dyn 408 4206304 .rela.plt 5784 4206712 .init 26 4214784 .plt 3872 4214816 .plt.got 8 4218688 .text 289042 4218704 .fini 9 4507748 .rodata 1229488 4509696 .eh_frame_hdr 6804 5739184 .eh_frame 43248 5745992 .tbss 8 5794512 .init_array 8 5794512 .fini_array 8 5794520 .data.rel.ro 768 5794528 .dynamic 496 5795296 .got 32 5795792 .got.plt 1952 5795840 .data 4604 5797792 .bss 6416 5802400 .comment 91 0 .debug_aranges 2320 0 .debug_info 1732570 0 .debug_abbrev 57088 0 .debug_line 241926 0 .debug_str 138861 0 .debug_loc 563108 0 .debug_ranges 50320 0 .ctf 180737 5817008 Total 4571264
So with a dreadful deduplicator that I have spent literally no effort on at all, the CTF is a bit smaller than the .text, and perhaps 10% the size of the DWARF. It will only go down as the deduplicator is written, as the file format improves and as better compressors are added (lzma support seems likely, since binutils can already use it for .gnu_debugdata). If CTF ends up adding more than 1% to the size of executables once all this is done I will be quite surprised. Throwing the old kernel-type-focused deduplicator at this file produces CTF 58207 bytes long, already a radical reduction. I expect the ld deduplicator, once I write it, to do a better job.