From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1062) id 320953858C2B; Wed, 4 Jan 2023 13:32:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 320953858C2B Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Alan Modra To: bfd-cvs@sourceware.org Subject: [binutils-gdb] fuzzed file timeout X-Act-Checkin: binutils-gdb X-Git-Author: Alan Modra X-Git-Refname: refs/heads/master X-Git-Oldrev: c093f5eeabf152730bdf9ca32cbc8e045933369c X-Git-Newrev: 3bba9d93294a8172018731477df72c1c3ef42136 Message-Id: <20230104133213.320953858C2B@sourceware.org> Date: Wed, 4 Jan 2023 13:32:13 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2023 13:32:13 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D3bba9d93294a= 8172018731477df72c1c3ef42136 commit 3bba9d93294a8172018731477df72c1c3ef42136 Author: Alan Modra Date: Wed Jan 4 21:46:06 2023 +1030 fuzzed file timeout =20 objcopy of archive, element containing an object with a fuzzed section size far exceeding the element size. copy_section detects this, but the temp file is laid out for the large section. It can take a long time to write terabytes of sparse file, a waste of time when it will be deleted. =20 * objcopy.c (copy_archive): Don't write element contents after bad status result from copy_object. Diff: --- binutils/objcopy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/binutils/objcopy.c b/binutils/objcopy.c index a6182b48b6c..4d888906e67 100644 --- a/binutils/objcopy.c +++ b/binutils/objcopy.c @@ -3686,7 +3686,8 @@ copy_archive (bfd *ibfd, bfd *obfd, const char *outpu= t_target, if (!ok_object) del =3D !copy_unknown_object (this_element, output_bfd); =20 - if (!(ok_object && !del ? bfd_close : bfd_close_all_done) (output_bf= d)) + if (!(ok_object && !del && !status + ? bfd_close : bfd_close_all_done) (output_bfd)) { bfd_nonfatal_message (output_name, NULL, NULL, NULL); /* Error in new object file. Don't change archive. */