blob: cd6965d70ef26532f8ae884929ec99d05056c051 [file] [log] [blame]
Brad Bishop26bdd442019-08-16 17:08:17 -04001From cbe98e5a0cbc2337bf25d6b3f9dabcae38b95952 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Tue, 26 Feb 2019 17:31:41 +0530
4Subject: [PATCH] changes of "PR22458, failure to choose a matching ELF target"
5 is causing "Multiple Prevailing definition errors",added check for best_match
6 elf.
7
8Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com>
9Signed-off-by: Nagaraju Mekala <nagaraju.mekala@xilinx.com>
10
11---
12 bfd/format.c | 5 +++++
13 1 file changed, 5 insertions(+)
14
15diff --git a/bfd/format.c b/bfd/format.c
16index 97a9229..3a74cc4 100644
17--- a/bfd/format.c
18+++ b/bfd/format.c
19@@ -292,7 +292,12 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching)
20
21 /* Don't check the default target twice. */
22 if (*target == &binary_vec
23+#if !BFD_SUPPORTS_PLUGINS
24 || (!abfd->target_defaulted && *target == save_targ))
25+#else
26+ || (!abfd->target_defaulted && *target == save_targ)
27+ || (*target)->match_priority > best_match)
28+#endif
29 continue;
30
31 /* If we already tried a match, the bfd is modified and may