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-02-10 19:06:50 -0800
commitbb5a7d53eb0be6f84283a98b06733b3f55087c4b (patch)
tree8a16c0858ddc42f50f2972452db448efca985277
parent5b664463d5f0c161ef75eb980281e202fd086b4b (diff)
downloadbinutils-gdb-users/hjl/plugin-mixed.tar.gz
Don't check the plugin target twiceusers/hjl/plugin-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. */