Use new compiler toolchain's disassembler
authorAndrew Waterman <waterman@s144.Millennium.Berkeley.EDU>
Fri, 11 Nov 2011 12:36:37 +0000 (04:36 -0800)
committerAndrew Waterman <waterman@s144.Millennium.Berkeley.EDU>
Fri, 11 Nov 2011 12:36:37 +0000 (04:36 -0800)
configure
riscv/processor.cc
riscv/riscv.ac

index 2f6054138d3d76470faad59a24780b50707ec2fa..3426081f65c0e0f0ad36f7b113023733ced15250 100755 (executable)
--- a/configure
+++ b/configure
@@ -4076,7 +4076,7 @@ $as_echo "#define RISCV_ENABLE_VEC /**/" >>confdefs.h
 
 fi
 
-libopc=`dirname \`which riscv-gcc\``/../`$ac_config_guess`/riscv/lib/libopcodes.a
+libopc=`dirname \`which riscv-gcc\``/../`$ac_config_guess`/riscv-elf/lib/libopcodes.a
 as_ac_File=`$as_echo "ac_cv_file_$libopc" | $as_tr_sh`
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $libopc" >&5
 $as_echo_n "checking for $libopc... " >&6; }
index cce526bc74407d0abafa975be1251ba5fe8dfe26..385e329d8bce3e91a61512d8a13914d0567cf0ef 100644 (file)
@@ -221,6 +221,8 @@ void processor_t::deliver_ipi()
   run = true;
 }
 
+extern "C" int print_insn_little_riscv(bfd_vma, disassemble_info*);
+
 void processor_t::disasm(insn_t insn, reg_t pc)
 {
   printf("core %3d: 0x%016llx (0x%08x) ",id,(unsigned long long)pc,insn.bits);
@@ -229,14 +231,14 @@ void processor_t::disasm(insn_t insn, reg_t pc)
   disassemble_info info;
   INIT_DISASSEMBLE_INFO(info, stdout, fprintf);
   info.flavour = bfd_target_unknown_flavour;
-  info.arch = bfd_arch_mips;
-  info.mach = 101; // XXX bfd_mach_mips_riscv requires modified bfd.h
+  info.arch = bfd_architecture(25); // bfd_arch_riscv
+  info.mach = 164; // bfd_mach_riscv_rocket64
   info.endian = BFD_ENDIAN_LITTLE;
   info.buffer = (bfd_byte*)&insn;
   info.buffer_length = sizeof(insn);
   info.buffer_vma = pc;
 
-  int ret = print_insn_little_mips(pc, &info);
+  int ret = print_insn_little_riscv(pc, &info);
   assert(ret == insn_length(insn.bits));
   #else
   printf("unknown");
index 2919277e47e8d26060427b100b1357e6c137ff49..636a8c401f21b9cafe6b8caa7fc473333a99aed5 100644 (file)
@@ -18,7 +18,7 @@ AS_IF([test "x$enable_vec" != "xno"], [
   AC_DEFINE([RISCV_ENABLE_VEC],,[Define if vector processor is supported])
 ])
 
-libopc=`dirname \`which riscv-gcc\``/../`$ac_config_guess`/riscv/lib/libopcodes.a
+libopc=`dirname \`which riscv-gcc\``/../`$ac_config_guess`/riscv-elf/lib/libopcodes.a
 AC_CHECK_FILES([$libopc],[have_libopcodes="yes"],[have_libopcodes="no"])
 
 libbfd="/opt/local/lib/libbfd.dylib"