summaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2017-10-25 21:59:14 +1030
committerAlan Modra <amodra@gmail.com>2017-10-25 22:14:58 +1030
commite5d70d6b5a5c2832ad199ac1b91f68324b4a12c9 (patch)
tree1d81154693c5ac8086c05b89a519a6ae5807e490 /opcodes
parentcc628f3dbb12c720dbc9ab714feeb197dc739944 (diff)
downloadbinutils-gdb-e5d70d6b5a5c2832ad199ac1b91f68324b4a12c9.tar.gz
PR22348, conflicting global vars in crx and cr16
include/ PR 22348 * opcode/cr16.h (instruction): Delete. (cr16_words, cr16_allWords, cr16_currInsn): Delete. * opcode/crx.h (crx_cst4_map): Rename from cst4_map. (crx_cst4_maps): Rename from cst4_maps. (crx_no_op_insn): Rename from no_op_insn. (instruction): Delete. opcodes/ PR 22348 * cr16-dis.c (cr16_cinvs, instruction, cr16_currInsn): Make static. (cr16_words, cr16_allWords, processing_argument_number): Likewise. (imm4flag, size_changed): Likewise. * crx-dis.c (crx_cinvs, NUMCINVS, instruction, currInsn): Likewise. (words, allWords, processing_argument_number): Likewise. (cst4flag, size_changed): Likewise. * crx-opc.c (crx_cst4_map): Rename from cst4_map. (crx_cst4_maps): Rename from cst4_maps. (crx_no_op_insn): Rename from no_op_insn. gas/ PR 22348 * config/tc-crx.c (instruction, output_opcode): Make static. (relocatable, ins_parse, cur_arg_num): Likewise. (parse_insn): Adjust for renamed opcodes globals. (check_range): Likewise
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog13
-rw-r--r--opcodes/cr16-dis.c16
-rw-r--r--opcodes/crx-dis.c18
-rw-r--r--opcodes/crx-opc.c6
4 files changed, 33 insertions, 20 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 89ab194b8a5..c543655f004 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,16 @@
+2017-10-25 Alan Modra <amodra@gmail.com>
+
+ PR 22348
+ * cr16-dis.c (cr16_cinvs, instruction, cr16_currInsn): Make static.
+ (cr16_words, cr16_allWords, processing_argument_number): Likewise.
+ (imm4flag, size_changed): Likewise.
+ * crx-dis.c (crx_cinvs, NUMCINVS, instruction, currInsn): Likewise.
+ (words, allWords, processing_argument_number): Likewise.
+ (cst4flag, size_changed): Likewise.
+ * crx-opc.c (crx_cst4_map): Rename from cst4_map.
+ (crx_cst4_maps): Rename from cst4_maps.
+ (crx_no_op_insn): Rename from no_op_insn.
+
2017-10-24 Andrew Waterman <andrew@sifive.com>
* riscv-opc.c (match_c_addi16sp) : New function.
diff --git a/opcodes/cr16-dis.c b/opcodes/cr16-dis.c
index 16385c35c94..4a3f3b7833e 100644
--- a/opcodes/cr16-dis.c
+++ b/opcodes/cr16-dis.c
@@ -54,7 +54,7 @@ typedef struct
cinv_entry;
/* CR16 'cinv' options mapping. */
-const cinv_entry cr16_cinvs[] =
+static const cinv_entry cr16_cinvs[] =
{
{"cinv[i]", "cinv [i]"},
{"cinv[i,u]", "cinv [i,u]"},
@@ -78,20 +78,20 @@ typedef enum REG_ARG_TYPE
REG_ARG_TYPE;
/* Current opcode table entry we're disassembling. */
-const inst *instruction;
+static const inst *instruction;
/* Current instruction we're disassembling. */
-ins cr16_currInsn;
+static ins cr16_currInsn;
/* The current instruction is read into 3 consecutive words. */
-wordU cr16_words[3];
+static wordU cr16_words[3];
/* Contains all words in appropriate order. */
-ULONGLONG cr16_allWords;
+static ULONGLONG cr16_allWords;
/* Holds the current processed argument number. */
-int processing_argument_number;
+static int processing_argument_number;
/* Nonzero means a IMM4 instruction. */
-int imm4flag;
+static int imm4flag;
/* Nonzero means the instruction's original size is
incremented (escape sequence is used). */
-int size_changed;
+static int size_changed;
/* Print the constant expression length. */
diff --git a/opcodes/crx-dis.c b/opcodes/crx-dis.c
index 4e48668f68c..cb0f08025ba 100644
--- a/opcodes/crx-dis.c
+++ b/opcodes/crx-dis.c
@@ -58,7 +58,7 @@ typedef struct
cinv_entry;
/* CRX 'cinv' options. */
-const cinv_entry crx_cinvs[] =
+static const cinv_entry crx_cinvs[] =
{
{"[i]", 2}, {"[i,u]", 3}, {"[d]", 4}, {"[d,u]", 5},
{"[d,i]", 6}, {"[d,i,u]", 7}, {"[b]", 8},
@@ -81,22 +81,22 @@ typedef enum REG_ARG_TYPE
REG_ARG_TYPE;
/* Number of valid 'cinv' instruction options. */
-int NUMCINVS = ((sizeof crx_cinvs)/(sizeof crx_cinvs[0]));
+static int NUMCINVS = ((sizeof crx_cinvs)/(sizeof crx_cinvs[0]));
/* Current opcode table entry we're disassembling. */
-const inst *instruction;
+static const inst *instruction;
/* Current instruction we're disassembling. */
-ins currInsn;
+static ins currInsn;
/* The current instruction is read into 3 consecutive words. */
-wordU words[3];
+static wordU words[3];
/* Contains all words in appropriate order. */
-ULONGLONG allWords;
+static ULONGLONG allWords;
/* Holds the current processed argument number. */
-int processing_argument_number;
+static int processing_argument_number;
/* Nonzero means a CST4 instruction. */
-int cst4flag;
+static int cst4flag;
/* Nonzero means the instruction's original size is
incremented (escape sequence is used). */
-int size_changed;
+static int size_changed;
static int get_number_of_operands (void);
static argtype getargtype (operand_type);
diff --git a/opcodes/crx-opc.c b/opcodes/crx-opc.c
index f6f2da669f3..05b661da9d0 100644
--- a/opcodes/crx-opc.c
+++ b/opcodes/crx-opc.c
@@ -704,15 +704,15 @@ The value in entry <N> is mapped to the value <N>
Example (for N=5):
cst4_map[5]=-4 -->> 5 */
-const int cst4_map[] =
+const int crx_cst4_map[] =
{
0, 1, 2, 3, 4, -4, -1, 7, 8, 16, 32, 20, 12, 48
};
-const int cst4_maps = ARRAY_SIZE (cst4_map);
+const int crx_cst4_maps = ARRAY_SIZE (crx_cst4_map);
/* CRX instructions that don't have arguments. */
-const char* no_op_insn[] =
+const char* crx_no_op_insn[] =
{
"di", "ei", "eiwait", "nop", "retx", "wait", NULL
};