Don't bfd_check_format if not needed
authorH.J. Lu <hjl.tools@gmail.com>
Sun, 8 Feb 2015 23:00:34 +0000 (15:00 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Sun, 8 Feb 2015 23:00:34 +0000 (15:00 -0800)
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.

ld/ChangeLog
ld/ldfile.c

index 856249b1676e6913f8bd5438e4d42d6913c25d92..bf59ab3e176d6dc50eea7a424a6aa6dd3380cab4 100644 (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
index 05889f2e6c1de3abb04c690a7ecee70be5f32187..e19f55e6e04d4308d8bf5b6dd55c79ee2102706c 100644 (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 */
 
This page took 0.03239 seconds and 4 git commands to generate.