forked from Imagelibrary/binutils-gdb
* bfd.c (enum bfd_error): Add bfd_error_wrong_object_format.
(bfd_errmsgs): Add corresponding message. * archive.c (bfd_generic_archive_p): Don't release bfd_ardata when finding an archive that contains different format object files. Return bfd_error_wrong_object_format for this case. * format.c: Formatting fixes. s/CONST/const/. (bfd_check_format_matches): Accept archives that give bfd_error_wrong_object_format if no full match is found. Tidy code handling matching_vector. Don't return a pointer to freed memory in `matching'. Handle ambiguous matches as for partial archive matches. * bfd-in2.h: Regenerate.
This commit is contained in:
@@ -684,15 +684,19 @@ bfd_generic_archive_p (abfd)
|
||||
if (bfd_check_format (first, bfd_object)
|
||||
&& first->xvec != abfd->xvec)
|
||||
{
|
||||
#if 0
|
||||
/* We ought to close `first' here, but we can't, because
|
||||
we have no way to remove it from the archive cache.
|
||||
It's close to impossible to figure out when we can
|
||||
release bfd_ardata. FIXME. */
|
||||
(void) bfd_close (first);
|
||||
bfd_release (abfd, bfd_ardata (abfd));
|
||||
abfd->tdata.aout_ar_data = tdata_hold;
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
#endif
|
||||
bfd_set_error (bfd_error_wrong_object_format);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* We ought to close first here, but we can't, because we
|
||||
have no way to remove it from the archive cache. FIXME. */
|
||||
/* And we ought to close `first' here too. */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user