aboutsummaryrefslogtreecommitdiff
path: root/bfd/archures.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2018-08-31 19:56:25 -0700
committerH.J. Lu <hjl.tools@gmail.com>2018-08-31 19:57:38 -0700
commitb986869b6605e45044626c5b3111390ac4e70b82 (patch)
tree562c6624fbde3399e51b184800130e5ad1320533 /bfd/archures.c
parentd431d6279bdcd475feb921a3aa8ecf0cf3ffc6a6 (diff)
downloadfsf-binutils-gdb-b986869b6605e45044626c5b3111390ac4e70b82.zip
fsf-binutils-gdb-b986869b6605e45044626c5b3111390ac4e70b82.tar.gz
fsf-binutils-gdb-b986869b6605e45044626c5b3111390ac4e70b82.tar.bz2
Allow an IR object with unknown architecture
An IR object may have an unknown architecture. But it is compatible with other architecture. PR ld/23600 * archures.c (bfd_arch_get_compatible): Allow an IR object with unknown architecture.
Diffstat (limited to 'bfd/archures.c')
-rw-r--r--bfd/archures.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/bfd/archures.c b/bfd/archures.c
index 300e17e..82b6741 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;