forked from gsmk/hexagon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gnutools.patch
89 lines (83 loc) · 2.49 KB
/
gnutools.patch
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
diff --git a/opcodes/hexagon-dis.c b/opcodes/hexagon-dis.c
index 73e0bf6..9e4fa22 100644
--- a/opcodes/hexagon-dis.c
+++ b/opcodes/hexagon-dis.c
@@ -79,19 +79,6 @@ hexagon_decode_inst(
int bytes;
char *str;
- /* Decide if we have a 16-bit instruction */
- status = (*info->read_memory_func)(address, buffer, 2, info);
- if (status != 0) {
- (*info->memory_error_func)(status, address, info);
- return -1;
- }
- if (info->endian == BFD_ENDIAN_LITTLE) {
- insn = bfd_getl16(buffer);
- }
- else {
- insn = bfd_getb16(buffer);
- }
-
status = (*info->read_memory_func)(address, buffer, 4, info);
if (status != 0) {
(*info->memory_error_func)(status, address, info);
@@ -107,14 +94,14 @@ hexagon_decode_inst(
/* disassemble */
bytes = hexagon_dis_inst(address, insn, instrBuffer, info);
- /* display the disassembly instruction */
- if (bytes == 2) {
- (*func) (stream, " %04x ", insn);
- }
- else {
- (*func) (stream, "%08x ", insn);
- }
- (*func) (stream, " ");
+///* display the disassembly instruction */
+//if (bytes == 2) {
+// (*func) (stream, " %04x ", insn);
+//}
+//else {
+// (*func) (stream, "%08x ", insn);
+//}
+//(*func) (stream, " ");
/* Print the instruction buffer
Watch out for placeholders where we want
diff --git a/opcodes/hexagon-opc.c b/opcodes/hexagon-opc.c
index a49f709..80b0c89 100644
--- a/opcodes/hexagon-opc.c
+++ b/opcodes/hexagon-opc.c
@@ -994,13 +994,25 @@ size_t hexagon_opcodes_count;
(char *i, size_t n, const hexagon_operand_arg args [])
#define MAP_FUNCTION(TAG) HEXAGON_MAP_SIGN (TAG); \
HEXAGON_MAP_SIGN (TAG)
+
+#define HEXAGON_MAP_FPTR(TAG) ((void*)&HEXAGON_MAP_FNAME(TAG))
+
#define DEST (i), (n)
#define GET_OP_VAL(N) ((int) args [N].value)
#define GET_OP_STR(N) (args [N].string [0] == '#' \
? args [N].string + 1 \
: args [N].string)
+#undef sprintf
+
+#ifdef _WIN32
+#define strncasecmp _strnicmp
+#define strcasecmp _stricmp
+#define alloca _alloca
+#define snprintf _snprintf
+#endif
+
+#define sprintf(buf, len, fmt, ...) snprintf(buf, len, fmt, ##__VA_ARGS__)
-#define sprintf snprintf
# include "opcode/hexagon_asm_maps.h"
#undef sprintf
@@ -2009,7 +2021,9 @@ hexagon_reg_num
continue;
*input = regs + len - (*name? 1: 0);
- return ((int) (aliasn? *aliasn = i: i), (int) regn);
+ if (aliasn)
+ *aliasn = i;
+ return (int)regn;
}
}
}