summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2014-03-07 12:18:30 -0800
committerH.J. Lu <hjl.tools@gmail.com>2015-02-05 19:21:46 -0800
commitbf94ffc13c8533d01223c2d9632c27d76aa876a9 (patch)
tree4b08834565cf5ad256eb5a0551ffbb1ff3211162
parent2c1b69f680e42b173a655d4359382943c8b33ad4 (diff)
downloadbinutils-gdb-users/hjl/old-lto-mixed.tar.gz
Don't check the plugin target twiceusers/hjl/old-lto-mixed
-rw-r--r--ChangeLog.lto-mixed5
-rw-r--r--bfd/format.c10
2 files changed, 15 insertions, 0 deletions
diff --git a/ChangeLog.lto-mixed b/ChangeLog.lto-mixed
index 246511ed022..be66879b2fb 100644
--- a/ChangeLog.lto-mixed
+++ b/ChangeLog.lto-mixed
@@ -1,5 +1,10 @@
bfd/
+2014-03-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ * format.c (bfd_check_format_matches): Don't check the plugin
+ target twice.
+
2012-06-04 H.J. Lu <hongjiu.lu@intel.com>
* plugin.c (add_symbols): Set tdata.plugin_data before calling
diff --git a/bfd/format.c b/bfd/format.c
index 97cbd2261ac..55ab44cf41e 100644
--- a/bfd/format.c
+++ b/bfd/format.c
@@ -230,6 +230,9 @@ bfd_boolean
bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching)
{
extern const bfd_target binary_vec;
+#if BFD_SUPPORTS_PLUGINS
+ extern const bfd_target plugin_vec;
+#endif
const bfd_target * const *target;
const bfd_target **matching_vector = NULL;
const bfd_target *save_targ, *right_targ, *ar_right_targ, *match_targ;
@@ -315,6 +318,13 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching)
|| (*target)->match_priority > best_match)
continue;
+#if BFD_SUPPORTS_PLUGINS
+ /* Since the plugin target is explicitly specified when a BFD file
+ is opened, don't check it twice. */
+ if (*target == &plugin_vec)
+ continue;
+#endif
+
/* If we already tried a match, the bfd is modified and may
have sections attached, which will confuse the next
_bfd_check_format call. */