This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [Patch]: arm disassembler: handle arm vs thumb for Mach-O
- From: Richard Earnshaw <Richard dot Earnshaw at foss dot arm dot com>
- To: Tristan Gingold <gingold at adacore dot com>, Binutils <binutils at sourceware dot org>
- Date: Mon, 23 Nov 2015 14:19:30 +0000
- Subject: Re: [Patch]: arm disassembler: handle arm vs thumb for Mach-O
- Authentication-results: sourceware.org; auth=none
- References: <B9632F04-DAC4-4AB8-AB6A-27F8D6C57E59 at adacore dot com>
On 20/11/15 16:46, Tristan Gingold wrote:
> Hi,
>
> the arm disassembler has some format specific code to detect
> the thumb mode. Add support for Mach-O.
>
> The code was manually tested.
>
> Ok for master ?
>
OK provided this causes no regressions on a standard ELF configuration.
R.
> Tristan.
>
>
> opcodes: handle mach-o for thumb/arm disambiguation.
>
> opcodes/
> * arm-dis.c (print_insn): Also set is_thumb for Mach-O.
>
> diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
> index 3eb88d4..2eb7a04 100644
> --- a/opcodes/ChangeLog
> +++ b/opcodes/ChangeLog
> @@ -1,3 +1,7 @@
> +2015-11-20 Tristan Gingold <gingold@adacore.com>
> +
> + * arm-dis.c (print_insn): Also set is_thumb for Mach-O.
> +
> 2015-11-20 Nick Clifton <nickc@redhat.com>
>
> PR binutils/19224
> 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)
>