summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2015-02-08 17:53:24 -0800
committerH.J. Lu <hjl.tools@gmail.com>2015-10-16 13:57:07 -0700
commitabfa85fd497ba7cc2905041ceea28f019c047725 (patch)
tree7c6e87b273e4e792f9d662e30c961f290ce9b0f7
parent1693e29214762ce97eac7c3416463682c9ab47de (diff)
downloadbinutils-gdb-users/hjl/lto-mixed.tar.gz
Don't check the plugin target twiceusers/hjl/lto-mixed
If the plugin target is explicitly specified when a BFD file is opened, don't check it twice.
-rw-r--r--ChangeLog.lto-mixed11
-rw-r--r--bfd/format.c10
2 files changed, 21 insertions, 0 deletions
diff --git a/ChangeLog.lto-mixed b/ChangeLog.lto-mixed
index 246511ed022..5088e371f9f 100644
--- a/ChangeLog.lto-mixed
+++ b/ChangeLog.lto-mixed
@@ -1,5 +1,16 @@
bfd/
+2015-02-08 H.J. Lu <hongjiu.lu@intel.com>
+
+ * format.c: Include "plugin.h"
+ (bfd_check_format_matches): Don't check the plugin target twice
+ if the plugin target is explicitly specified.
+
+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..11c3d9a44c0 100644
--- a/bfd/format.c
+++ b/bfd/format.c
@@ -46,6 +46,9 @@ SUBSECTION
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
+#if BFD_SUPPORTS_PLUGINS
+#include "plugin.h"
+#endif
/* IMPORT from targets.c. */
extern const size_t _bfd_target_vector_entries;
@@ -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
+ /* If the plugin target is explicitly specified when a BFD file
+ is opened, don't check it twice. */
+ if (bfd_plugin_specified_p () && bfd_plugin_target_p (*target))
+ 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. */