This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] Allow an IR object with unknown architecture
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: binutils at sourceware dot org
- Date: Fri, 31 Aug 2018 08:41:01 -0700
- Subject: [PATCH] Allow an IR object with unknown architecture
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
An IR object may have an unknown architecture. But it is compatible
with other architecture.
OK for master?
H.J.
---
PR ld/23600
* archures.c (bfd_arch_get_compatible): Allow an IR object with
unknown architecture.
---
bfd/archures.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/bfd/archures.c b/bfd/archures.c
index 300e17e9eb..82b6741d2e 100644
--- a/bfd/archures.c
+++ b/bfd/archures.c
@@ -896,12 +896,13 @@ bfd_arch_get_compatible (const bfd *abfd,
/* Otherwise architecture-specific code has to decide. */
return abfd->arch_info->compatible (abfd->arch_info, bbfd->arch_info);
- /* We can allow an unknown architecture if accept_unknowns
- is true, or if the target is the "binary" format, which
- has an unknown architecture. Since the binary format can
+ /* We can allow an unknown architecture if accept_unknowns is true,
+ if UBFD is an IR object, or if the target is the "binary" format,
+ which has an unknown architecture. Since the binary format can
only be set by explicit request from the user, it is safe
to assume that they know what they are doing. */
if (accept_unknowns
+ || ubfd->plugin_format == bfd_plugin_yes
|| strcmp (bfd_get_target (ubfd), "binary") == 0)
return kbfd->arch_info;
return NULL;
--
2.17.1