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

Alan Modra amodra@gmail.com
Tue Oct 11 02:14:00 GMT 2011


On Mon, Oct 10, 2011 at 12:57:07PM -0700, H.J. Lu wrote:
> --- 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.  */
>      }

This looks quite dodgy to me.  Better to fix the problem in
bfd_generic_archive_p I think.

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list