From owner-svn-src-all@freebsd.org Mon Jul 29 22:07:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7231DB7BD4; Mon, 29 Jul 2019 22:07:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 532306FF59; Mon, 29 Jul 2019 22:07:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42DEC7249; Mon, 29 Jul 2019 22:07:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6TM7iZN050077; Mon, 29 Jul 2019 22:07:44 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6TM7hUk050075; Mon, 29 Jul 2019 22:07:43 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907292207.x6TM7hUk050075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 29 Jul 2019 22:07:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350432 - head/contrib/elftoolchain/elfcopy X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/contrib/elftoolchain/elfcopy X-SVN-Commit-Revision: 350432 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 532306FF59 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2019 22:07:44 -0000 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