This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: PR binutils/13278: --plugin doesn't work on archive


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.  */
     }
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]