[PATCH] D46628: [ELF] Add --strip-debug-non-line option

Lucian Adrian Grijincu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 24 05:17:01 PDT 2019


luciang updated this revision to Diff 206198.
luciang marked 30 inline comments as done.
luciang added a comment.

> So the benefit is a smaller output size.

Yes. That's what we're currently using gold + strip-debug-non-line for: to reduce binary sizes in a context where a very large number of very large binaries are produced and executed.

We've also considered the items you brought up (building and deploying a separate tool to strip out the debug info after creation, create .o with minimal set of debug info), but went with this approach for:

- lld feature parity with gold
  - based on initial response to earlier version of the diff it seemed desirable
  - the flag is useful on its own

- producting large binaries, reading and re-writing with reduced size is a waste of IO / time

- the patch seemed reasonable in size and intrusiveness -- I intentionally kept the implementation in a single function and avoided adding new types or passing maps or structs between phases and leveraged as much as llvm libraries as I could.

- input .o come from a shared cache and have rich debug info and we're not using split-dwarf


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D46628/new/

https://reviews.llvm.org/D46628

Files:
  lld/ELF/Config.h
  lld/ELF/Driver.cpp
  lld/ELF/Options.td
  lld/ELF/OutputSections.cpp
  lld/ELF/OutputSections.h
  lld/ELF/Writer.cpp
  lld/test/ELF/Inputs/strip-debug-non-line-multi-cu-bar.s
  lld/test/ELF/strip-debug-non-line-dwarf5.s
  lld/test/ELF/strip-debug-non-line-multi-cu.s
  lld/test/ELF/strip-debug-non-line.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46628.206198.patch
Type: text/x-patch
Size: 37908 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190624/37f07f82/attachment.bin>


More information about the llvm-commits mailing list