From patchwork Sat Dec 23 04:31:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 82786 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 672BD3858C50 for ; Sat, 23 Dec 2023 04:31:34 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 5DB423858C54 for ; Sat, 23 Dec 2023 04:31:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5DB423858C54 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5DB423858C54 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=140.211.166.183 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703305882; cv=none; b=ZVb2JGj4lpKM0cDMwbhsa29iddwMigPtOqE8W4gZ7vhjPRahaSs7bahlZVmeqh4sggdzILTyedloAqJw+3qawKEYAW3wUgtRl099yHEu8i60oracTEhpgfgs6fVGSKXCPGsVmyDn9TGOuAzOqlCtF7OhPERjN27rHdBImmHoUyQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703305882; c=relaxed/simple; bh=hz2rxhvLsgVskUe9P7Ohxfz7CtGmeQKViSbflZiSVwI=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=FosNGluT9ac2/U5O7cC4h4lGaqMUVsEyxYQHUYF0Rv4A0G+EKNdlsyzUU2ip5ks94CiIDcINwJk93VtUuccS5kCnLlEMzbt2sH40TLIltYzfZZtBrJzmiOHCQm4WcTJnQkh955KQvxdYpvVhPTLGqZiYRcosY3azXhYeiYIeYtE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 01F9933F9FD; Sat, 23 Dec 2023 04:31:20 +0000 (UTC) From: Mike Frysinger 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 Message-ID: <20231223043119.5878-1-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org 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 */