This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PATCH: PR binutils/13278: --plugin doesn't work on archive
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: binutils at sourceware dot org
- Date: Mon, 10 Oct 2011 12:57:07 -0700
- Subject: PATCH: PR binutils/13278: --plugin doesn't work on archive
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Hi,
We changed the plugin type on archive to the target type of the first
archive member. If the first archive member isn't a plugin file,
we drop the plugin support on the rest archive member. This patch
avoids changing the plugin type on archive. OK to install?
Thanks.
H.J.
---
2011-10-10 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/13278
* format.c (bfd_check_format_matches): Don't change the plugin
type on archive to the target type of the first archive member.
diff --git a/bfd/format.c b/bfd/format.c
index 66b9051..05679c3 100644
--- a/bfd/format.c
+++ b/bfd/format.c
@@ -322,6 +322,16 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching)
if (matching_vector)
free (matching_vector);
+#if BFD_SUPPORTS_PLUGINS
+ if (abfd->format == bfd_archive)
+ {
+ /* Don't change the plugin type on archive to the target type of
+ the first archive member. */
+ extern const bfd_target plugin_vec;
+ if (save_targ == &plugin_vec)
+ abfd->xvec = save_targ;
+ }
+#endif
return TRUE; /* File position has moved, BTW. */
}