arc: Swap highbyte and lowbyte in print_insn_arc
authorGraham Markall <graham.markall@embecosm.com>
Thu, 13 Oct 2016 08:34:16 +0000 (09:34 +0100)
committerGraham Markall <graham.markall@embecosm.com>
Thu, 3 Nov 2016 17:14:38 +0000 (17:14 +0000)
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
opcodes/arc-dis.c

index 634ad27248a4e17a23e0b047bb79bb4bff833b0b..fe268382a4c504b15dd85bbc5d79c2a12e1203f4 100644 (file)
@@ -1,3 +1,7 @@
+2016-11-03  Graham Markall  <graham.markall@embecosm.com>
+
+       * arc-dis.c (print_insn_arc): Swap highbyte and lowbyte.
+
 2016-11-03  Graham Markall  <graham.markall@embecosm.com>
 
        * arc-dis.c (find_format_from_table): Replace use of ARC_SHORT
index a1aaf34c9caca5e156f2e153f551026735107e31..64bfecd3b99ad6856df05e5c61ec3e4b3003a40a 100644 (file)
@@ -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:
This page took 0.027547 seconds and 4 git commands to generate.