* readelf.c (decode_location_expression): Loop through multiple
[deliverable/binutils-gdb.git] / ld / ldfile.c
index 6c00cab91e3d90d2f169f581e8bc40611affcaba..9613c078384202a61d0afe07330e02fafa1346db 100644 (file)
@@ -1,4 +1,6 @@
-/* Copyright (C) 1991, 92, 93, 94, 95, 98, 1999 Free Software Foundation, Inc.
+/* Linker file opening and searching.
+   Copyright (C) 1991, 92, 93, 94, 95, 98, 99, 2000
+   Free Software Foundation, Inc.
 
 This file is part of GLD, the Gnu Linker.
 
@@ -74,9 +76,6 @@ typedef struct search_arch
 static search_arch_type *search_arch_head;
 static search_arch_type **search_arch_tail_ptr = &search_arch_head;
  
-static boolean ldfile_open_file_search
-  PARAMS ((const char *arch, lang_input_statement_type *,
-          const char *lib, const char *suffix));
 static FILE *try_open PARAMS ((const char *name, const char *exten));
 
 void
@@ -132,15 +131,18 @@ ldfile_try_open_bfd (attempt, entry)
       else
        check = entry->the_bfd;
 
-      if (! bfd_check_format (check, bfd_object))
-       return true;
-      if (bfd_arch_get_compatible (check, output_bfd) == NULL)
+      if (check != NULL)
        {
-         einfo (_("%P: skipping incompatible %s when searching for %s"),
-                attempt, entry->local_sym_name);
-         bfd_close (entry->the_bfd);
-         entry->the_bfd = NULL;
-         return false;
+         if (! bfd_check_format (check, bfd_object))
+           return true;
+         if (bfd_arch_get_compatible (check, output_bfd) == NULL)
+           {
+             einfo (_("%P: skipping incompatible %s when searching for %s"),
+                    attempt, entry->local_sym_name);
+             bfd_close (entry->the_bfd);
+             entry->the_bfd = NULL;
+             return false;
+           }
        }
     }
 
@@ -150,7 +152,7 @@ ldfile_try_open_bfd (attempt, entry)
 /* Search for and open the file specified by ENTRY.  If it is an
    archive, use ARCH, LIB and SUFFIX to modify the file name.  */
 
-static boolean
+boolean
 ldfile_open_file_search (arch, entry, lib, suffix)
      const char *arch;
      lang_input_statement_type *entry;
@@ -247,6 +249,8 @@ ldfile_open_file (entry)
          if (ldfile_open_file_search (arch->name, entry, ":lib", ".a"))
            return;
 #endif
+         if (ldemul_find_potential_libraries (arch->name, entry))
+           return;
        }
       einfo (_("%F%P: cannot find %s\n"), entry->local_sym_name);
     }
This page took 0.022976 seconds and 4 git commands to generate.