aboutsummaryrefslogtreecommitdiff
path: root/bfd/archive.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2001-08-17 03:19:01 +0000
committerAlan Modra <amodra@gmail.com>2001-08-17 03:19:01 +0000
commit3619ad0439dad3a20a39cbfb5f2c838e343e753a (patch)
tree5b0fca41dba6384772abe3b1c55ccb68f42fb59a /bfd/archive.c
parent29517f00a59567a3b9321b5e29389a62f7f8fb07 (diff)
downloadgdb-3619ad0439dad3a20a39cbfb5f2c838e343e753a.zip
gdb-3619ad0439dad3a20a39cbfb5f2c838e343e753a.tar.gz
gdb-3619ad0439dad3a20a39cbfb5f2c838e343e753a.tar.bz2
* 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.
Diffstat (limited to 'bfd/archive.c')
-rw-r--r--bfd/archive.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/bfd/archive.c b/bfd/archive.c
index 0a6f023..5f673e1 100644
--- a/bfd/archive.c
+++ b/bfd/archive.c
@@ -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. */
}
}