提交 22829190 编写于 作者: D dbuck

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
上级 8982e04e
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. DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
The Universal Permissive License (UPL), Version 1.0 The Universal Permissive License (UPL), Version 1.0
...@@ -54,11 +54,12 @@ you do not have a version that is new enough. ...@@ -54,11 +54,12 @@ you do not have a version that is new enough.
* Building * Building
To build this project you a copy of GNU binutils to build against. It To build this project you need a copy of GNU binutils to build against.
is known to work with binutils 2.17 and binutils 2.19.1. Download a 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 copy of the software from http://directory.fsf.org/project/binutils or
one of it's mirrors. Builds targetting windows should use at least one of its mirrors. Builds targetting windows currently require the
2.19 and currently requires the use of a cross compiler. use of a cross compiler.
Binutils should be configured with the '--disable-nls' flag to disable Binutils should be configured with the '--disable-nls' flag to disable
Native Language Support, otherwise you might get an "undefined 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 ...@@ -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 the makefile what prefix to use to find the mingw tools by using
MINGW=. For example: 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 * Installing
......
/* /*
* 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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* The Universal Permissive License (UPL), Version 1.0 * The Universal Permissive License (UPL), Version 1.0
...@@ -50,12 +50,15 @@ ...@@ -50,12 +50,15 @@
*/ */
#include <config.h> /* required by bfd.h */ #include <config.h> /* required by bfd.h */
#include <errno.h>
#include <inttypes.h>
#include <string.h>
#include <libiberty.h> #include <libiberty.h>
#include <bfd.h> #include <bfd.h>
#include <bfdver.h>
#include <dis-asm.h> #include <dis-asm.h>
#include <inttypes.h>
#include <string.h>
#include <errno.h>
#include "hsdis.h" #include "hsdis.h"
#ifndef bool #ifndef bool
...@@ -334,7 +337,10 @@ static void setup_app_data(struct hsdis_app_data* app_data, ...@@ -334,7 +337,10 @@ static void setup_app_data(struct hsdis_app_data* app_data,
/* Finish linking together the various callback blocks. */ /* Finish linking together the various callback blocks. */
app_data->dinfo.application_data = (void*) app_data; 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.print_address_func = hsdis_print_address_func;
app_data->dinfo.read_memory_func = hsdis_read_memory_func; app_data->dinfo.read_memory_func = hsdis_read_memory_func;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册