changeset 8716:bbd1da3f538f

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
author dbuck
date Wed, 01 Aug 2018 04:19:22 -0400
parents 9a18c71dbd25
children f3108e56b502
files src/share/tools/hsdis/README src/share/tools/hsdis/hsdis.c
diffstat 2 files changed, 19 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/tools/hsdis/README	Wed Aug 01 04:15:43 2018 -0400
+++ b/src/share/tools/hsdis/README	Wed Aug 01 04:19:22 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/share/tools/hsdis/hsdis.c	Wed Aug 01 04:15:43 2018 -0400
+++ b/src/share/tools/hsdis/hsdis.c	Wed Aug 01 04:19:22 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -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
@@ -334,7 +337,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;