Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp3376937rwl; Tue, 27 Dec 2022 08:15:36 -0800 (PST) X-Google-Smtp-Source: AMrXdXseWW01L5PKfPVgAqCWweRjwOwNUYEwZuFJiqfSdK7GrMZYWkxX8NzRtzwtP83xiOGqDpNk X-Received: by 2002:aa7:9af2:0:b0:581:6e02:eac4 with SMTP id y18-20020aa79af2000000b005816e02eac4mr2859053pfp.2.1672157736542; Tue, 27 Dec 2022 08:15:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672157736; cv=none; d=google.com; s=arc-20160816; b=KxVEoMZXd7RDP7Xg7tHSzrgaV60aG0QlgwaG2l4lTYXcs56RgPFLf4c1Ey7pB/YPu1 Ui8MO1MqfdjIhSoQjDI9KOEV2QOHX/O+/WyjAOGLXkdoJfTHHcI7JL3PBMeaPJh1IMb5 uU6samNEyA8mqdaip/vtMwMoauuyLUcG2l1TR/nJdRk/pCsTVs3n/iAy6AQGGH+k2R8N yA5k/1Rjq378QNVLpdgcEUF4ftcmLfAVcmtIdO6u1KMn+AV0ks5d80+WmisAhZLG/XqB FXYL2VQPqtkxHzFQQcpON87w/Y87Sm8QevxTfVNAmheO5Fj8HfawOPilTkj+LuR7XWuE 8mGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:dkim-signature :from; bh=irGSZxAY2cdOFc6Vynua5gcKzft4ZHpusIPnmXjhBuU=; b=jd2k2gOKoA45zt17j/Z1W5zHyvIKTW3erhozGFHEgP8ozXxCe0UnkuIU9C5hmSlmZ+ oabPGcDQ3PtfoZN4I5L0QK4tI2nTVeygg7K4vMR9MivJdgOiUbn2WK3UL6hJcXWrfkeo RHpbnHMpdR5Tapxh1r2bvZYwgF4ns2NOxIJ+ehjGE8GnWhUJKgqfdlmDowYIIYPn/Nyl xVHXHy7UvEUV7iaoNoTyWxA56cIAPylRqnK0TNW9B4rBkumEyA6yiVf6S273NI6+9N1o CX6HUE8R8cNKdLh3jhtswrKIDiPFR1cONBXrU/Altpn1b9iUK26bdQli3GqVH/QGFqYM BFAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@weissschuh.net header.s=mail header.b="NryKx8/W"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cn15-20020a056a00340f00b0057555579113si14006530pfb.316.2022.12.27.08.15.27; Tue, 27 Dec 2022 08:15:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@weissschuh.net header.s=mail header.b="NryKx8/W"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231630AbiL0QCw (ORCPT + 67 others); Tue, 27 Dec 2022 11:02:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229736AbiL0QCs (ORCPT ); Tue, 27 Dec 2022 11:02:48 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3104EA9 for ; Tue, 27 Dec 2022 08:02:46 -0800 (PST) From: Thomas =?utf-8?q?Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1672156964; bh=kT8j13gOnAKWYlSV+YMQw4TiVnvJKl0cCOa21YM32M0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=NryKx8/WX4EttN2Wi7A01V/T+QeFOxPEcOYewudl8K5pU06HrP1jzw1Q1U/9g/UnF BaS2e9pdkU0JrXbUgolwwWI9nN4ODSobyrqO+IQk5DABU29VMAviScn9H34JGMgyX1 B3iiNyzM33rdyzepT8vFzQdaHGMxvMGu6CH7arxU= Date: Tue, 27 Dec 2022 16:00:57 +0000 Subject: [PATCH v2 1/8] objtool: make struct entries[] static and const MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-Id: <20221216-objtool-memory-v2-1-17968f85a464@weissschuh.net> References: <20221216-objtool-memory-v2-0-17968f85a464@weissschuh.net> In-Reply-To: <20221216-objtool-memory-v2-0-17968f85a464@weissschuh.net> To: Josh Poimboeuf , Peter Zijlstra Cc: linux-kernel@vger.kernel.org, Thomas =?utf-8?q?Wei=C3=9Fschuh?= X-Mailer: b4 0.11.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1672156865; l=1357; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=kT8j13gOnAKWYlSV+YMQw4TiVnvJKl0cCOa21YM32M0=; b=KVBj9VZ9YQSV25Jq2t8yb7ci7FBwnt5YjyakqphuIDIRCP6beV5l2wrS/0h8KA8/9ibZai5PYDGO 8HfVrMblAEPjhqpksBwKtiEl3VZG0yIzdaDrrLGbQJkoy4ZiEGjG X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This data is not modified and not used outside of special.c. Also adapt its users to the constness. Signed-off-by: Thomas Weißschuh --- tools/objtool/special.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/objtool/special.c b/tools/objtool/special.c index 9c8d827f69af..baa85c31526b 100644 --- a/tools/objtool/special.c +++ b/tools/objtool/special.c @@ -26,7 +26,7 @@ struct special_entry { unsigned char key; /* jump_label key */ }; -struct special_entry entries[] = { +static const struct special_entry entries[] = { { .sec = ".altinstructions", .group = true, @@ -65,7 +65,7 @@ static void reloc_to_sec_off(struct reloc *reloc, struct section **sec, *off = reloc->sym->offset + reloc->addend; } -static int get_alt_entry(struct elf *elf, struct special_entry *entry, +static int get_alt_entry(struct elf *elf, const struct special_entry *entry, struct section *sec, int idx, struct special_alt *alt) { @@ -139,7 +139,7 @@ static int get_alt_entry(struct elf *elf, struct special_entry *entry, */ int special_get_alts(struct elf *elf, struct list_head *alts) { - struct special_entry *entry; + const struct special_entry *entry; struct section *sec; unsigned int nr_entries; struct special_alt *alt; -- 2.39.0