It doesn't make sense to strip multiple files into a single output file.
Moreover, this is compatible with GNU strip.
---
contrib/elftoolchain/elfcopy/main.c | 2 +-
contrib/elftoolchain/elfcopy/strip.1 | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/contrib/elftoolchain/elfcopy/main.c
b/contrib/elftoolchain/elfcopy/main.c
index 9794a723c364..777cf30f3adc 100644
--- a/contrib/elftoolchain/elfcopy/main.c
+++ b/contrib/elftoolchain/elfcopy/main.c
@@ -1168,7 +1168,7 @@ strip_main(struct elfcopy *ecp, int argc, char **argv)
((ecp->flags & DISCARD_LLABEL) == 0) &&
lookup_symop_list(ecp, NULL, SYMOP_STRIP) == NULL)
ecp->strip = STRIP_ALL;
- if (argc == 0)
+ if (argc == 0 || (outfile != NULL && argc > 1))
strip_usage();
for (i = 0; i < argc; i++)
diff --git a/contrib/elftoolchain/elfcopy/strip.1
b/contrib/elftoolchain/elfcopy/strip.1
index b1633a51693b..7f11896b186f 100644
--- a/contrib/elftoolchain/elfcopy/strip.1
+++ b/contrib/elftoolchain/elfcopy/strip.1
@@ -23,7 +23,7 @@
.\"
.\" $Id: strip.1 3642 2018-10-14 14:24:28Z jkoshy $
.\"
-.Dd September 17, 2011
+.Dd July 26, 2019
.Dt STRIP 1
.Os
.Sh NAME
@@ -67,6 +67,7 @@ Remove all content except that which would be used for
debugging.
Write the stripped object to file
.Ar outputfile .
The default behaviour is to modify objects in place.
+When this argument is used, only one input file may be specified.
.It Fl p | Fl -preserve-dates
Preserve the object's access and modification times.
.It Fl s | Fl -strip-all
--
2.22.0
_______________________________________________
Elftoolchain-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/elftoolchain-developers