In the file lld/ELF/Driver.cpp in function getCompressDebugSections we can see that the current default for lld is no debug section compression. It looks like tools like gdb, valgrind, elfutils, gcc's backtrace lib currently support compressed symbols. Since perf can use libdw from elfutils, I guess it supports it too.
Do you think it's time to enable compressed debug section by default ? On some of my big binaries (several hundreds of MB) this could save 50% of the overall binary size.
Cheers,
Romain
_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Le 7 mai 2019 à 09:03, Rui Ueyama <ru...@google.com> a écrit :
We can compress debug sections in compiler-generated object files as well as linker-generated executables. So the question whether we should compress debug sections is not only relevant to lld but to clang, and I think it's actually a whole toolchain-level decision.
I think I'm mildly in favor of making such change -- I guess the cost of compress doesn't too high, and that might even make things faster by reducing the amount of IO. I'd guess people wouldn't even care whether debug sections are compressed or not, as their tools already support it. But I don't have an evidence that the latter is actually the case.
It depends whether you use index (Apple index or .gdb_index or .debug_names).
If not then compressed debug is probably always a win.
.gdb_index is not going to be supported by LLDB (it is supported by GDB),
.debug_names (at LLD level) is going to be supported by LLDB in some time.
If you do use index then loading such file will be slower as this type of
compression cannot decompress only small section of the file addressed by the
index. Then some filesystem level (or block device level) compressed can be
a better compromise between disk size and debug info access performance.
But it sure needs more numbers.
Jan