This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH 5/7] arc: Swap highbyte and lowbyte in print_insn_arc
- From: Graham Markall <graham dot markall at embecosm dot com>
- To: binutils at sourceware dot org
- Cc: claudiu dot zissulescu at synopsys dot com, noamca at mellanox dot com, rinat at mellanox dot com, guybe at mellanox dot com, andrew dot burgess at embecosm dot com, Graham Markall <graham dot markall at embecosm dot com>
- Date: Wed, 26 Oct 2016 13:46:04 +0100
- Subject: [PATCH 5/7] arc: Swap highbyte and lowbyte in print_insn_arc
- Authentication-results: sourceware.org; auth=none
- References: <cover.1477409669.git.graham.markall@embecosm.com>
- References: <cover.1477409669.git.graham.markall@embecosm.com>
highbyte and lowbyte actually refer to the low byte and the high
byte respectively, but are used consistently in this swapped
order. This commit swaps them round so that highbyte refers to the
high byte and lowbyte refers to the low byte.
There should be no functional change after this commit.
opcodes/ChangeLog:
* arc-dis.c (print_insn_arc): Swap highbyte and lowbyte.
---
opcodes/ChangeLog | 4 ++++
opcodes/arc-dis.c | 8 ++++----
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/opcodes/arc-dis.c b/opcodes/arc-dis.c
index a1aaf34..64bfecd 100644
--- a/opcodes/arc-dis.c
+++ b/opcodes/arc-dis.c
@@ -921,8 +921,8 @@ print_insn_arc (bfd_vma memaddr,
}
memset (&iter, 0, sizeof (iter));
- lowbyte = ((info->endian == BFD_ENDIAN_LITTLE) ? 1 : 0);
- highbyte = ((info->endian == BFD_ENDIAN_LITTLE) ? 0 : 1);
+ highbyte = ((info->endian == BFD_ENDIAN_LITTLE) ? 1 : 0);
+ lowbyte = ((info->endian == BFD_ENDIAN_LITTLE) ? 0 : 1);
if (info->section && info->section->owner)
header = elf_elfheader (info->section->owner);
@@ -1025,13 +1025,13 @@ print_insn_arc (bfd_vma memaddr,
return size;
}
- insn_len = arc_insn_length (buffer[lowbyte], buffer[highbyte], info);
+ insn_len = arc_insn_length (buffer[highbyte], buffer[lowbyte], info);
pr_debug ("instruction length = %d bytes\n", insn_len);
switch (insn_len)
{
case 2:
- insn[0] = (buffer[lowbyte] << 8) | buffer[highbyte];
+ insn[0] = (buffer[highbyte] << 8) | buffer[lowbyte];
break;
default:
--
2.7.4