From 78f85fd7987835445807c27a617989df01341871 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 20 Feb 2001 21:07:24 +0000 Subject: [PATCH] 2001-02-20 H.J. Lu * ldfile.c (ldfile_open_file): Set entry->search_dirs_flag to false if we found the file. --- ld/ChangeLog | 5 +++++ ld/ldfile.c | 23 ++++++++++++++++------- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index 2fe147aa405..70c20da4c5a 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2001-02-20 H.J. Lu + + * ldfile.c (ldfile_open_file): Set entry->search_dirs_flag to + false if we found the file. + 001-02-18 David O'Brien * configure.tgt: Add FreeBSD/Alpha, FreeBSD/x86-64, FreeBSD/ia64, diff --git a/ld/ldfile.c b/ld/ldfile.c index fbb46851de3..1456e3d10a2 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 or lib.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); } } -- 2.30.2