[llvm-objcopy] Add --strip-all-gnu and change --strip-all
authorJake Ehrlich <jakehehrlich@google.com>
Mon, 27 Nov 2017 18:56:01 +0000 (18:56 +0000)
committerJake Ehrlich <jakehehrlich@google.com>
Mon, 27 Nov 2017 18:56:01 +0000 (18:56 +0000)
commit6ad72d05f5ebaada700487d3d0fe1d107b32468a
tree53ba408ecc84581a656a305742eebfdf9b1bb44e
parent96c6985b5327845be772c2bc13567c2967969cc7
[llvm-objcopy] Add --strip-all-gnu and change --strip-all

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.

llvm-svn: 319071
llvm/test/tools/llvm-objcopy/strip-all-gnu.test [new file with mode: 0644]
llvm/test/tools/llvm-objcopy/strip-all.test
llvm/tools/llvm-objcopy/llvm-objcopy.cpp