diff mbox

[4/5] disas/ppc.c: Fix little endian disassembly

Message ID 1375836424-773-5-git-send-email-anton@samba.org
State New
Headers show

Commit Message

Anton Blanchard Aug. 7, 2013, 12:47 a.m. UTC
Use info->endian to select the endian of the instruction to
be disassembled.

Signed-off-by: Anton Blanchard <anton@samba.org>
---
 disas/ppc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Anthony Liguori Aug. 7, 2013, 1:10 a.m. UTC | #1
On Tue, Aug 6, 2013 at 7:47 PM, Anton Blanchard <anton@samba.org> wrote:
> Use info->endian to select the endian of the instruction to
> be disassembled.
>
> Signed-off-by: Anton Blanchard <anton@samba.org>

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>

Regards,

Anthony Liguori

> ---
>  disas/ppc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/disas/ppc.c b/disas/ppc.c
> index c149506..99c4cbc 100644
> --- a/disas/ppc.c
> +++ b/disas/ppc.c
> @@ -5157,7 +5157,8 @@ int
>  print_insn_ppc (bfd_vma memaddr, struct disassemble_info *info)
>  {
>    int dialect = (char *) info->private_data - (char *) 0;
> -  return print_insn_powerpc (memaddr, info, 1, dialect);
> +  return print_insn_powerpc (memaddr, info, info->endian == BFD_ENDIAN_BIG,
> +                             dialect);
>  }
>
>  /* Print a big endian PowerPC instruction.  */
> --
> 1.8.1.2
>
>
Alexander Graf Aug. 14, 2013, 1:31 p.m. UTC | #2
On 07.08.2013, at 02:47, Anton Blanchard wrote:

> Use info->endian to select the endian of the instruction to
> be disassembled.
> 
> Signed-off-by: Anton Blanchard <anton@samba.org>

Thanks, applied to ppc-next.


Alex
diff mbox

Patch

diff --git a/disas/ppc.c b/disas/ppc.c
index c149506..99c4cbc 100644
--- a/disas/ppc.c
+++ b/disas/ppc.c
@@ -5157,7 +5157,8 @@  int
 print_insn_ppc (bfd_vma memaddr, struct disassemble_info *info)
 {
   int dialect = (char *) info->private_data - (char *) 0;
-  return print_insn_powerpc (memaddr, info, 1, dialect);
+  return print_insn_powerpc (memaddr, info, info->endian == BFD_ENDIAN_BIG,
+                             dialect);
 }
 
 /* Print a big endian PowerPC instruction.  */