projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Prevent address violation problem when disassembling corrupt aarch64 binary.
[deliverable/binutils-gdb.git]
/
opcodes
/
moxie-dis.c
diff --git
a/opcodes/moxie-dis.c
b/opcodes/moxie-dis.c
index 90e0464a18a6e5f3d5f48911dc44224178538d15..390fc7842219265754170f479432f8253669ad3a 100644
(file)
--- a/
opcodes/moxie-dis.c
+++ b/
opcodes/moxie-dis.c
@@
-1,5
+1,5
@@
/* Disassemble moxie instructions.
/* Disassemble moxie instructions.
- Copyright (C) 2009-201
4
Free Software Foundation, Inc.
+ Copyright (C) 2009-201
7
Free Software Foundation, Inc.
This file is part of the GNU opcodes library.
This file is part of the GNU opcodes library.
@@
-25,7
+25,7
@@
#define DEFINE_TABLE
#include "opcode/moxie.h"
#define DEFINE_TABLE
#include "opcode/moxie.h"
-#include "dis
-asm
.h"
+#include "dis
assemble
.h"
static fprintf_ftype fpr;
static void *stream;
static fprintf_ftype fpr;
static void *stream;
@@
-140,37
+140,37
@@
print_insn_moxie (bfd_vma addr, struct disassemble_info * info)
length = 6;
}
break;
length = 6;
}
break;
- case MOXIE_F1_AiB
4
:
+ case MOXIE_F1_AiB
2
:
{
unsigned imm;
{
unsigned imm;
- if ((status = info->read_memory_func (addr+2, buffer,
4
, info)))
+ if ((status = info->read_memory_func (addr+2, buffer,
2
, info)))
goto fail;
if (info->endian == BFD_ENDIAN_BIG)
goto fail;
if (info->endian == BFD_ENDIAN_BIG)
- imm = bfd_getb
32
(buffer);
+ imm = bfd_getb
16
(buffer);
else
else
- imm = bfd_getl
32
(buffer);
+ imm = bfd_getl
16
(buffer);
fpr (stream, "%s\t0x%x(%s), %s", opcode->name,
imm,
reg_names[OP_A(iword)],
reg_names[OP_B(iword)]);
fpr (stream, "%s\t0x%x(%s), %s", opcode->name,
imm,
reg_names[OP_A(iword)],
reg_names[OP_B(iword)]);
- length =
6
;
+ length =
4
;
}
break;
}
break;
- case MOXIE_F1_ABi
4
:
+ case MOXIE_F1_ABi
2
:
{
unsigned imm;
{
unsigned imm;
- if ((status = info->read_memory_func (addr+2, buffer,
4
, info)))
+ if ((status = info->read_memory_func (addr+2, buffer,
2
, info)))
goto fail;
if (info->endian == BFD_ENDIAN_BIG)
goto fail;
if (info->endian == BFD_ENDIAN_BIG)
- imm = bfd_getb
32
(buffer);
+ imm = bfd_getb
16
(buffer);
else
else
- imm = bfd_getl
32
(buffer);
+ imm = bfd_getl
16
(buffer);
fpr (stream, "%s\t%s, 0x%x(%s)",
opcode->name,
reg_names[OP_A(iword)],
imm,
reg_names[OP_B(iword)]);
fpr (stream, "%s\t%s, 0x%x(%s)",
opcode->name,
reg_names[OP_A(iword)],
imm,
reg_names[OP_B(iword)]);
- length =
6
;
+ length =
4
;
}
break;
case MOXIE_BAD:
}
break;
case MOXIE_BAD:
@@
-210,7
+210,7
@@
print_insn_moxie (bfd_vma addr, struct disassemble_info * info)
{
case MOXIE_F3_PCREL:
fpr (stream, "%s\t", opcode->name);
{
case MOXIE_F3_PCREL:
fpr (stream, "%s\t", opcode->name);
- info->print_address_func ((bfd_vma) (addr + INST2OFFSET(iword) + 2),
+ info->print_address_func ((bfd_vma) (addr + INST2OFFSET(iword) + 2),
info);
break;
case MOXIE_BAD:
info);
break;
case MOXIE_BAD:
This page took
0.0241 seconds
and
4
git commands to generate.