* [PATCH] sim: arm: mark local read-only arrays as static const
@ 2023-12-23 4:31 Mike Frysinger
0 siblings, 0 replies; only message in thread
From: Mike Frysinger @ 2023-12-23 4:31 UTC (permalink / raw)
To: gdb-patches
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-12-23 4:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-23 4:31 [PATCH] sim: arm: mark local read-only arrays as static const Mike Frysinger
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).