From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Subject: [PATCH] sim: arm: mark local read-only arrays as static const
Date: Fri, 22 Dec 2023 23:31:19 -0500 [thread overview]
Message-ID: <20231223043119.5878-1-vapier@gentoo.org> (raw)
Move it into read-only data sections to avoid constructing them on the
stack at runtime.
---
sim/arm/thumbemu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sim/arm/thumbemu.c b/sim/arm/thumbemu.c
index 58a9c85ce2b9..a26a404fdf5c 100644
--- a/sim/arm/thumbemu.c
+++ b/sim/arm/thumbemu.c
@@ -2135,7 +2135,7 @@ ARMul_ThumbDecode (ARMul_State * state,
ARMword opcode;
enum { t_norm, t_shift, t_neg, t_mul } otype;
};
- struct insn_format subset[16] =
+ static const struct insn_format subset[16] =
{
{ 0xE0100000, t_norm}, /* ANDS Rd,Rd,Rs */
{ 0xE0300000, t_norm}, /* EORS Rd,Rd,Rs */
@@ -2158,7 +2158,7 @@ ARMul_ThumbDecode (ARMul_State * state,
if (in_IT_block ())
{
- struct insn_format it_subset[16] =
+ static const struct insn_format it_subset[16] =
{
{ 0xE0000000, t_norm}, /* AND Rd,Rd,Rs */
{ 0xE0200000, t_norm}, /* EOR Rd,Rd,Rs */
--
2.43.0
reply other threads:[~2023-12-23 4:31 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231223043119.5878-1-vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).