aboutsummaryrefslogtreecommitdiff
path: root/ld/ldfile.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2010-01-21 10:31:32 +0000
committerNick Clifton <nickc@redhat.com>2010-01-21 10:31:32 +0000
commitc4b7819565e41809d80f66febb0c89a6204e1ad8 (patch)
tree69c56b63429d8e387352f44b34a58337caa58b38 /ld/ldfile.c
parent95433b348df0563b42a4b4287d569fcd92e4ff24 (diff)
downloadgdb-c4b7819565e41809d80f66febb0c89a6204e1ad8.zip
gdb-c4b7819565e41809d80f66febb0c89a6204e1ad8.tar.gz
gdb-c4b7819565e41809d80f66febb0c89a6204e1ad8.tar.bz2
PR 4437
* ldfile.c: (ldfile_open_file): Do not stop link upon encountering a missing file or library. Instead mark the entry as missing and set the global flag to indicate that missing files were encountered. * ldlang.c (missing_files): New exported variable. (load_symbols): Skip loading if the file is missing. (open_input_bfds): Terminate link if any input files were missing. * ldlang.h (struct lang_input_statement_struct): Add missing_file field. Add export of missing_file variable.
Diffstat (limited to 'ld/ldfile.c')
-rw-r--r--ld/ldfile.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/ld/ldfile.c b/ld/ldfile.c
index a6844c1..4661897 100644
--- a/ld/ldfile.c
+++ b/ld/ldfile.c
@@ -1,6 +1,6 @@
/* Linker file opening and searching.
Copyright 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
+ 2003, 2004, 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of the GNU Binutils.
@@ -363,7 +363,10 @@ ldfile_open_file_search (const char *arch,
return FALSE;
}
-/* Open the input file specified by ENTRY. */
+/* Open the input file specified by ENTRY.
+ PR 4437: Do not stop on the first missing file, but
+ continue processing other input files in case there
+ are more errors to report. */
void
ldfile_open_file (lang_input_statement_type *entry)
@@ -375,11 +378,15 @@ ldfile_open_file (lang_input_statement_type *entry)
{
if (ldfile_try_open_bfd (entry->filename, entry))
return;
+
if (strcmp (entry->filename, entry->local_sym_name) != 0)
- einfo (_("%F%P: %s (%s): No such file: %E\n"),
+ einfo (_("%P: cannot find %s (%s): %E\n"),
entry->filename, entry->local_sym_name);
else
- einfo (_("%F%P: %s: No such file: %E\n"), entry->local_sym_name);
+ einfo (_("%P: cannot find %s: %E\n"), entry->local_sym_name);
+
+ entry->missing_file = TRUE;
+ missing_file = TRUE;
}
else
{
@@ -406,13 +413,18 @@ ldfile_open_file (lang_input_statement_type *entry)
again. */
if (found)
entry->search_dirs_flag = FALSE;
- else if (entry->sysrooted
+ else
+ {
+ if (entry->sysrooted
&& ld_sysroot
&& IS_ABSOLUTE_PATH (entry->local_sym_name))
- einfo (_("%F%P: cannot find %s inside %s\n"),
- entry->local_sym_name, ld_sysroot);
- else
- einfo (_("%F%P: cannot find %s\n"), entry->local_sym_name);
+ einfo (_("%P: cannot find %s inside %s\n"),
+ entry->local_sym_name, ld_sysroot);
+ else
+ einfo (_("%P: cannot find %s\n"), entry->local_sym_name);
+ entry->missing_file = TRUE;
+ missing_file = TRUE;
+ }
}
}