From bf94ffc13c8533d01223c2d9632c27d76aa876a9 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 7 Mar 2014 12:18:30 -0800 Subject: Don't check the plugin target twice --- ChangeLog.lto-mixed | 5 +++++ bfd/format.c | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/ChangeLog.lto-mixed b/ChangeLog.lto-mixed index 246511e..be66879 100644 --- a/ChangeLog.lto-mixed +++ b/ChangeLog.lto-mixed @@ -1,5 +1,10 @@ bfd/ +2014-03-07 H.J. Lu + + * format.c (bfd_check_format_matches): Don't check the plugin + target twice. + 2012-06-04 H.J. Lu * plugin.c (add_symbols): Set tdata.plugin_data before calling diff --git a/bfd/format.c b/bfd/format.c index 97cbd22..55ab44c 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. */ -- cgit v1.1