opcodes: handle mach-o for thumb/arm disambiguation.
authorTristan Gingold <gingold@adacore.com>
Fri, 20 Nov 2015 16:24:52 +0000 (17:24 +0100)
committerTristan Gingold <gingold@adacore.com>
Mon, 23 Nov 2015 14:50:29 +0000 (15:50 +0100)
opcodes/
* arm-dis.c (print_insn): Also set is_thumb for Mach-O.

opcodes/ChangeLog
opcodes/arm-dis.c

index c661b9a31d1e6564f821d4a41515af4ddae7fe4b..08f0c1b75162a2a85c3637b5ddd91c3cbefb1800 100644 (file)
@@ -1,3 +1,7 @@
+2015-11-23  Tristan Gingold  <gingold@adacore.com>
+
+       * arm-dis.c (print_insn): Also set is_thumb for Mach-O.
+
 2015-11-20  Matthew Wahab  <matthew.wahab@arm.com>
 
        * aarch64-opc.c (aarch64_sys_regs): Add spsr_el12, elr_el12,
index 430da08863a6c0f48c1e938922cdb52ba74f08f8..cff4b3fcb6d260b664e348541098958260c10e77 100644 (file)
@@ -34,6 +34,7 @@
 #include "elf-bfd.h"
 #include "elf/internal.h"
 #include "elf/arm.h"
+#include "mach-o.h"
 
 /* FIXME: Belongs in global header.  */
 #ifndef strneq
@@ -6374,6 +6375,13 @@ print_insn (bfd_vma pc, struct disassemble_info *info, bfd_boolean little)
                       == ST_BRANCH_TO_THUMB)
                      || type == STT_ARM_16BIT);
        }
+      else if (bfd_asymbol_flavour (*info->symbols)
+              == bfd_target_mach_o_flavour)
+       {
+         bfd_mach_o_asymbol *asym = (bfd_mach_o_asymbol *)*info->symbols;
+
+         is_thumb = (asym->n_desc & BFD_MACH_O_N_ARM_THUMB_DEF);
+       }
     }
 
   if (force_thumb)