2002-06-07 Chris Demetriou <cgd@broadcom.com>
[deliverable/binutils-gdb.git] / bfd / archures.c
index fb2ba9b79e29c0af0eff5148b8bb2e2bc6cf3ae5..36fc56873d5233a7b48dd77ce398fe38e00f122b 100644 (file)
@@ -193,6 +193,7 @@ DESCRIPTION
 .#define bfd_mach_d10v_ts2     2
 .#define bfd_mach_d10v_ts3     3
 .  bfd_arch_d30v,      {* Mitsubishi D30V *}
+.  bfd_arch_dlx,       {* DLX *}
 .  bfd_arch_m68hc11,   {* Motorola 68HC11 *}
 .  bfd_arch_m68hc12,   {* Motorola 68HC12 *}
 .  bfd_arch_z8k,       {* Zilog Z8000 *}
@@ -288,7 +289,9 @@ DESCRIPTION
 .  const char *arch_name;
 .  const char *printable_name;
 .  unsigned int section_align_power;
-.  {* True if this is the default machine for the architecture.  *}
+.  {* True if this is the default machine for the architecture.
+.     The default arch should be the first entry for an arch so that
+.     all the entries for that arch can be accessed via <<next>>.  *}
 .  boolean the_default;
 .  const struct bfd_arch_info * (*compatible)
 .      PARAMS ((const struct bfd_arch_info *a,
@@ -310,6 +313,7 @@ extern const bfd_arch_info_type bfd_avr_arch;
 extern const bfd_arch_info_type bfd_cris_arch;
 extern const bfd_arch_info_type bfd_d10v_arch;
 extern const bfd_arch_info_type bfd_d30v_arch;
+extern const bfd_arch_info_type bfd_dlx_arch;
 extern const bfd_arch_info_type bfd_fr30_arch;
 extern const bfd_arch_info_type bfd_h8300_arch;
 extern const bfd_arch_info_type bfd_h8500_arch;
@@ -363,6 +367,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] =
     &bfd_cris_arch,
     &bfd_d10v_arch,
     &bfd_d30v_arch,
+    &bfd_dlx_arch,
     &bfd_fr30_arch,
     &bfd_h8300_arch,
     &bfd_h8500_arch,
@@ -604,21 +609,9 @@ bfd_default_set_arch_mach (abfd, arch, mach)
      enum bfd_architecture arch;
      unsigned long mach;
 {
-  const bfd_arch_info_type * const *app, *ap;
-
-  for (app = bfd_archures_list; *app != NULL; app++)
-    {
-      for (ap = *app; ap != NULL; ap = ap->next)
-       {
-         if (ap->arch == arch
-             && (ap->mach == mach
-                 || (mach == 0 && ap->the_default)))
-           {
-             abfd->arch_info = ap;
-             return true;
-           }
-       }
-    }
+  abfd->arch_info = bfd_lookup_arch (arch, mach);
+  if (abfd->arch_info != NULL)
+    return true;
 
   abfd->arch_info = &bfd_default_arch_struct;
   bfd_set_error (bfd_error_bad_value);
@@ -722,6 +715,9 @@ bfd_default_compatible (a, b)
   if (a->arch != b->arch)
     return NULL;
 
+  if (a->bits_per_word != b->bits_per_word)
+    return NULL;
+
   if (a->mach > b->mach)
     return a;
 
This page took 0.025436 seconds and 4 git commands to generate.