Allow an IR object with unknown architecture
authorH.J. Lu <hjl.tools@gmail.com>
Sat, 1 Sep 2018 02:56:25 +0000 (19:56 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Sat, 1 Sep 2018 02:57:38 +0000 (19:57 -0700)
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.

bfd/ChangeLog
bfd/archures.c

index fcbfa96625aea539a4639f453757afada9f35be1..792df8a1fa530ee3840d4a90816a45033de49a70 100644 (file)
@@ -1,3 +1,9 @@
+018-08-31  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ld/23600
+       * archures.c (bfd_arch_get_compatible): Allow an IR object with
+       unknown architecture.
+
 2018-08-31  Alan Modra  <amodra@gmail.com>
 
        * elf64-ppc.c (num_relocs_for_offset): New function.
index 300e17e9eb215ffc3deaab9ba7ad8612af26f2c7..82b6741d2ef1d8edc96dc63050b3be7d30e43c3b 100644 (file)
@@ -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;
This page took 0.042934 seconds and 4 git commands to generate.