/* 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.
#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 */
const bfd_arch_info_type * a;
const bfd_arch_info_type * b;
{
- /* For now keep things real simple - insist on matching architecture types */
-
- return (a->arch != b->arch || a->mach != b->mach ) ? NULL : a ;
+ /* 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;
+
+ 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
{ 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" },
+ { bfd_mach_arm_XScale, "xscale" }
};
-static boolean
+static boolean
scan (info, string)
const struct bfd_arch_info * info;
const char * string;
/* Finally check for the default architecture */
if (strcasecmp (string, "arm") == 0)
return info->the_default;
-
+
return false;
}
-
#define N(number, print, default, next) \
{ 32, 32, 8, bfd_arch_arm, number, "arm", print, 4, default, compatible, scan, next }
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, & arch_info_struct[8] ),
+ N( bfd_mach_arm_5TE, "armv5te", false, & arch_info_struct[9] ),
+ N( bfd_mach_arm_XScale, "xscale", 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] );