This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] opcodes: handle mach-o for thumb/arm disambiguation.
- From: Tristan Gingold <gingold at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 23 Nov 2015 14:51:01 -0000
- Subject: [binutils-gdb] opcodes: handle mach-o for thumb/arm disambiguation.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e49d43ff73a309548dd2b576bb7b602f62be66d6
commit e49d43ff73a309548dd2b576bb7b602f62be66d6
Author: Tristan Gingold <gingold@adacore.com>
Date: Fri Nov 20 17:24:52 2015 +0100
opcodes: handle mach-o for thumb/arm disambiguation.
opcodes/
* arm-dis.c (print_insn): Also set is_thumb for Mach-O.
Diff:
---
opcodes/ChangeLog | 4 ++++
opcodes/arm-dis.c | 8 ++++++++
2 files changed, 12 insertions(+)
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index c661b9a..08f0c1b 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -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,
diff --git a/opcodes/arm-dis.c b/opcodes/arm-dis.c
index 430da08..cff4b3f 100644
--- a/opcodes/arm-dis.c
+++ b/opcodes/arm-dis.c
@@ -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)