notaz.gp2x.de
/
libpicofe.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f287890
)
x86_64 support for host_dasm
author
notaz
<notasas@gmail.com>
Mon, 11 Dec 2017 00:51:29 +0000
(
02:51
+0200)
committer
notaz
<notasas@gmail.com>
Mon, 11 Dec 2017 00:51:29 +0000
(
02:51
+0200)
linux/host_dasm.c
patch
|
blob
|
blame
|
history
diff --git
a/linux/host_dasm.c
b/linux/host_dasm.c
index
15597b4
..
66a83ea
100644
(file)
--- a/
linux/host_dasm.c
+++ b/
linux/host_dasm.c
@@
-27,11
+27,17
@@
static struct disassemble_info di;
#define BFD_ARCH bfd_arch_arm
#define BFD_MACH bfd_mach_arm_unknown
#define DASM_OPTS "reg-names-std"
#define BFD_ARCH bfd_arch_arm
#define BFD_MACH bfd_mach_arm_unknown
#define DASM_OPTS "reg-names-std"
-#el
se
+#el
if defined(__x86_64__) || defined(__i386__)
#define print_insn_func print_insn_i386_intel
#define BFD_ARCH bfd_arch_i386
#define print_insn_func print_insn_i386_intel
#define BFD_ARCH bfd_arch_i386
+#ifdef __x86_64__
+#define BFD_MACH bfd_mach_x86_64_intel_syntax
+#else
#define BFD_MACH bfd_mach_i386_i386_intel_syntax
#define BFD_MACH bfd_mach_i386_i386_intel_syntax
+#endif
#define DASM_OPTS NULL
#define DASM_OPTS NULL
+#else
+#error "missing arch support"
#endif
/* symbols */
#endif
/* symbols */
@@
-134,7
+140,7
@@
static int
dis_asm_read_memory(bfd_vma memaddr, bfd_byte *myaddr, unsigned int len,
struct disassemble_info *info)
{
dis_asm_read_memory(bfd_vma memaddr, bfd_byte *myaddr, unsigned int len,
struct disassemble_info *info)
{
- memcpy(myaddr, (void *)(
int
)memaddr, len);
+ memcpy(myaddr, (void *)(
long
)memaddr, len);
return 0;
}
return 0;
}
@@
-142,7
+148,7
@@
static void
dis_asm_memory_error(int status, bfd_vma memaddr,
struct disassemble_info *info)
{
dis_asm_memory_error(int status, bfd_vma memaddr,
struct disassemble_info *info)
{
- fprintf(stderr, "memory_error %p\n", (void *)(
int
)memaddr);
+ fprintf(stderr, "memory_error %p\n", (void *)(
long
)memaddr);
}
static void
}
static void