diff options
author | Alan Modra <amodra@gmail.com> | 2023-01-04 21:46:06 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2023-01-04 23:52:26 +1030 |
commit | 3bba9d93294a8172018731477df72c1c3ef42136 (patch) | |
tree | 2538e0cdff74697d92febec15236c2991b97a54e /binutils/objcopy.c | |
parent | c093f5eeabf152730bdf9ca32cbc8e045933369c (diff) | |
download | binutils-3bba9d93294a8172018731477df72c1c3ef42136.zip binutils-3bba9d93294a8172018731477df72c1c3ef42136.tar.gz binutils-3bba9d93294a8172018731477df72c1c3ef42136.tar.bz2 |
fuzzed file timeout
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.
* objcopy.c (copy_archive): Don't write element contents after
bad status result from copy_object.
Diffstat (limited to 'binutils/objcopy.c')
-rw-r--r-- | binutils/objcopy.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/binutils/objcopy.c b/binutils/objcopy.c index a6182b4..4d88890 100644 --- a/binutils/objcopy.c +++ b/binutils/objcopy.c @@ -3686,7 +3686,8 @@ copy_archive (bfd *ibfd, bfd *obfd, const char *output_target, if (!ok_object) del = !copy_unknown_object (this_element, output_bfd); - if (!(ok_object && !del ? bfd_close : bfd_close_all_done) (output_bfd)) + 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. */ |