From cc496eefa50fd570602bb5f2ff314799be68fd5c Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Sat, 29 Dec 2007 20:10:03 +0000 Subject: * collect2.c (scan_prog_file): Read all the output when reading information for LTO. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/lto@131222 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog.lto | 5 +++++ gcc/collect2.c | 18 ++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/gcc/ChangeLog.lto b/gcc/ChangeLog.lto index a823eef20ac..e60ad1f3213 100644 --- a/gcc/ChangeLog.lto +++ b/gcc/ChangeLog.lto @@ -1,3 +1,8 @@ +2007-12-29 Nathan Froyd + + * collect2.c (scan_prog_file): Read all the output when reading + information for LTO. + 2007-12-24 Nathan Froyd * lto-function-out.c (output_local_vars): Output DECL_INITIAL diff --git a/gcc/collect2.c b/gcc/collect2.c index a3df4db87a4..72f54ddcd7e 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -2365,6 +2365,7 @@ scan_prog_file (const char *prog_name, enum pass which_pass) int err; char *p, buf[1024]; FILE *inf; + int found_lto = 0; if (which_pass == PASS_SECOND) return; @@ -2440,6 +2441,9 @@ scan_prog_file (const char *prog_name, enum pass which_pass) if (which_pass == PASS_LTOINFO) { + if (found_lto) + continue; + /* Look for the LTO info marker symbol, and add filename to the LTO objects list if found. */ for (p = buf; (ch = *p) != '\0' && ch != '\n'; p++) @@ -2449,17 +2453,11 @@ scan_prog_file (const char *prog_name, enum pass which_pass) { add_lto_object (<o_objects, prog_name); - /* No need to look any further. Clean up and return. */ - if (debug) - fprintf (stderr, "\n"); - - do_wait (nm_file_name, pex); + /* We need to read all the input, so we can't just + return here. But we can avoid useless work. */ + found_lto = 1; - signal (SIGINT, int_handler); -#ifdef SIGQUIT - signal (SIGQUIT, quit_handler); -#endif - return; + break; } } else -- cgit v1.2.3