Jakub Jelinek <jj@ultra.linux.cz>

* ldfile.c (ldfile_open_file_search): Skip libraries made for
        incompatible architectures in the search path. Let the user know
        about any such skips.
This commit is contained in:
Richard Henderson 1999-07-08 16:50:53 +00:00
parent 9df31319e8
commit 99f8f232c6
2 changed files with 35 additions and 2 deletions

View File

@ -1,3 +1,9 @@
1999-07-08 Jakub Jelinek <jj@ultra.linux.cz>
* ldfile.c (ldfile_open_file_search): Skip libraries made for
incompatible architectures in the search path. Let the user know
about any such skips.
Thu Jul 8 12:32:23 1999 John David Anglin <dave@hiauly1.hia.nrc.ca> Thu Jul 8 12:32:23 1999 John David Anglin <dave@hiauly1.hia.nrc.ca>
* configure.tgt (hppa*-linux-gnu*): New target. * configure.tgt (hppa*-linux-gnu*): New target.

View File

@ -176,11 +176,38 @@ ldfile_open_file_search (arch, entry, lib, suffix)
sprintf (string, "%s%s%s", search->name, slash, entry->filename); sprintf (string, "%s%s%s", search->name, slash, entry->filename);
if (ldfile_try_open_bfd (string, entry)) if (ldfile_try_open_bfd (string, entry))
{
bfd * arfile = NULL;
if (bfd_check_format (entry->the_bfd, bfd_archive))
{
/* We treat an archive as compatible if it empty
or has at least one compatible object. */
arfile = bfd_openr_next_archived_file (entry->the_bfd, NULL);
if (!arfile)
arfile = output_bfd;
else
while (arfile
&& !(bfd_check_format (arfile, bfd_object)
&& bfd_arch_get_compatible (arfile, output_bfd)))
arfile = bfd_openr_next_archived_file (entry->the_bfd, arfile);
}
else if (bfd_arch_get_compatible (entry->the_bfd, output_bfd))
arfile = output_bfd;
if (arfile)
{ {
entry->filename = string; entry->filename = string;
return true; return true;
} }
info_msg (_("%s is for an incompatible architecture -- skipped\n"),
string);
bfd_close(entry->the_bfd);
entry->the_bfd = NULL;
}
free (string); free (string);
} }