Bug 1052 - [PATCH] Remove temp file if input file is unrecognized
Summary: [PATCH] Remove temp file if input file is unrecognized
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.15
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-06 13:01 UTC by Ignacio Vazquez-Abrams
Modified: 2005-08-23 07:57 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ignacio Vazquez-Abrams 2005-07-06 13:01:27 UTC
This patch causes strip to remove the temporary file created if it doesn't
recognize the format of the input file.

--- binutils-2.15.94.0.2.2/binutils/objcopy.c.tempkill  2005-07-06
07:27:16.000000000 -0400
+++ binutils-2.15.94.0.2.2/binutils/objcopy.c   2005-07-06 07:31:26.000000000 -0400
@@ -1167,8 +1167,11 @@
          || bfd_get_arch (ibfd) != bfd_get_arch (obfd)))
     {
       if (bfd_get_arch (ibfd) == bfd_arch_unknown)
+      {
+       unlink(bfd_get_filename (obfd));
        fatal (_("Unable to recognise the format of the input file %s"),
               bfd_get_filename (ibfd));
+      }
       else
        {
          non_fatal (_("Warning: Output file cannot represent architecture %s"),
Comment 1 Alan Modra 2005-08-23 07:57:10 UTC
This has been fixed on mainline.