This is an archive of the discontinued LLVM Phabricator instance.

[llvm-objcopy] Add --strip-all-gnu and change --strip-all
ClosedPublic

Authored by jakehehrlich on Nov 17 2017, 3:29 PM.

Details

Summary

GNU's --strip-all doesn't strip as aggressively as it could in general. Currently llvm-objcopy copies the exact behavoir of GNU's --strip-all. eu-strip is used as a drop in replacement for GNU strip/objcopy in many many places without issue. eu-strip removes non-allocated sections and keeps .gnu.warning* sections. Because --strip-all will likely be the most widely used stripping option we should make --strip-all as aggressive as it can safely be. Since we have evidence from eu-strip that this is a safe option we should allow it. For those that might still have an issue afterwards I've added --strip-all-gnu as an exact drop in replacement for GNU's --strip-all as well.

Diff Detail

Repository
rL LLVM

Event Timeline

jakehehrlich created this revision.Nov 17 2017, 3:29 PM
mcgrathr accepted this revision.Nov 17 2017, 3:58 PM

LGTM. I wonder if it's really worth keeping --strip-non-alloc.

This revision is now accepted and ready to land.Nov 17 2017, 3:58 PM
jakehehrlich closed this revision.Nov 27 2017, 2:08 PM