]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gcc.c (do_spec_1): [case 'o'] Account for lang_specific_extra_outfiles.
authorTom Tromey <tromey@cygnus.com>
Fri, 4 Sep 1998 12:58:40 +0000 (12:58 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Fri, 4 Sep 1998 12:58:40 +0000 (12:58 +0000)
        * gcc.c (do_spec_1): [case 'o'] Account for
        lang_specific_extra_outfiles.
        (main): Correctly clear all slots in outfiles for
        lang_specific_extra_outfiles.  Set input_file_number before
        calling lang_specific_pre_link.

From-SVN: r22234

gcc/ChangeLog
gcc/gcc.c

index 1b93cfdea3ba5257097ddcfd450aeca1e9530ba3..3e8dedb7d71fbb2f60b3db33fdd33ad13562cdd0 100644 (file)
@@ -1,3 +1,11 @@
+Fri Sep  4 11:57:50 1998  Tom Tromey  <tromey@cygnus.com>
+
+       * gcc.c (do_spec_1): [case 'o'] Account for
+       lang_specific_extra_outfiles.
+       (main): Correctly clear all slots in outfiles for
+       lang_specific_extra_outfiles.  Set input_file_number before
+       calling lang_specific_pre_link.
+
 Fri Sep  4 10:37:07 1998  Jim Wilson  <wilson@cygnus.com>
 
        * loop.c (load_mems): Fix JUMP_LABEL field after for_each_rtx call.
index 28b6206cb27301e12775574aa10fcd48f5a9e028..f832ae21f03e82646dd238fea71f0a56e7ce1705 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -3732,9 +3732,16 @@ do_spec_1 (spec, inswitch, soft_matched_part)
            break;
 
          case 'o':
-           for (i = 0; i < n_infiles; i++)
-             store_arg (outfiles[i], 0, 0);
-           break;
+           {
+             int max = n_infiles;
+#ifdef LANG_SPECIFIC_DRIVER
+             max += lang_specific_extra_outfiles;
+#endif
+             for (i = 0; i < max; i++)
+               if (outfiles[i])
+                 store_arg (outfiles[i], 0, 0);
+             break;
+           }
 
          case 'O':
            obstack_grow (&obstack, OBJECT_SUFFIX, strlen (OBJECT_SUFFIX));
@@ -4984,7 +4991,7 @@ main (argc, argv)
   i += lang_specific_extra_outfiles;
 #endif
   outfiles = (char **) xmalloc (i * sizeof (char *));
-  bzero ((char *) outfiles, n_infiles * sizeof (char *));
+  bzero ((char *) outfiles, i * sizeof (char *));
 
   /* Record which files were specified explicitly as link input.  */
 
@@ -5080,9 +5087,14 @@ main (argc, argv)
     }
 
 #ifdef LANG_SPECIFIC_DRIVER
-  if (error_count == 0
-      && lang_specific_pre_link ())
-    error_count++;
+  if (error_count == 0)
+    {
+      /* Make sure INPUT_FILE_NUMBER points to first available open
+        slot.  */
+      input_file_number = n_infiles;
+      if (lang_specific_pre_link ())
+       error_count++;
+    }
 #endif
 
   /* Run ld to link all the compiler output files.  */