aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2019-04-10 10:37:10 +0000
committerRui Ueyama <ruiu@google.com>2019-04-10 10:37:10 +0000
commit3a8bb7cd2c75cc1bb83411c380b41e39003823de (patch)
treef9e8620e9d996b11ae1a3697229b5576714a0d64 /llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
parent56f70c625abef5c35dc3609c6524782d0445d7dd (diff)
downloadllvm-3a8bb7cd2c75cc1bb83411c380b41e39003823de.zip
llvm-3a8bb7cd2c75cc1bb83411c380b41e39003823de.tar.gz
llvm-3a8bb7cd2c75cc1bb83411c380b41e39003823de.tar.bz2
Discard debuginfo for object files empty after GC
Patch by Robert O'Callahan. Rust projects tend to link in all object files from all dependent libraries and rely on --gc-sections to strip unused code and data. Unfortunately --gc-sections doesn't currently strip any debuginfo associated with GC'ed sections, so lld links in the full debuginfo from all dependencies even if almost all that code has been discarded. See https://github.com/rust-lang/rust/issues/56068 for some details. Properly stripping debuginfo for discarded sections would be difficult, but a simple approach that helps significantly is to mark debuginfo sections as live only if their associated object file has at least one live code/data section. This patch does that. In a (contrived but not totally artificial) Rust testcase linked above, it reduces the final binary size from 46MB to 5.1MB. Differential Revision: https://reviews.llvm.org/D54747 llvm-svn: 358069
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp')
0 files changed, 0 insertions, 0 deletions