From 2b19138144b7f6fb00613e66455e9a9fbf649c4e Mon Sep 17 00:00:00 2001 From: tromey Date: Fri, 4 Sep 1998 12:58:40 +0000 Subject: [PATCH] * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@22234 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 8 ++++++++ gcc/gcc.c | 26 +++++++++++++++++++------- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1b93cfdea3b..3e8dedb7d71 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +Fri Sep 4 11:57:50 1998 Tom Tromey + + * 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 * loop.c (load_mems): Fix JUMP_LABEL field after for_each_rtx call. diff --git a/gcc/gcc.c b/gcc/gcc.c index 28b6206cb27..f832ae21f03 100644 --- 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. */ -- 2.11.4.GIT