Remove the erroneous ">>>>>>> 1.419".
[deliverable/binutils-gdb.git] / bfd / cpu-arm.c
index db8282e31fbf2ff3c6c38632b882369ca1fbf925..bda9c4489a665f4b960602f1660be703f63b856b 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD support for the ARM processor
-   Copyright 1994 Free Software Foundation, Inc.
+   Copyright 1994, 95, 97, 1999 Free Software Foundation, Inc.
    Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -22,6 +22,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "sysdep.h"
 #include "libbfd.h"
 
+static const bfd_arch_info_type *compatible
+  PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
+static boolean scan PARAMS ((const struct bfd_arch_info *, const char *));
+
 /* This routine is provided two arch_infos and works out which ARM
    machine which would be compatible with both and returns a pointer
    to its info structure */
@@ -31,9 +35,30 @@ compatible (a,b)
      const bfd_arch_info_type * a;
      const bfd_arch_info_type * b;
 {
-  /* For now keep things real simple - insist on matching architecture types */
+  /* If a & b are for different architecture we can do nothing */
+  if (a->arch != b->arch)
+      return NULL;
+
+  /* If a & b are for the same machine then all is well */
+  if (a->mach == b->mach)
+    return a;
+
+  /* Otherwise if either a or b is the 'default' machine then
+     it can be polymorphed into the other */
+  if (a->the_default)
+    return b;
   
-  return (a->arch != b->arch || a->mach != b->mach ) ? NULL : a ;
+  if (b->the_default)
+    return a;
+
+  /* So far all newer ARM architecture cores are supersets of previous cores */
+  if (a->mach < b->mach)
+    return b;
+  else if (a->mach > b->mach)
+    return a;
+
+  /* Never reached! */
+  return NULL;
 }
 
 static struct
@@ -57,10 +82,17 @@ processors[] =
   { bfd_mach_arm_3,  "arm7di"   },
   { bfd_mach_arm_3M, "arm7dm"   },
   { bfd_mach_arm_3M, "arm7dmi"  },
+  { bfd_mach_arm_4T, "arm7tdmi" },
   { bfd_mach_arm_4,  "arm8"     },
   { bfd_mach_arm_4,  "arm810"   },
+  { bfd_mach_arm_4,  "arm9"     },
+  { bfd_mach_arm_4,  "arm920"   },
+  { bfd_mach_arm_4T, "arm920t"  },
+  { bfd_mach_arm_4T, "arm9tdmi" },
   { bfd_mach_arm_4,  "sa1"      },
-  { bfd_mach_arm_4T, "arm7tdmi" }
+  { bfd_mach_arm_4,  "strongarm"},
+  { bfd_mach_arm_4,  "strongarm110" },
+  { bfd_mach_arm_4,  "strongarm1100" },
 };
 
 static boolean 
@@ -97,12 +129,15 @@ scan (info, string)
 
 static const bfd_arch_info_type arch_info_struct[] =
 { 
-  N( bfd_mach_arm_2,  "ARMv2",  false, & arch_info_struct[1] ),
-  N( bfd_mach_arm_2a, "ARMv2a", false, & arch_info_struct[2] ),
-  N( bfd_mach_arm_3,  "ARMv3",  false, & arch_info_struct[3] ),
-  N( bfd_mach_arm_4,  "ARMv4",  false, & arch_info_struct[4] ),
-  N( bfd_mach_arm_4T, "ARMv4T", false, NULL )
+  N( bfd_mach_arm_2,  "armv2",  false, & arch_info_struct[1] ),
+  N( bfd_mach_arm_2a, "armv2a", false, & arch_info_struct[2] ),
+  N( bfd_mach_arm_3,  "armv3",  false, & arch_info_struct[3] ),
+  N( bfd_mach_arm_3M, "armv3m", false, & arch_info_struct[4] ),
+  N( bfd_mach_arm_4,  "armv4",  false, & arch_info_struct[5] ),
+  N( bfd_mach_arm_4T, "armv4t", false, & arch_info_struct[6] ),
+  N( bfd_mach_arm_5,  "armv5",  false, & arch_info_struct[7] ),
+  N( bfd_mach_arm_5T, "armv5t", false, NULL )
 };
 
 const bfd_arch_info_type bfd_arm_arch =
-  N( bfd_mach_arm_3M, "ARMv3M", true, & arch_info_struct[0] );
+  N( 0, "arm", true, & arch_info_struct[0] );
This page took 0.024503 seconds and 4 git commands to generate.