8191006: hsdis disassembler plugin does not compile with binutils 2.29+
authordbuck
Wed, 01 Aug 2018 02:21:02 -0400
changeset 51273 5064f30ac015
parent 51272 9d92ff04a29c
child 51274 24904e14794b
8191006: hsdis disassembler plugin does not compile with binutils 2.29+ Summary: update call to disassembler() function to match new signature used by Binutils Reviewed-by: gromero, kvn
src/utils/hsdis/README
src/utils/hsdis/hsdis.c
--- a/src/utils/hsdis/README	Wed Aug 01 13:35:08 2018 +0800
+++ b/src/utils/hsdis/README	Wed Aug 01 02:21:02 2018 -0400
@@ -1,4 +1,4 @@
-Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   
 The Universal Permissive License (UPL), Version 1.0
@@ -54,11 +54,12 @@
 
 * Building
 
-To build this project you a copy of GNU binutils to build against.  It
-is known to work with binutils 2.17 and binutils 2.19.1.  Download a
+To build this project you need a copy of GNU binutils to build against.
+It is known to work with binutils 2.29.1, 2.30, and 2.31.1. Building
+against versions older than 2.29 is no longer supported. Download a
 copy of the software from http://directory.fsf.org/project/binutils or
-one of it's mirrors.  Builds targetting windows should use at least
-2.19 and currently requires the use of a cross compiler.
+one of its mirrors.  Builds targetting windows currently require the
+use of a cross compiler.
 
 Binutils should be configured with the '--disable-nls' flag to disable
 Native Language Support, otherwise you might get an "undefined
@@ -107,9 +108,9 @@
 the makefile what prefix to use to find the mingw tools by using
 MINGW=.  For example:
 
-make MINGW=i586-mingw32msvc BINTUILS=build/binutils-2.19.1
+make MINGW=i586-mingw32msvc BINUTILS=build/binutils-2.31.1
 
-will build the Win32 cross compiled version of hsdis based on 2.19.1.
+will build the Win32 cross compiled version of hsdis based on 2.31.1.
 
 * Installing
 
--- a/src/utils/hsdis/hsdis.c	Wed Aug 01 13:35:08 2018 +0800
+++ b/src/utils/hsdis/hsdis.c	Wed Aug 01 02:21:02 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * The Universal Permissive License (UPL), Version 1.0
@@ -50,12 +50,15 @@
 */
 
 #include <config.h> /* required by bfd.h */
+#include <errno.h>
+#include <inttypes.h>
+#include <string.h>
+
 #include <libiberty.h>
 #include <bfd.h>
+#include <bfdver.h>
 #include <dis-asm.h>
-#include <inttypes.h>
-#include <string.h>
-#include <errno.h>
+
 #include "hsdis.h"
 
 #ifndef bool
@@ -335,7 +338,10 @@
 
   /* Finish linking together the various callback blocks. */
   app_data->dinfo.application_data = (void*) app_data;
-  app_data->dfn = disassembler(native_bfd);
+  app_data->dfn = disassembler(bfd_get_arch(native_bfd),
+                               bfd_big_endian(native_bfd),
+                               bfd_get_mach(native_bfd),
+                               native_bfd);
   app_data->dinfo.print_address_func = hsdis_print_address_func;
   app_data->dinfo.read_memory_func = hsdis_read_memory_func;