| Message ID | 20260401110928.4012089-1-bfilipov@amd.com |
|---|---|
| State | New |
| Headers |
Return-Path: <binutils-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id AB8BC4B9DB69 for <patchwork@sourceware.org>; Wed, 1 Apr 2026 11:10:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AB8BC4B9DB69 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=eAgViwMn X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from PH0PR06CU001.outbound.protection.outlook.com (mail-westus3azon11011008.outbound.protection.outlook.com [40.107.208.8]) by sourceware.org (Postfix) with ESMTPS id 254054BA23C4 for <binutils@sourceware.org>; Wed, 1 Apr 2026 11:09:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 254054BA23C4 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=amd.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 254054BA23C4 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.208.8 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1775041793; cv=pass; b=CH8RRbJChVKbY2yDPfpRowBciTUQhCWhgIYiRJPPnd51EkejFwmgc1FC/DYYw6gBs+Ll+rRe8BjVnMcblvBheR3SJEm6oboDqHTsQHOPLpRJrNeHCeYG2+JF2eRtqhZ7tN2tSVLF0Du19UiLaDhbA4skgNr0cVAWJUOxBzqcZbg= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1775041793; c=relaxed/simple; bh=npmgcFXz5mDKOzrDeLUrlsyfVDeg7ZdlYic4PC8NfPY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=sMFICllwNKetVa97hVzMUyQt28ygNsmXd+xsFXYf6l1FtwXqI3hh9EkBlD75rVpW/K+nMW05hF2w1NDB+reDfe8Sm8elTBjrFTFaxjijb3oCRCrHao9Zaj79gotX3ATKL5gxDjf+LR4lzDoGRcZkltuw12fHmgHDJf6KSORy+6U= ARC-Authentication-Results: i=2; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 254054BA23C4 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=E0Srx+xcK0omP49CJ0ZiZNnV7+l/KTiApzTa74ZrYxu4tKHYuJZmuFbV/8zdAIXFQoOFHOBsnvDDFRyg5CUfpBsww0Zh2z43MdWCZ8Z6sPVjdJ7VHXmPJrqIrIR7fGKKeJNTysPSbA+Fbdw739YCItoD6GrqB5S/fzYx/twGQpk/O+lhOkMutshevL80Pv3ICRMmQzIQMi1bUjWX8oGTZzIphY/bzbtjB8e2sovIGjymjVspODXsJp4mc2u5XUJux6ZX+2j1ezOI4+XmPx/ARJ2UZG+42hNBoKFswkrh3U1mHubHgE4QPzU19wuDgsL7rvrC2//lXIjhGpO84yVuoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HUv9vSUGGKMtK9YFlgilH92AHcAbFG5u+9RJyC/DS0w=; b=VmgP+nKaQJBk4TkEaoVpUJ+9bLs4c959leD7z0kgb+AVca0lBdoeWlHGituYNmskgQQes4gVeWIFMTlF7CySuXuA/fvUj6xp/0vwy3hEpRUx7CL2X2C3VltxhfjDy6FzOGGHvFsD7DtSiElyeZrnG/aJRAzjzHBESvLrUBwMzlHxsNsl9EQJuzjC45utloU5PODzFBJqBFC15Rjm8r3jr2HGejzkckIzqEaz4blZbHItRrECvp8XJ0MoeyMwBpPpg5MW6qKwDZVVL7YZvVVL9WpFfoVFKC4rhgKeKg2hSgCncLgPYNQm76aOKHsI4sU9lhUt44cddP2zmTn7QaJQXg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=sourceware.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HUv9vSUGGKMtK9YFlgilH92AHcAbFG5u+9RJyC/DS0w=; b=eAgViwMneOz2sGtzz711Jr2gPfMvZVJbf0IOA25IVyOHV0rW302En+/VIt9/e68Z79lPFZ4SLZ+kcLshpsEMzjpQeu43hXjFsZj67RmcPL/7xOiUoI7Xq8e1V8MzpWtdY1Nafgu1EZN7oo/ZryDDSHN8ZMl9gj04kh7VVXqslus= Received: from CYXP220CA0001.NAMP220.PROD.OUTLOOK.COM (2603:10b6:930:ee::8) by BL1PR12MB5970.namprd12.prod.outlook.com (2603:10b6:208:399::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9769.16; Wed, 1 Apr 2026 11:09:46 +0000 Received: from CY4PEPF0000EDD7.namprd03.prod.outlook.com (2603:10b6:930:ee:cafe::f) by CYXP220CA0001.outlook.office365.com (2603:10b6:930:ee::8) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9745.31 via Frontend Transport; Wed, 1 Apr 2026 11:09:45 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by CY4PEPF0000EDD7.mail.protection.outlook.com (10.167.241.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9769.17 via Frontend Transport; Wed, 1 Apr 2026 11:09:45 +0000 Received: from rocm-BirmanPlus-KRK2e.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 1 Apr 2026 06:09:44 -0500 From: Bratislav Filipovic <bfilipov@amd.com> To: <binutils@sourceware.org> CC: Bratislav Filipovic <bfilipov@amd.com> Subject: [PATCH] binutils/readelf: Remove unused static variables Date: Wed, 1 Apr 2026 16:39:14 +0530 Message-ID: <20260401110928.4012089-1-bfilipov@amd.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb08.amd.com (10.181.42.217) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EDD7:EE_|BL1PR12MB5970:EE_ X-MS-Office365-Filtering-Correlation-Id: a9a5c09e-8cf7-4252-17ea-08de8fdf2e9c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|36860700016|1800799024|376014|18002099003|56012099003; X-Microsoft-Antispam-Message-Info: YUt03cr/AgfUHPPOzTOYeZf1Y2eNcnpPa0UQC92L+yGD7pMC++BViUKY4FCC6KOPE90JAEB84s0zVaLC1yd6hc4qz9IpI6dCn+dJSgZEr17DmxbKZGyl1bGBlSCt8ce9SIivdDiSk7/yjbXuB6qA49LnrAH3vr4Y+DELic6TSoq4suE6Cu7yDrcADzwHVnA+TDcfYPVjdOIQVBedQ1mho4aRJmIOM1txH+KdLP5sMbsVCCTH6DfurApCObICgktIvDncTvR6c6c0z4OuDJuTa6A1zVON4IQl8nR74aQ/wBVoWCbk9q8ZCfXRuGAY/NBi0/74SKhGnORXwLQ2/owrpFLvwcQjt8kxZ8aAmp/6+It7S/p3YMFaMe+2FPO8SzdbTi0Iwg7sZlgI8PP9wQA3RKvnXxsdLRXnnxSUcuLwTm8+Nwc6R1lPVM3Rz8lAuBNpyw98URRyjCcRNf3jSGtijcox7tbljFhf3biZVqU0unGkfwFND654R/RNVy1WV1T1QlKhmNHr4JUHRbKbwHmZJrwkA7rfRcMP+YlV/F3bB7cenEE+nD61WTT16kM0deUoUB5NcpF5yoNtgLdYXvV1HBkJdxVuvD7Qa/0hBldqsoULheQK0q7AzLaekjzjT9yYMTkxPCVeb1tRX+lzDYr/GFWZx4kyFu0xfjQGp8YznB+LesCR0ezJJKYtH+V/GYAu7gQgEpx4BcOuH6CWIDhl46+1uTZF+6lnBhjEmbTDBBd1idvBpVqsUDrVnJLKvsbWoeLhawDyiMEFmWDsL+brSw== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:satlexmb07.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(82310400026)(36860700016)(1800799024)(376014)(18002099003)(56012099003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9CFcljwI7In8k1fXj8j2jdxP5OlYFbOLoo+iB9CLLhY9E5KmpS08JyD/TMIUzDpgdGm4touoIA23oxVWV7Q3ntOc6HwHyax+fvdEroiubQOXdyqbuhvwmmsmmM6xDk56F8/BaRsqVotvBnbM6QxdSQQhjdIXyUl9GlYfmi+W7K3iJs/NJhMFldVRyTZ9PXDUVN3CvnJEWZP1Aj3EkpZOwLfihGclc/t+OS5e9t/YyYJmhLBuvGx2mK7WBX8UhfSeqRepDWjLriTkoT+AFQGZCsV8o+M1bv8bNkzYdBLLoOFOgkYBnTfKGfPqqZtFN912PjsroYUMt52TPLT0Mh6KNCBtjK42OdGIkf4dM31KCDVOrQ1QMOsYm7S+INSgH0ZxvOg5uQLgX38cQV8BP8znngEZ4oT/8STAsDUHQrbe7NRMOHmsF+W7c4j2BC7MtR0E X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2026 11:09:45.5027 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a9a5c09e-8cf7-4252-17ea-08de8fdf2e9c X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000EDD7.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5970 X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, LOCAL_AUTHENTICATION_FAIL_SPF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list <binutils.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/binutils>, <mailto:binutils-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/binutils/> List-Post: <mailto:binutils@sourceware.org> List-Help: <mailto:binutils-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/binutils>, <mailto:binutils-request@sourceware.org?subject=subscribe> Errors-To: binutils-bounces~patchwork=sourceware.org@sourceware.org |
| Series |
binutils/readelf: Remove unused static variables
|
|
Checks
| Context | Check | Description |
|---|---|---|
| linaro-tcwg-bot/tcwg_binutils_build--master-arm | success | Build passed |
| linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 | success | Build passed |
| linaro-tcwg-bot/tcwg_binutils_check--master-arm | success | Test passed |
| linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 | success | Test passed |
Commit Message
Bratislav Filipovic
April 1, 2026, 11:09 a.m. UTC
Remove static variables do_ctf and do_sframe that are set but never read, causing build failures with LLVM's extended -Wunused-but-set-variable warning. These variables are dead code: - Declared at lines 244-245 as static booleans - Set to true when --ctf or --sframe options are parsed - Never actually used or read anywhere in the code - The actual dump functionality is triggered by request_dump() calls Build error with -Werror enabled: binutils/readelf.c:244:13: error: variable 'do_ctf' set but not used [-Werror,-Wunused-but-set-variable] binutils/readelf.c:245:13: error: variable 'do_sframe' set but not used [-Werror,-Wunused-but-set-variable] --- binutils/readelf.c | 4 ---- 1 file changed, 4 deletions(-)
Comments
On 01.04.2026 13:09, Bratislav Filipovic wrote: > Remove static variables do_ctf and do_sframe that are set but never > read, causing build failures with LLVM's extended > -Wunused-but-set-variable warning. > > These variables are dead code: > - Declared at lines 244-245 as static booleans > - Set to true when --ctf or --sframe options are parsed > - Never actually used or read anywhere in the code > - The actual dump functionality is triggered by request_dump() calls > > Build error with -Werror enabled: > binutils/readelf.c:244:13: error: variable 'do_ctf' set but not used > [-Werror,-Wunused-but-set-variable] > binutils/readelf.c:245:13: error: variable 'do_sframe' set but not used > [-Werror,-Wunused-but-set-variable] Okay. Jan
[AMD Official Use Only - AMD Internal Distribution Only] Hi Jan, Can you push this since I don't have write-after-approval yet? Regards Bratislav -----Original Message----- From: Jan Beulich <jbeulich@suse.com> Sent: Wednesday, April 1, 2026 2:37 PM To: Filipovic, Bratislav <Bratislav.Filipovic@amd.com> Cc: binutils@sourceware.org Subject: Re: [PATCH] binutils/readelf: Remove unused static variables [You don't often get email from jbeulich@suse.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding. On 01.04.2026 13:09, Bratislav Filipovic wrote: > Remove static variables do_ctf and do_sframe that are set but never > read, causing build failures with LLVM's extended > -Wunused-but-set-variable warning. > > These variables are dead code: > - Declared at lines 244-245 as static booleans > - Set to true when --ctf or --sframe options are parsed > - Never actually used or read anywhere in the code > - The actual dump functionality is triggered by request_dump() calls > > Build error with -Werror enabled: > binutils/readelf.c:244:13: error: variable 'do_ctf' set but not used > [-Werror,-Wunused-but-set-variable] > binutils/readelf.c:245:13: error: variable 'do_sframe' set but not used > [-Werror,-Wunused-but-set-variable] Okay. Jan
On 02.04.2026 15:13, Filipovic, Bratislav wrote:
> Can you push this since I don't have write-after-approval yet?
I can (only late next week though, perhaps), sure, yet I thought you could ask
one of your colleagues at AMD to do that for you? I guess some of them have
write access?
Jan
diff --git a/binutils/readelf.c b/binutils/readelf.c index 7562fd5014f..1274fd4d169 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -241,8 +241,6 @@ static bool do_dump = false; static bool do_version = false; static bool do_histogram = false; static bool do_debugging = false; -static bool do_ctf = false; -static bool do_sframe = false; static bool do_arch = false; static bool do_notes = false; static bool do_archive_index = false; @@ -6988,7 +6986,6 @@ parse_args (struct dump_data *dumpdata, int argc, char ** argv) dwarf_check = true; break; case OPTION_CTF_DUMP: - do_ctf = true; request_dump (dumpdata, CTF_DUMP); break; case OPTION_CTF_SYMBOLS: @@ -7004,7 +7001,6 @@ parse_args (struct dump_data *dumpdata, int argc, char ** argv) dump_ctf_parent_name = strdup (optarg); break; case OPTION_SFRAME_DUMP: - do_sframe = true; /* Fix PR/32589 but keep the error messaging same ? */ if (optarg != NULL && strcmp (optarg, "") == 0) {