OSDN Git Service

Delete temporary output files.
[pf3gnuchains/gcc-fork.git] / lto-plugin / lto-plugin.c
index 2fb4f2a..97b7c0f 100644 (file)
@@ -524,6 +524,7 @@ all_symbols_read_handler (void)
 static enum ld_plugin_status
 cleanup_handler (void)
 {
+  unsigned int i;
   int t;
 
   if (debug)
@@ -541,6 +542,12 @@ cleanup_handler (void)
       check (t == 0, LDPL_FATAL, "could not unlink resolution file");
     }
 
+  for (i = 0; i < num_output_files; i++)
+    {
+      t = unlink (output_files[i]);
+      check (t == 0, LDPL_FATAL, "could not unlink output file");
+    }
+
   free_2 ();
   return LDPS_OK;
 }