Don't bfd_check_format if not needed

When plugin isn't active or there is no thing more to claim, we don't
need to call bfd_check_format.

	* ldfile.c (ldfile_try_open_bfd): Don't call bfd_check_format
	if plugin isn't active or there is no thing more to claim.
This commit is contained in:
H.J. Lu 2015-02-08 15:00:34 -08:00
parent e13419c472
commit 1d5b29cfe4
2 changed files with 8 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2015-02-08 H.J. Lu <hongjiu.lu@intel.com>
* ldfile.c (ldfile_try_open_bfd): Don't call bfd_check_format
if plugin isn't active or there is no thing more to claim.
2015-02-08 H.J. Lu <hongjiu.lu@intel.com>
* plugin.c (plugin_maybe_claim): Check format against bfd_object

View File

@ -301,9 +301,9 @@ success:
bfd_object that it sets the bfd's arch and mach, which
will be needed when and if we want to bfd_create a new
one using this one as a template. */
if (bfd_check_format (entry->the_bfd, bfd_object)
&& link_info.lto_plugin_active
&& !no_more_claiming)
if (link_info.lto_plugin_active
&& !no_more_claiming
&& bfd_check_format (entry->the_bfd, bfd_object))
plugin_maybe_claim (entry);
#endif /* ENABLE_PLUGINS */