]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
opcodes: constify aarch64_opcode_tables
authorMike Frysinger <vapier@gentoo.org>
Sun, 27 Jun 2021 05:37:24 +0000 (01:37 -0400)
committerMike Frysinger <vapier@gentoo.org>
Thu, 1 Jul 2021 21:51:00 +0000 (17:51 -0400)
This table is huge (~350k), so stop putting it into writable .data
since it's only const data.

gas/ChangeLog
gas/config/tc-aarch64.c
include/ChangeLog
include/opcode/aarch64.h
opcodes/ChangeLog
opcodes/aarch64-gen.c
opcodes/aarch64-tbl.h

index 1b318559212c8662ac7f2caa9d982ad60175d774..9ad388e5a52e8defc72ad2c186ee6ae6c8dfa8a5 100644 (file)
@@ -1,3 +1,9 @@
+2021-07-01  Mike Frysinger  <vapier@gentoo.org>
+
+       * config/tc-aarch64.c (struct templates): Make opcode const.
+       (md_assemble): Likewise.
+       (fill_instruction_hash_table): Likewise.
+
 2021-06-24  ClĂ©ment Chigot  <clement.chigot@atos.net>
 
        * config/tc-ppc.c (md_assemble): Update ppc_current_csect
index 9ff2d6803dd1972ffd03178f8bb4633d263c2a36..2eaad63a9fa37f1b3dfa37e2f56e845631b91d60 100644 (file)
@@ -5214,7 +5214,7 @@ output_inst (struct aarch64_inst *new_inst)
 
 struct templates
 {
-  aarch64_opcode *opcode;
+  const aarch64_opcode *opcode;
   struct templates *next;
 };
 
@@ -7272,7 +7272,7 @@ md_assemble (char *str)
 {
   char *p = str;
   templates *template;
-  aarch64_opcode *opcode;
+  const aarch64_opcode *opcode;
   aarch64_inst *inst_base;
   unsigned saved_cond;
 
@@ -8768,7 +8768,7 @@ sysreg_hash_insert (htab_t table, const char *key, void *value)
 static void
 fill_instruction_hash_table (void)
 {
-  aarch64_opcode *opcode = aarch64_opcode_table;
+  const aarch64_opcode *opcode = aarch64_opcode_table;
 
   while (opcode->name != NULL)
     {
index 06bc4c5d59b791f8dfb52da23edca71a12902c31..d8d6067232750a9b649ceb4e97d7b80d45961d0b 100644 (file)
@@ -1,3 +1,7 @@
+2021-07-01  Mike Frysinger  <vapier@gentoo.org>
+
+       * opcode/aarch64.h (aarch64_opcode_table): Mark const.
+
 2021-07-01  Richard Earnshaw  <rearnsha@arm.com>
 
        PR gas/28031
index f43df79d7c5aaa68ddf9b8f0590a7d49b04b11ea..2bbd593c36ec4f21cddb62b7d400ee87d2a797d3 100644 (file)
@@ -826,7 +826,7 @@ struct aarch64_opcode
 typedef struct aarch64_opcode aarch64_opcode;
 
 /* Table describing all the AArch64 opcodes.  */
-extern aarch64_opcode aarch64_opcode_table[];
+extern const aarch64_opcode aarch64_opcode_table[];
 
 /* Opcode flags.  */
 #define F_ALIAS (1 << 0)
index 20e0524a1bf1d67f15010bd260d389e844646d5e..de90ac57ef78d2a33fb59268752ca0b4a29818f2 100644 (file)
@@ -1,3 +1,8 @@
+2021-07-01  Mike Frysinger  <vapier@gentoo.org>
+
+       * aarch64-gen.c (aarch64_opcode_table): Add const.
+       * aarch64-tbl.h (aarch64_opcode_table): Likewise.
+
 2021-06-22  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * cgen-dis.c (count_decodable_bits): Use __builtin_popcount when
 2021-03-29  Jan Beulich  <jbeulich@suse.com>
 
        * i386-gen.c (process_i386_opcode_modifier): New parameter
-       "space". 
+       "space".
        (output_i386_opcode): New local variable "space". Adjust
        process_i386_opcode_modifier() invocation.
        (process_i386_opcodes): Adjust process_i386_opcode_modifier()
index 356c5efcf3c30f94bac0f6ebd2e79e4e27db6e1a..d0581bcf6e1b728c3683eaaeaf42565ce8027e4c 100644 (file)
@@ -84,7 +84,7 @@ new_opcode_node (void)
    'aarch64_opcode_table' hard-coded in, e.g. print_find_next_opcode;
    therefore some amount of work needs to be done if the full support
    for multiple tables needs to be enabled.  */
-static const struct aarch64_opcode *aarch64_opcode_tables[] =
+static const struct aarch64_opcode * const aarch64_opcode_tables[] =
 {aarch64_opcode_table};
 
 /* Use top 2 bits to indiate which table.  */
index 4192e54d188357bfd16cb7915f3f8d47fdc34cfd..17ea851c7137665823a7b24a650285781b5da0db 100644 (file)
@@ -2584,7 +2584,7 @@ static const aarch64_feature_set aarch64_feature_flagm =
 #define FLAGM_INSN(NAME,OPCODE,MASK,CLASS,OPS,QUALS,FLAGS) \
   { NAME, OPCODE, MASK, CLASS, 0, FLAGM, OPS, QUALS, FLAGS, 0, 0, NULL }
 
-struct aarch64_opcode aarch64_opcode_table[] =
+const struct aarch64_opcode aarch64_opcode_table[] =
 {
   /* Add/subtract (with carry).  */
   CORE_INSN ("adc",  0x1a000000, 0x7fe0fc00, addsub_carry, 0, OP3 (Rd, Rn, Rm), QL_I3SAMER, F_SF),