- case 5: /* armv4 */
- case 6: /* armv4t */
- case 7: /* armv5 */
- case 8: /* armv5t */
- if (mach == 7 || mach == 8)
- ARMul_SelectProcessor (state, ARM_v5_Prop);
- else
- ARMul_SelectProcessor (state, ARM_v4_Prop);
- /* Reset mode to ARM. A gdb user may rerun a program that had entered
- THUMB mode from the start and cause the ARM-mode startup code to be
- executed in THUMB mode. */
- ARMul_SetCPSR (state, USER32MODE);
+ case bfd_mach_arm_5:
+ if (bfd_family_coff (abfd))
+ {
+ /* This is a special case in order to support COFF based ARM toolchains.
+ The COFF header does not have enough room to store all the different
+ kinds of ARM cpu, so the XScale, v5T and v5TE architectures all default
+ to v5. (See coff_set_flags() in bdf/coffcode.h). So if we see a v5
+ machine type here, we assume it could be any of the above architectures
+ and so select the most feature-full. */
+ ARMul_SelectProcessor (state, ARM_v5_Prop | ARM_v5e_Prop | ARM_XScale_Prop);
+ break;
+ }
+ /* Otherwise drop through. */
+
+ case bfd_mach_arm_5T:
+ ARMul_SelectProcessor (state, ARM_v5_Prop);