public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] opcodes: constify aarch64_opcode_tables
@ 2021-06-27  5:45 Mike Frysinger
  2021-07-01 10:05 ` Nick Clifton
  0 siblings, 1 reply; 2+ messages in thread
From: Mike Frysinger @ 2021-06-27  5:45 UTC (permalink / raw)
  To: binutils

This table is huge (~350k), so stop putting it into writable .data
since it's only const data.
---
 gas/config/tc-aarch64.c  | 6 +++---
 include/opcode/aarch64.h | 2 +-
 opcodes/aarch64-gen.c    | 2 +-
 opcodes/aarch64-tbl.h    | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c
index 9ff2d6803dd1..2eaad63a9fa3 100644
--- a/gas/config/tc-aarch64.c
+++ b/gas/config/tc-aarch64.c
@@ -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)
     {
diff --git a/include/opcode/aarch64.h b/include/opcode/aarch64.h
index f43df79d7c5a..2bbd593c36ec 100644
--- a/include/opcode/aarch64.h
+++ b/include/opcode/aarch64.h
@@ -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)
diff --git a/opcodes/aarch64-gen.c b/opcodes/aarch64-gen.c
index 356c5efcf3c3..d0581bcf6e1b 100644
--- a/opcodes/aarch64-gen.c
+++ b/opcodes/aarch64-gen.c
@@ -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.  */
diff --git a/opcodes/aarch64-tbl.h b/opcodes/aarch64-tbl.h
index 4192e54d1883..17ea851c7137 100644
--- a/opcodes/aarch64-tbl.h
+++ b/opcodes/aarch64-tbl.h
@@ -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),
-- 
2.31.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] opcodes: constify aarch64_opcode_tables
  2021-06-27  5:45 [PATCH] opcodes: constify aarch64_opcode_tables Mike Frysinger
@ 2021-07-01 10:05 ` Nick Clifton
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Clifton @ 2021-07-01 10:05 UTC (permalink / raw)
  To: Mike Frysinger, binutils

Hi Mike,

> This table is huge (~350k), so stop putting it into writable .data
> since it's only const data.

Patch approved - please apply, with ChangeLog entries.  (We still need
them until the 2,37 branch is cut).

Cheers
   Nick


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-01 10:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-27  5:45 [PATCH] opcodes: constify aarch64_opcode_tables Mike Frysinger
2021-07-01 10:05 ` Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).