diff options
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/mach-o.c | 59 | ||||
-rw-r--r-- | include/mach-o/ChangeLog | 5 | ||||
-rw-r--r-- | include/mach-o/loader.h | 13 |
4 files changed, 70 insertions, 12 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 4e440eb..2fd6ae0 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,10 @@ 2012-01-04 Tristan Gingold <gingold@adacore.com> + * mach-o.c (bfd_mach_o_convert_architecture): Reindent. + Decode msubtype for ARM. + +2012-01-04 Tristan Gingold <gingold@adacore.com> + * mach-o.c (bfd_mach_o_get_synthetic_symtab): Add comments. 2012-01-04 Tristan Gingold <gingold@adacore.com> diff --git a/bfd/mach-o.c b/bfd/mach-o.c index ddc8944..a72cba0 100644 --- a/bfd/mach-o.c +++ b/bfd/mach-o.c @@ -821,7 +821,7 @@ bfd_mach_o_print_symbol (bfd *abfd, static void bfd_mach_o_convert_architecture (bfd_mach_o_cpu_type mtype, - bfd_mach_o_cpu_subtype msubtype ATTRIBUTE_UNUSED, + bfd_mach_o_cpu_subtype msubtype, enum bfd_architecture *type, unsigned long *subtype) { @@ -829,8 +829,12 @@ bfd_mach_o_convert_architecture (bfd_mach_o_cpu_type mtype, 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_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,17 +843,52 @@ bfd_mach_o_convert_architecture (bfd_mach_o_cpu_type mtype, *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_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_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; diff --git a/include/mach-o/ChangeLog b/include/mach-o/ChangeLog index 2cbd47a..0280ca7 100644 --- a/include/mach-o/ChangeLog +++ b/include/mach-o/ChangeLog @@ -1,5 +1,10 @@ 2012-01-04 Tristan Gingold <gingold@adacore.com> + * loader.h: Update copyright year. + (bfd_mach_o_cpu_subtype): Add ARM subtypes. + +2012-01-04 Tristan Gingold <gingold@adacore.com> + * external.h: Update copyright year. (mach_o_symtab_command_external): Add comments. (mach_o_encryption_info_command_external): New structure. diff --git a/include/mach-o/loader.h b/include/mach-o/loader.h index 296782f..824f793 100644 --- a/include/mach-o/loader.h +++ b/include/mach-o/loader.h @@ -1,5 +1,5 @@ /* Mach-O support for BFD. - Copyright 2011 + Copyright 2011, 2012 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -56,7 +56,16 @@ bfd_mach_o_cpu_type; typedef enum bfd_mach_o_cpu_subtype { - BFD_MACH_O_CPU_SUBTYPE_X86_ALL = 3 + /* 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; |