This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[Darwin/committed]: Decode ARM subarch
- From: Tristan Gingold <gingold at adacore dot com>
- To: binutils Development <binutils at sourceware dot org>
- Date: Wed, 4 Jan 2012 11:26:02 +0100
- Subject: [Darwin/committed]: Decode ARM subarch
Hi,
with this patch, ARM sub-architectures are now added and decoded.
Committed on trunk.
Tristan.
bfd/
2012-01-04 Tristan Gingold <gingold@adacore.com>
* mach-o.c (bfd_mach_o_convert_architecture): Reindent.
Decode msubtype for ARM.
include/mach-o/
2012-01-04 Tristan Gingold <gingold@adacore.com>
* loader.h: Update copyright year.
(bfd_mach_o_cpu_subtype): Add ARM subtypes.
Index: bfd/mach-o.c
===================================================================
RCS file: /cvs/src/src/bfd/mach-o.c,v
retrieving revision 1.87
diff -c -r1.87 mach-o.c
*** bfd/mach-o.c 4 Jan 2012 10:14:25 -0000 1.87
--- bfd/mach-o.c 4 Jan 2012 10:20:37 -0000
***************
*** 821,827 ****
static void
bfd_mach_o_convert_architecture (bfd_mach_o_cpu_type mtype,
! bfd_mach_o_cpu_subtype msubtype ATTRIBUTE_UNUSED,
enum bfd_architecture *type,
unsigned long *subtype)
{
--- 821,827 ----
static void
bfd_mach_o_convert_architecture (bfd_mach_o_cpu_type mtype,
! bfd_mach_o_cpu_subtype msubtype,
enum bfd_architecture *type,
unsigned long *subtype)
{
***************
*** 829,836 ****
switch (mtype)
{
! case BFD_MACH_O_CPU_TYPE_VAX: *type = bfd_arch_vax; break;
! case BFD_MACH_O_CPU_TYPE_MC680x0: *type = bfd_arch_m68k; break;
case BFD_MACH_O_CPU_TYPE_I386:
*type = bfd_arch_i386;
*subtype = bfd_mach_i386_i386;
--- 829,840 ----
switch (mtype)
{
! case BFD_MACH_O_CPU_TYPE_VAX:
! *type = bfd_arch_vax;
! break;
! case BFD_MACH_O_CPU_TYPE_MC680x0:
! *type = bfd_arch_m68k;
! break;
case BFD_MACH_O_CPU_TYPE_I386:
*type = bfd_arch_i386;
*subtype = bfd_mach_i386_i386;
***************
*** 839,855 ****
*type = bfd_arch_i386;
*subtype = bfd_mach_x86_64;
break;
! case BFD_MACH_O_CPU_TYPE_MIPS: *type = bfd_arch_mips; break;
! case BFD_MACH_O_CPU_TYPE_MC98000: *type = bfd_arch_m98k; break;
! case BFD_MACH_O_CPU_TYPE_HPPA: *type = bfd_arch_hppa; break;
! case BFD_MACH_O_CPU_TYPE_ARM: *type = bfd_arch_arm; break;
! case BFD_MACH_O_CPU_TYPE_MC88000: *type = bfd_arch_m88k; break;
case BFD_MACH_O_CPU_TYPE_SPARC:
*type = bfd_arch_sparc;
*subtype = bfd_mach_sparc;
break;
! case BFD_MACH_O_CPU_TYPE_I860: *type = bfd_arch_i860; break;
! case BFD_MACH_O_CPU_TYPE_ALPHA: *type = bfd_arch_alpha; break;
case BFD_MACH_O_CPU_TYPE_POWERPC:
*type = bfd_arch_powerpc;
*subtype = bfd_mach_ppc;
--- 843,894 ----
*type = bfd_arch_i386;
*subtype = bfd_mach_x86_64;
break;
! case BFD_MACH_O_CPU_TYPE_MIPS:
! *type = bfd_arch_mips;
! break;
! case BFD_MACH_O_CPU_TYPE_MC98000:
! *type = bfd_arch_m98k;
! break;
! case BFD_MACH_O_CPU_TYPE_HPPA:
! *type = bfd_arch_hppa;
! break;
! case BFD_MACH_O_CPU_TYPE_ARM:
! *type = bfd_arch_arm;
! switch (msubtype)
! {
! case BFD_MACH_O_CPU_SUBTYPE_ARM_V4T:
! *subtype = bfd_mach_arm_4T;
! break;
! case BFD_MACH_O_CPU_SUBTYPE_ARM_V6:
! *subtype = bfd_mach_arm_4T; /* Best fit ? */
! break;
! case BFD_MACH_O_CPU_SUBTYPE_ARM_V5TEJ:
! *subtype = bfd_mach_arm_5TE;
! break;
! case BFD_MACH_O_CPU_SUBTYPE_ARM_XSCALE:
! *subtype = bfd_mach_arm_XScale;
! break;
! case BFD_MACH_O_CPU_SUBTYPE_ARM_V7:
! *subtype = bfd_mach_arm_5TE; /* Best fit ? */
! break;
! case BFD_MACH_O_CPU_SUBTYPE_ARM_ALL:
! default:
! break;
! }
! break;
! case BFD_MACH_O_CPU_TYPE_MC88000:
! *type = bfd_arch_m88k;
! break;
case BFD_MACH_O_CPU_TYPE_SPARC:
*type = bfd_arch_sparc;
*subtype = bfd_mach_sparc;
break;
! case BFD_MACH_O_CPU_TYPE_I860:
! *type = bfd_arch_i860;
! break;
! case BFD_MACH_O_CPU_TYPE_ALPHA:
! *type = bfd_arch_alpha;
! break;
case BFD_MACH_O_CPU_TYPE_POWERPC:
*type = bfd_arch_powerpc;
*subtype = bfd_mach_ppc;
Index: include/mach-o/loader.h
===================================================================
RCS file: /cvs/src/src/include/mach-o/loader.h,v
retrieving revision 1.4
diff -c -r1.4 loader.h
*** include/mach-o/loader.h 14 Dec 2011 10:30:09 -0000 1.4
--- include/mach-o/loader.h 4 Jan 2012 10:20:41 -0000
***************
*** 1,5 ****
/* Mach-O support for BFD.
! Copyright 2011
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
--- 1,5 ----
/* Mach-O support for BFD.
! Copyright 2011, 2012
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
***************
*** 56,62 ****
typedef enum bfd_mach_o_cpu_subtype
{
! BFD_MACH_O_CPU_SUBTYPE_X86_ALL = 3
}
bfd_mach_o_cpu_subtype;
--- 56,71 ----
typedef enum bfd_mach_o_cpu_subtype
{
! /* i386. */
! BFD_MACH_O_CPU_SUBTYPE_X86_ALL = 3,
!
! /* arm. */
! BFD_MACH_O_CPU_SUBTYPE_ARM_ALL = 0,
! BFD_MACH_O_CPU_SUBTYPE_ARM_V4T = 5,
! BFD_MACH_O_CPU_SUBTYPE_ARM_V6 = 6,
! BFD_MACH_O_CPU_SUBTYPE_ARM_V5TEJ = 7,
! BFD_MACH_O_CPU_SUBTYPE_ARM_XSCALE = 8,
! BFD_MACH_O_CPU_SUBTYPE_ARM_V7 = 9
}
bfd_mach_o_cpu_subtype;