Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Jul 2019 22:07:43 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r350432 - head/contrib/elftoolchain/elfcopy
Message-ID:  <201907292207.x6TM7hUk050075@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Mon Jul 29 22:07:43 2019
New Revision: 350432
URL: https://svnweb.freebsd.org/changeset/base/350432

Log:
  Merge r3778 and r3779 from ELFToolchain.
  
  Modify strip(1) to not accept multiple input files when an output
  file is specified.  There is no good way to handle this combination,
  and the change is compatible with binutils.
  
  MFC after:	1 week
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/contrib/elftoolchain/elfcopy/main.c
  head/contrib/elftoolchain/elfcopy/strip.1

Modified: head/contrib/elftoolchain/elfcopy/main.c
==============================================================================
--- head/contrib/elftoolchain/elfcopy/main.c	Mon Jul 29 22:01:28 2019	(r350431)
+++ head/contrib/elftoolchain/elfcopy/main.c	Mon Jul 29 22:07:43 2019	(r350432)
@@ -1187,6 +1187,12 @@ strip_main(struct elfcopy *ecp, int argc, char **argv)
 		ecp->strip = STRIP_ALL;
 	if (optind == argc)
 		strip_usage();
+	/*
+	 * Only accept a single input file if an output file had been
+	 * specified.
+	 */
+	if (outfile != NULL && argc != (optind + 1))
+		strip_usage();
 
 	for (i = optind; i < argc; i++)
 		create_file(ecp, argv[i], outfile);

Modified: head/contrib/elftoolchain/elfcopy/strip.1
==============================================================================
--- head/contrib/elftoolchain/elfcopy/strip.1	Mon Jul 29 22:01:28 2019	(r350431)
+++ head/contrib/elftoolchain/elfcopy/strip.1	Mon Jul 29 22:07:43 2019	(r350432)
@@ -23,7 +23,7 @@
 .\"
 .\" $Id: strip.1 3642 2018-10-14 14:24:28Z jkoshy $
 .\"
-.Dd September 17, 2011
+.Dd July 27, 2019
 .Dt STRIP 1
 .Os
 .Sh NAME
@@ -51,8 +51,16 @@
 .Sh DESCRIPTION
 The
 .Nm
-utility is used to discard information from ELF objects.
+utility is used to discard information from the ELF objects
+specified by the arguments
+.Ar .
 .Pp
+If an explicit output file name is not specified using the
+.Fl o
+option, the
+.Nm
+utility will modify its input arguments in-place.
+.Pp
 The
 .Nm
 utility supports the following options:
@@ -65,8 +73,9 @@ Print a help message and exit.
 Remove all content except that which would be used for debugging.
 .It Fl o Ar outputfile | Fl -output-file= Ns Ar outputfile
 Write the stripped object to file
-.Ar outputfile .
-The default behaviour is to modify objects in place.
+.Ar outputfile
+instead of modifying the input in-place.
+Only a single input object should be specified if this option is used.
 .It Fl p | Fl -preserve-dates
 Preserve the object's access and modification times.
 .It Fl s | Fl -strip-all



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201907292207.x6TM7hUk050075>