From 2282919075cbebd4c555b02bea05672f20b4d478 Mon Sep 17 00:00:00 2001 From: dbuck Date: Wed, 1 Aug 2018 04:19:22 -0400 Subject: [PATCH] 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/share/tools/hsdis/README | 15 ++++++++------- src/share/tools/hsdis/hsdis.c | 16 +++++++++++----- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/share/tools/hsdis/README b/src/share/tools/hsdis/README index 0bc8c75b7..2addff60d 100644 --- a/src/share/tools/hsdis/README +++ b/src/share/tools/hsdis/README @@ -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 @@ you do not have a version that is new enough. * 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 @@ your path named i586-mingw32msvc-gcc or x86_64-pc-mingw32-gcc. Tell 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 diff --git a/src/share/tools/hsdis/hsdis.c b/src/share/tools/hsdis/hsdis.c index 00e43be4b..430de855b 100644 --- a/src/share/tools/hsdis/hsdis.c +++ b/src/share/tools/hsdis/hsdis.c @@ -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 /* required by bfd.h */ +#include +#include +#include + #include #include +#include #include -#include -#include -#include + #include "hsdis.h" #ifndef bool @@ -334,7 +337,10 @@ static void setup_app_data(struct hsdis_app_data* app_data, /* 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; -- GitLab