diff options
author | H.J. Lu <hjl@lucon.org> | 2001-02-20 21:07:24 +0000 |
---|---|---|
committer | H.J. Lu <hjl@lucon.org> | 2001-02-20 21:07:24 +0000 |
commit | f02f4e01a0def1dc58cac0e404c7b34c56690f10 (patch) | |
tree | 44450609b63a76a2c0233b17769d3e97c46d275c /ld/ldfile.c | |
parent | cd101f0fe8c3b2c8da108198e880b4cadbe902b2 (diff) | |
download | binutils-redhat-f02f4e01a0def1dc58cac0e404c7b34c56690f10.tar.gz |
2001-02-20 H.J. Lu <hjl@gnu.org>
* ldfile.c (ldfile_open_file): Set entry->search_dirs_flag to
false if we found the file.
Diffstat (limited to 'ld/ldfile.c')
-rw-r--r-- | ld/ldfile.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/ld/ldfile.c b/ld/ldfile.c index fbb46851de..1456e3d10a 100644 --- a/ld/ldfile.c +++ b/ld/ldfile.c @@ -231,23 +231,32 @@ ldfile_open_file (entry) else { search_arch_type *arch; + boolean found = false; /* Try to open <filename><suffix> or lib<filename><suffix>.a */ for (arch = search_arch_head; arch != (search_arch_type *) NULL; arch = arch->next) { - if (ldfile_open_file_search (arch->name, entry, "lib", ".a")) - return; + found = ldfile_open_file_search (arch->name, entry, "lib", ".a"); + if (found) + break; #ifdef VMS - if (ldfile_open_file_search (arch->name, entry, ":lib", ".a")) - return; + found = ldfile_open_file_search (arch->name, entry, ":lib", ".a"); + if (found) + break; #endif - if (ldemul_find_potential_libraries (arch->name, entry)) - return; + found = ldemul_find_potential_libraries (arch->name, entry); + if (found) + break; } - einfo (_("%F%P: cannot find %s\n"), entry->local_sym_name); + /* If we have found the file, we don't need to search directories + again. */ + if (found) + entry->search_dirs_flag = false; + else + einfo (_("%F%P: cannot find %s\n"), entry->local_sym_name); } } |