1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
diff --git a/Makefile b/Makefile
index a5ea0d7ab1ad..cfab982a991d 100644
--- a/Makefile
+++ b/Makefile
@@ -33,17 +33,11 @@ E9TOOL_OBJS=\
src/e9tool/e9tool.o \
src/e9tool/e9types.o \
src/e9tool/e9x86_64.o
-E9TOOL_LIBS=\
- contrib/zydis/libZydis.a \
- contrib/libdw/libdw.a
-E9TOOL_CXXFLAGS=\
- -I src/e9tool/ -Wno-unused-function \
- -I contrib/libdw/ \
- -I contrib/zydis/include/ \
- -I contrib/zydis/dependencies/zycore/include/
+E9TOOL_LIBS=
+E9TOOL_CXXFLAGS=-fPIE -I src/e9tool/ -Wno-unused-function
E9TOOL_LDFLAGS=\
-Wl,--dynamic-list=src/e9tool/e9tool.syms \
- -lpthread -ldl -lz
+ -lpthread -ldl -ldw -lz -lZydis
release: CXXFLAGS += -O2 -D NDEBUG
release: $(E9PATCH_OBJS)
diff --git a/src/e9tool/e9dwarf.cpp b/src/e9tool/e9dwarf.cpp
index 03afee65a091..183684d2293d 100644
--- a/src/e9tool/e9dwarf.cpp
+++ b/src/e9tool/e9dwarf.cpp
@@ -28,7 +28,7 @@
#include "e9misc.h"
#include "e9tool.h"
-#include "libdw.h"
+#include <elfutils/libdw.h>
using namespace e9tool;
diff --git a/src/e9tool/e9x86_64.cpp b/src/e9tool/e9x86_64.cpp
index 6a7f5cff3692..03eb3a41dd66 100644
--- a/src/e9tool/e9x86_64.cpp
+++ b/src/e9tool/e9x86_64.cpp
@@ -152,8 +152,7 @@ void e9tool::getInstrInfo(const ELF *elf, const Instr *I, InstrInfo *info,
ZydisDecodedOperand operands[ZYDIS_MAX_OPERAND_COUNT];
ZyanStatus result = ZydisDecoderDecodeFull(&decoder,
- elf->data + I->offset, I->size, D, operands, ZYDIS_MAX_OPERAND_COUNT,
- 0);
+ elf->data + I->offset, I->size, D, operands);
if (!ZYAN_SUCCESS(result) || I->size != D->length ||
D->operand_count > sizeof(info->op) / sizeof(info->op[0]))
error("failed to decompress instruction at address 0x%lx; decode "
@@ -336,7 +335,7 @@ void e9tool::getInstrInfo(const ELF *elf, const Instr *I, InstrInfo *info,
info->string.section = elf->strs + shdr->sh_name;
result = ZydisFormatterFormatInstruction(&formatter, D, operands,
D->operand_count_visible, info->string.instr,
- sizeof(info->string.instr)-1, I->address);
+ sizeof(info->string.instr)-1, I->address, ZYAN_NULL);
if (!ZYAN_SUCCESS(result))
error("failed to decompress instruction at address 0x%lx; "
"formatting failed", I->address);
|