2001-02-20 H.J. Lu <hjl@gnu.org>
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 20 Feb 2001 21:07:24 +0000 (21:07 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 20 Feb 2001 21:07:24 +0000 (21:07 +0000)
* ldfile.c (ldfile_open_file): Set entry->search_dirs_flag to
false if we found the file.

ld/ChangeLog
ld/ldfile.c

index 2fe147aa4053fc313c0a14b88ee38db06a048992..70c20da4c5a7edc0080e7f084bcc3c2dcf66bc8f 100644 (file)
@@ -1,3 +1,8 @@
+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.
+
 001-02-18  David O'Brien  <obrien@FreeBSD.org>
 
        * configure.tgt: Add FreeBSD/Alpha, FreeBSD/x86-64, FreeBSD/ia64,
index fbb46851de3c258c8faa59166a3ed58a60b36998..1456e3d10a2e3ea4bf87dc2e20ddaf42b043665d 100644 (file)
@@ -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);
     }
 }
 
This page took 0.033158 seconds and 4 git commands to generate.