This is an archive of the discontinued LLVM Phabricator instance.

[llvm-objcopy] Add --strip-debug
ClosedPublic

Authored by jakehehrlich on Nov 10 2017, 1:01 PM.

Details

Summary

Many projects use this option. There are two ways to use it. You can either a) Just use --strip-debug and keep the old file with debug content or b) you can use --strip-debug, --only-keep-debug, and --add-gnu-debuglink all in conjunction to create two separate files, the stripped file and the debug file. --only-keep-debug is more complicated than --strip-debug because it keeps the section headers without keeping section contents. That's not really supported by llvm-objcopy at the moment but I plan on adding it. So this change just supports a) and options to support b) will come soon.

Diff Detail

Repository
rL LLVM

Event Timeline

jakehehrlich created this revision.Nov 10 2017, 1:01 PM
jhenderson accepted this revision.Nov 13 2017, 3:17 AM

LGTM, with one minor nit.

I noticed that we are being inconsistent with the capitalization of the help text for the different options. At some point, could you make a change to capitalize the first character of help text for options that aren't already in this state, to make it consistent with other LLVM tools, please.

tools/llvm-objcopy/llvm-objcopy.cpp
85 ↗(On Diff #122506)

Removes -> Remove (for consistency with other options).

This revision is now accepted and ready to land.Nov 13 2017, 3:17 AM
This revision was automatically updated to reflect the committed changes.