From patchwork Tue Jul 30 15:37:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Alcock X-Patchwork-Id: 94806 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 8A8DF3858430 for ; Tue, 30 Jul 2024 15:48:38 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by sourceware.org (Postfix) with ESMTPS id 263F6385DC1B for ; Tue, 30 Jul 2024 15:38:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 263F6385DC1B Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oracle.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 263F6385DC1B Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1722353901; cv=pass; b=K+hrnzM4dBWKKRw9W5Q5EGc+D7dDZCMF1SZJQGcqvjJGh7nIrKRwYy/EcHAYV2ldsnygHSIeZj163B6Ci9tRwNNLznWV+CTOhuP3SBEauYM1tYzzuSxT7YVqRwKhqnRKDDvqRxnq0sa5Ridzle9lyLdEqPeXBDvhLG6T5dEHwnQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1722353901; c=relaxed/simple; bh=/+ZPq4xQ4C7mRNhSetyy6wKMMI3ypNW2wGfiuHdfEqA=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=WKHNBx/b4NWORx91rt1Lh3PLmtRAGXHF6nL2Gbfe/hkNjnCin0v6NCBWeqWMQ7AlO4cXB26yJwCuk26X+npm0YIAXSQG3ncMTLgYGYJgt95e8Wy4/N7Xnj9A3F5YUbY10zoB+Rwyi0lWO0MqbwZae4yXNTJNhz7TkCKA7ou/U9w= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 46UFMjKh018702 for ; Tue, 30 Jul 2024 15:38:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=uastqaasM/ETJBuSmIt303E8XEA79FCmoNn5Xt3JfQg=; b= E4iKyAJX3uyMyqfWuTPlGHOFGIyZfgIAggiF9dUhmUn5VSJKhcxK/K4iRen4IjCq q5Q00TqYqMVX4HbWPo3ra5Wj5LC5p8R2161Nrlq3hbA9yxRi3lB/J8gqhQtBOUPb h1mKA3dmu7/1uzptYIwgY2Sa6eY7l5tNulvs4FZvDbIZMA+3+CO+d+eBKUFBO/u+ cQG/deZYqXA0r80RLlgE6pMvH0fyDdUxdgQSxnJ4rM3gJ4XIYEn9xCvFIQjgaI8p 84Hfoneoh+8vKXXdXTPYIHadCxFdE7LH190uwIXV+z1XpMON6U783fXKR/11FD8R B1Vb5PhdGaI6ebbNO/h2dA== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 40mqp1we47-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 30 Jul 2024 15:38:19 +0000 (GMT) Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 46UF52oO038116 for ; Tue, 30 Jul 2024 15:38:18 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2100.outbound.protection.outlook.com [104.47.58.100]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 40pm83ebpd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 30 Jul 2024 15:38:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=R4Y+TjH7x8xPMr4Qev3Vwi9lb5/HwMogrcpvFyuXSkEzBBrniygIWiqyL/gZ/A1PnYHFInoTY/or1Ef11dY8DSdtTAA9ajThqMmPUjERZzevJ9eYNdbQi3T9kWjuV0WkqxpjxHCpvk4XytlNZcV67R2NEKLfnpULe3FclsQ/2vbp1dQDinnTLZjV+wftyX2wWqigyc/dgwo1J4CU0y/sQoBFTKpZukLX3PSldyBIvncFKZQH4F8S1qYql08fF2MRNT8G72m/4jBDdnfu+CdVVaCYkH3/Vm5zNE3ChlgtONN15xPP9q+4bqDRVKkQp8DdiiF9MH9xzfz9HuiranxGHA== 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=uastqaasM/ETJBuSmIt303E8XEA79FCmoNn5Xt3JfQg=; b=SjNcGDHkiDSyeMtoi3nl5aim6AoiFKzYBkS8ezyvzm2CQXloQO3ugsYfIqhwY/eHj5bta4n5K1JiYynhTg0U7Kle8QCuEFltrSzyIaCn5W4NfLVPx9Qx3aco2vNkIw6/Oo83RYLqeG0haul3QXASQNca+v+7HEZ5Pd8dbyky2nGUkacDvrQudQiWlNeOSxSPSTm3RH+2aPmo8Bub6A9rju6mZ79nFl3B17+bxXttraes1V4g1T/Ca7S8ckv2l4/bX8vsh0Gen+8g1P7Q8uLudLr1F9uvOgzQqriy9vwjln1nzgNLF2q/dcTKvXwRm3hMAf6eCmJ8L0tNgprYSw8Rdg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uastqaasM/ETJBuSmIt303E8XEA79FCmoNn5Xt3JfQg=; b=Njd6D26P1MbSpyOFYTdRJjB/8M8Ahhv719ci5VqlpWO2jyHoAivPSdRjlLtF9bKFULgTwTgUEv2ExVxJZdwHsouUAFdLRNTRLKNQrxKkAeft2nDYgHwnHzT8xPlVJneAm6njzkKz5KcShKRHVkzyrcB727KbLtmBmL0UOIL5epk= Received: from MW4PR10MB6608.namprd10.prod.outlook.com (2603:10b6:303:22e::8) by DM4PR10MB7476.namprd10.prod.outlook.com (2603:10b6:8:17d::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.28; Tue, 30 Jul 2024 15:38:16 +0000 Received: from MW4PR10MB6608.namprd10.prod.outlook.com ([fe80::b53a:ccc1:c190:c5df]) by MW4PR10MB6608.namprd10.prod.outlook.com ([fe80::b53a:ccc1:c190:c5df%6]) with mapi id 15.20.7807.026; Tue, 30 Jul 2024 15:38:16 +0000 From: Nick Alcock To: binutils@sourceware.org Subject: [PATCH 19/19] libctf: fix ctf_archive_count return value on big-endian Date: Tue, 30 Jul 2024 16:37:07 +0100 Message-ID: <20240730153707.168357-20-nick.alcock@oracle.com> X-Mailer: git-send-email 2.45.2.276.g4ac82df17e In-Reply-To: <20240730153707.168357-1-nick.alcock@oracle.com> References: <20240730153707.168357-1-nick.alcock@oracle.com> X-ClientProxiedBy: LO2P265CA0162.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9::30) To MW4PR10MB6608.namprd10.prod.outlook.com (2603:10b6:303:22e::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MW4PR10MB6608:EE_|DM4PR10MB7476:EE_ X-MS-Office365-Filtering-Correlation-Id: be027d34-54c6-42a3-c03b-08dcb0ada162 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|1800799024; X-Microsoft-Antispam-Message-Info: IcQoyD2ircNipSYyN9KVrrCoOWu3uceR0DGzHzgrTnBP4iWRj8hxpIdKOlrOFod2u+dj28fBeRjRIwgNT7/F+BXyvlsowsOwRodfFTolfJ6oWtTUOZgJKTI0shT9beTG6+Pu4abYTEckbsOdS3/1PaHOHvJnSNSCy8UojeIbdo+Wul9fy8LPLKC2YT3f+zotjeBZ117t6c5+YIGcgnf/NJSFdWrPKLZJKekgJrjZ4T6CITXw1nBid5xDd0/fKNNqZYaniDMBYZQmUofVsbD6BfLZ4IG+oxkVwu4bLts9B97hUPk7I34fAkFaov2NqMXnQmYPotnkwpDkE6wPzknQouPud/n0NBKbcFUILMv82LIHRsStwiRQp6g1P7SyRUa8S+VK6RMnaXJmpGjwFi0v/hnBtjIBbVDQGvVSy4JHgBBHlYZoTLEUaHkaCHHeGUFVQZB3lMWzQcRMAAtMHO3CX2pu1DGMcXUauc/H/XMEn7+0+Ao1rFEuFWZmpwpEbDKdE6bRsnObI0zvIz9nMVEllSvNIMC0OCOfMSPXF8mNbHS9WQArtG58JSQyeuowk8Ud3VIImu8TZAcBQQE1m0gG90AdfnKsEx5Gmq+gs4f084yvA8cRXy+Gk03ONyYnfOm0RANrhoPdS/iwWaDiiiq8r1PtK0emoPzA+UaLmLtlp10hlPQz7uPd6qQ9liJexz7Uu483f2bABPDvgZTJcq0hyF7s76iHzD7fH0V9mf1JrtI14kFpjeKV1d3B/Q+QY1KzpgjpFrMDHPdH1tgTBbpzT4/B7roZDqgWn1d/JrrH3p9moUe9JJI1yMjYMfnj31juSXQ8m+INMWiQ7zRdFFl1zz+cqfl5RIEtejn5/iDSE2P5WUqZeyafdEuc8AYB7eDLW88mtuz2S5lVz7/fG48gtBEccHZsvDnz+93rHTMum0SSPbIo0L6If0/i9tN9r7R8amRR8826oblBmfJAnK4oo+rFMh1IrqmMltLR7C0Os7ADvBva505eiDcyP4uOpbv+PNNMOrV7IufFrb9jyE71lbAdXDi4OiPQabTowv3jCwm3VWRKoWuHGiEnjftQ/Qd8LHMvSgRyNPo33utjhzJtu7M1Ft/TaVh1dmmhEkkGKnrgsFCVzYy7c3Qs0NO5TFxH6zESZDcZFKj1wqSOAo4keK4hCc4z83SkmD+Voqd/+tBsdggrFXCN3ZRPcglE//bfXO3Zr2RKMLwcdiJ3E6E74/UXSv/x0rnYCQv7x6i7FU1m0EakMofHtCHTtK55THplsXvHAyLwMBwRMOOnbSVm1B2iqhT1bVMKIB5f39mtMvmnBsWyPBPYzWNUllIjrI1zyHtF/pqX9+9s0VbHsJ7JWw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW4PR10MB6608.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(1800799024); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: N3umgjFQQeFDU07cd6hAlCgo/jwT2liFjY7RPFfobIzD+JJFNMwAZRS6PqUFmWz8syMJrYWSv73xQvr7DdRXuQHCIABdVbj7R3iIdt3nxkBJREtbAMuSQbfMKP0DpVxKZHsFlZ9k3aoDV5Nh4B7/fY2HeAoxAcTNxuIQ6Z9//e4cJDdp0u9Gfkp/2+d1I9whRhaqxiTeS+qyG0MYF9lCSwxLUpJHxbY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n3VBgC6MbawT7YrtGN2aYgF24bFK1VBExtCn6Tyugnj9Q7PXwTxMPmfL4cI2eZtA4hYRLB24kz/fMsWBG1SR4km32yfBgQztZtse9luJlO1M1lSDyEumkhDBENu5HxI8iYuo7Gq+Xyeh2NvxqtlY6mJFbsR4N/t0t6y55ozlclZ1JfJ7Kl4/L2g42LPPRl/Xo7IqnERupA6DRkTLxluEOUNhcVFpiyREKXJplpmaIK7oOzsEQpuvc+zwXbJ731tYGuZmbljtHVYeu+pt5KqR2kB1lHGScvgBoQS3UBfeVuzl9rsTXq4dIn9gLiS42bV41nZSpS0Uo/wufA== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 0nHcb8P0H6Ugh3AY/QmMJoy+kGdSAB9Aqmb1OPC0WqYKEJBOutWueLbdDkO7DFvzD/QfwqlV4M3Aj/tt413TwEdG9pncu7WuO8parac+LWpZhg2F83rNrCPM0Ea8IqeWzWv9uWAjeZqjWZ+AI+HFP8/P51anBllLsqRK1wb9m/HWXLCpUsDpa5GYzpJqrCOc+eGFxfVgF50ny7z+LFXIVMz9H1kp9YlNZcl/apdgBX+dWuPcjgsPVbv5xHOKnzNKC3pfEQDepG2t81ex4yJTg1P3Iz+n+4j9ELaKz6JxzMNvEOgkWnC7UigXCNg3FyrTNI6kfOwOgHF3kzRu7bitFPbzRpe5N0D78Uk9Cx0NEGvr9ql6Vxq5YhvVbGz9iLbH7dg+xJDORWadohwQNJNmx5U8OPXGDkYl1JpUgkZHytDf/0pTUPn1W9eKYy2JMha+qvlcoNMUxfFPzRgLAxgfDkZZkKomV0a2gUCXTUdVX3bUmiW2q0ZVbebV0OjcGYg8BoFWfA858TgnGl7W1Aa2YMP1L2/ddq3knFE7n8L0AeyfYYcGVE0RgUedr0gMpSaUkdXN3mc0cvz8EDz+qYNUpcHwi26x16+SdY4+NxKNsQA= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: be027d34-54c6-42a3-c03b-08dcb0ada162 X-MS-Exchange-CrossTenant-AuthSource: MW4PR10MB6608.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2024 15:38:16.3874 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: oCaOr5nq8ndTknQ2pzgcWSGheG2Is/cKi0gQVGeZdKWu1NPc/cEPwaSOFodONswssev9uYsDQcXDXKyyQ4fqPw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB7476 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-30_13,2024-07-30_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 mlxscore=0 suspectscore=0 phishscore=0 bulkscore=0 malwarescore=0 mlxlogscore=704 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2407300106 X-Proofpoint-ORIG-GUID: I2OhFQc7Qtoeyjk_4j23pVV7KxHcQhsW X-Proofpoint-GUID: I2OhFQc7Qtoeyjk_4j23pVV7KxHcQhsW X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, 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 server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces~patchwork=sourceware.org@sourceware.org This failed to properly byteswap its return value. The ctf_archive format predates the idea of "just write natively and flip on open", and byteswaps all over the place. It's too easy to forget one. The next revision of the archive format (not versioned, so we just tweak the magic number instead) should be native-endianned like the dicts inside it are. libctf/ * ctf-archive.c (ctf_archive_count): Byteswap return value. --- libctf/ctf-archive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libctf/ctf-archive.c b/libctf/ctf-archive.c index 0034bf0982a..b73999cacb5 100644 --- a/libctf/ctf-archive.c +++ b/libctf/ctf-archive.c @@ -785,7 +785,7 @@ ctf_archive_count (const ctf_archive_t *wrapper) if (!wrapper->ctfi_is_archive) return 1; - return wrapper->ctfi_archive->ctfa_ndicts; + return le64toh (wrapper->ctfi_archive->ctfa_ndicts); } /* Look up a symbol in an archive by name or index (if the name is set, a lookup