[00/19] libctf: various bugfixes (including a write into freed memory), and loosen constraints on enums
Message ID | 20240730153707.168357-1-nick.alcock@oracle.com |
---|---|
Headers |
Return-Path: <binutils-bounces~patchwork=sourceware.org@sourceware.org> 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 DD01D3857349 for <patchwork@sourceware.org>; Tue, 30 Jul 2024 15:37:56 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by sourceware.org (Postfix) with ESMTPS id 51CD43858C56 for <binutils@sourceware.org>; Tue, 30 Jul 2024 15:37:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 51CD43858C56 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 51CD43858C56 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1722353840; cv=pass; b=w8iAS3I5taTvPYF79XLLeslmWEr9P/jP38b3jWgvRndIJctWYMhWCzjEXmJev79SKsuJXm0wsKCVGdjD2IEF6EVnnpw+G10vt/BlO0VFiz/aYwCq0bnQncAm0jifmun/1poYTOqJfGqiHbhv7m6ox2JlhyZ3pmNR8XHEYZY8lxk= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1722353840; c=relaxed/simple; bh=NYdW45/0o86Asno0pYuQtmilOFqP+eNcaWY2oaCcGi0=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=XMCLJzza1QsA4NeyBJoBAruyhgvuugrnnRtr2hB3e04waDspVxtqEUOPoJYMyy+me9U3tHnpw9kPLMONou8uscPH3LO/Ge91ZwREMVCYjHhtDQS3IuMs48DAXeOWwqKz8boL/2m77israVDATSaONmahyugmqPM9pMxEiEce63U= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 46UFMZrJ024966 for <binutils@sourceware.org>; Tue, 30 Jul 2024 15:37:17 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:subject:date:message-id:content-transfer-encoding :content-type:mime-version; s=corp-2023-11-20; bh=sjyrkLqCkDkVYy aK4QoOEreUsCJnhZViFSu6CQhkZ/U=; b=eOuVBTFJsJrWaScUQ1EkNdRbtC2FU2 ZKvVX5gR4G0pP/hKLMs8zJhfyl33FwJnxCtzyQEOLO/Qf/bipKLUkphyAUuqcbLw bicPKX/vZ5wscPby7Bsh/GrArtk+gwEqGCfX3qBZiu7HkPMyydPPLz5Pmil56G9S VQ9K47nhlAVI8mpMSGzvsYqOc0rEkCAGXsx5+OPj52/LU1HYGnJWHuyIgcyazhzB yCp3iqAoAIfLdamh/+tSTKH1CLSuiC1gtgsrFnjVEgfnTQ1p6SBiSeEWaf0Kwmoy v0Q6zEKN2FnRUJugGQgiK8+SZ0so4GDJ5xHWxr/DjXsL1X70JpUVp+ZQ== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 40msesnawf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <binutils@sourceware.org>; Tue, 30 Jul 2024 15:37:17 +0000 (GMT) Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 46UEURX3005796 for <binutils@sourceware.org>; Tue, 30 Jul 2024 15:37:16 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2043.outbound.protection.outlook.com [104.47.70.43]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 40p4c09644-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <binutils@sourceware.org>; Tue, 30 Jul 2024 15:37:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ma7Y1p7HkPqG9lXWC9Vjz7MDPO+K4f7LEsH4t2ZH8aHScuXdA54Bbf2GTd5e+yOxUlseiyadjiy4Ebgmm0KZcjkjqOmzqr4vd6pi0w1khL4y5Sqi2xjc4E/KSeoo8gQZehTr3Z3jQyfb4bwkJ7Q3tzwzCTZDiohHPBlx+cO49ww1bwKu9EIhxIplV6af1dEGQSiazqbjtpxz/7oqBF1JZN0BGN5cdQrp7wV9+tlLSOt4X3GhRdJKS+GtSOHuL0rlVOpV8HimQ5LqLcA5KycRriQcClHWAZ4jSYcHPBelI51BrnmncxEvaI/yFlsYUr3CqJ8OwXHSFHHzFZdItBAkKA== 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=sjyrkLqCkDkVYyaK4QoOEreUsCJnhZViFSu6CQhkZ/U=; b=eJwxavp7ZVKypHtWknpy0B4zLPU6zpH1zrddugw7xoJ09xLVtwFWJhRXE2kBqNy1SKcdb9aj09XbBABVahj1PKQ8rMae5n5L2j8yWMrcJZy73RufXOB96FpsJx8udmqaraIlRPygwrvzWVtxsVOF5P+0xjREWxI/hMXHE5VoX+fu/X9OqLRMdlJNQOFcCEOPDFgOIqirAe9Kyv26iT9pv6OGy7KruT+vA7XDPFg8WDxIXy5JvK/mpaUAa+cozsGjNi9kgDvRFaJK6piRkxwIqPt7hIULWFEfIlWBkpJ8P+jBCEo7VijIHpyWz9FHYW5hTghe29e8Hkui9vSsakibWw== 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=sjyrkLqCkDkVYyaK4QoOEreUsCJnhZViFSu6CQhkZ/U=; b=w1Mp/89oM5O0c7l5cNa/0OOq3B7IEK0kvaGgFPrumXZqcVyEk12ndZR5IW8JeBdjFw4r8YejDwxh3aRZCSUMzSqjfUByikzAlqaD+x+mejhiPK4DNoIqcgjeE98jAfS0hErAAYt5dGWpKL1FnokWjz4tQh236slJZeAdlTWGJ4I= 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:37:13 +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:37:13 +0000 From: Nick Alcock <nick.alcock@oracle.com> To: binutils@sourceware.org Subject: [PATCH 00/19] libctf: various bugfixes (including a write into freed memory), and loosen constraints on enums Date: Tue, 30 Jul 2024 16:36:48 +0100 Message-ID: <20240730153707.168357-1-nick.alcock@oracle.com> X-Mailer: git-send-email 2.45.2.276.g4ac82df17e Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: LO4P123CA0156.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:188::17) 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: cd7a8951-d8ce-4dcd-5282-08dcb0ad7c04 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: QSrUxig5AvF4z8ItgKiWHEyUi1SB1t22/fCtaxywmQMMCOWKBxsq5vFhnplknRg3Vj+I81lKaEv5qzvApZYgEfxH4VvDQZ2s/F8PBs/je1DijKKCN0k1rDx014tyU+r7cLYKnf7ihRX9e5sYThQ5Y0qq8BhBQCqD5jenG6Z9wORFPXB2hNQ+UoJgjYicL84rZ/iOhBrInF2J4tuFS9er2NEnotTlTetOT7QTjVhqheMUv3hKsmlWID3XOwTBCylDbNJqg4jz7AT4irBZNULuLkr7dKv7OrMg1OS+QMVnAicNRkzNBVFySMXgPBCn8ZwV42GZP5eXpvyab79BKvDl/mlcifj20ymsnOdXsYWF09aXrsZ/KINt/Cnjt4KbdTqorWqAfkp1GIg1XqLezGSwXoJloqoCKYC7GycGr+OLZB8VGw5u46Zn7n/9jtOyH7TcIKbUd8sitZsgmkroKr7fbMZ3QoNlmuzAoXOKZUKzlmO29s1j/+yAHfSqcA6jj9zwdHo3JknXBs9L+c9r507okVbd2chf99A72DTmPGbAgvu3SXx8Jixd5UEgCOWf2PZ2ej5hf8GXgn5lDiy6CMg0mungJscP18YxJpkpypfrkv8CglFbb0GzjyX2ZXOkfCd3Qy4Lg5rltC01W+j0cyNbN933tA0j7V4X8b9l3x7RdeTnHQGyHYO+uUJG1omJ1wsyW7FjgH0Jkqqrkd1LVn4rI48VY40CRXGtBd9nVXvI7YxBrMSX0GYOFv8D3xt8S6FR2DNe8sdDff83LWVJynNKxxNKgZdoGhA+lg7IzELS4ga0rrDJbsvEgkXS7Q2FaCaCbQ8U/AkgtdlquaiLLSapYyAL9SjP3qL0Ef3cr0IvvKjfwtmsnsG5smTsNoABTyHECNJyJ7ood5OBAgI7CqAylQyfwAnD1DCSB7Jge0xQIVkTXWse27ytn5mXrJQrb/XhzHgvM7bj0dHKPqcBhtItLWdTCD6fHcF0e1dqmwE1Oo3vDnCup1M0jvVNMj4H1OZT4+061aUqlkIZQ50r7E8o/PHDDihkmlErkhjuluaSEK7COJJUizBCzqQi/sORdsMGr0ZiOCsrNZKsiYv44eUoolhaTGP5CerssEHmuSad1OqearF0iAuCB09QQpzFSlYwL/eUf/yUKCP47ccu88DROZCxsZgyDyGD3r5JBaFPjpLmkFwXW4kSbPSLWRmuustOVuat3dIvq9mmuuncoivDknfg5sBRluFiPfwghjXbRaGoYP3YRTF8FgOEiPGZAZOSCPTk/usHkg6tjIneqw1OLdPZXZiEVMaqrTXG+sLKX367JEnZbV11S2U54sRnApqs/VmPDiGvelHyo1h/1FhcKQ== 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: mJMkesduAIZybo8oLWpv+0CbMagzFRQ7Bw0ahc19rLIaX1OLiFRPAv8Z/Nz6aMi5MITBQADRR+q5VsFntskHwUdqBOFN3nXT4hpOLunT+0ElNeJY73Cgrvhs2f3Yl82i/bft9GPPIyx8s+JgRNNre23f1bK7b/7Ish06tpSZtcb2cihm1Z4RfNPejCfFxKGUwXcIHDI3fMGqknAoykWE4vo1I4IsIQIXWFv40qi60bU528EAbEc6LfsL1SSemFT4h1WxrIvpgVDuH9XKaXv2QZtQh2bmoMt0O2/3IznU9S13eaSrCmckndHVg6xxTnAdkgKhzYnSaZNWgk2U1xy1ByXtprXjnz25Hes6Q66F6hHp6gYZ3p15vICM2Q4C3jGFmkxSgj1ItLUmJhcNcyteIqe506aPFfsgygqPlRJuVSXwXoV84r1ComBbyAAYgXbmQTMKFJUfMcuG3u5ehwvez+zWZOoIvqc0ZOFDrLjf4GS4/iLrcYX0NrnysXhzqfiFq7xFB8q0D8wzEarB7nEfP6lrSGyTqoK2GZKp8C0aALpR/mJpuRGk4yrLKb/NZ5qw2nvP7e42TsgG9WIPbyXxZEfUrTrtKDixJ9/GVCjfbVEA8loLt/8KfqHdIv6ywETfPwDqlWHHNYjt0eiQN5+Sj+9t0i+iyytZdOOknATMoZWBuuZ1lv4Nk+Db5/zPBTVnb7Rnrcb2c8bTLEBJxebgYmNVa7cNkCc9fJWT9rFSNLpmdgUIgJbcrtvJ7qTZuEw3LeALD7/JlgO25/ufejTVyQ/ESzBmyU1g/wLti3fN0EK5HzxUcla/JydrZFIGcWNz+grlTgmhmExm1mhmgvX2wt4/8PRjDME9bPfoNk+TprSQTsVxwYITpVEU5KdIxY0+qB96rsIbBgD4dvzjyXukpQBb4KmEehotIaM008pcJo+GJy9Sn3lUf6wEF3mAC+Zr6lqQDT27JFWISZTF/jfUxKPGhfNAiAFWUWmL1B5BgoOhqPuNGtLtXGXfNL74nlCMDmEi1lPk7AGnVrn6p4rJXsPxO0f55NIrxsmV/SmFbJa/6+C2UoCpsYhL9YVCqXUDFKr+rqA6hpE8Hvoj8p053FibWXMedfwzoiKmNHf6WF21CsZiBAuTyTR9dFwI1kRrCannveoHLbqWS+6LjUb1QajU0MiSsV5zawKGe6YtGQp1FuHR/5PEihPXcwrtoSR06di0gs0plVbAvy/U+DDvLN6ytrj3QHz+qW6TFQLVyct0Ql/teXil2qVEemeoYJYzsfzPJIvG46JFgKBkPETOGvFL43lHXJIA8CicgdndrbtshjnSI3zLNZRDXfX7Aun3fBBdz59GYjsQlTRmD6sgEDNw0JKhoPSvTWOvKOAeQu72gkCkLbTFFsrQ5GT4e2O2Lhs78RNKSaYA533W8yO3TX/RuvEqH1GNXgiPnf1jbdgnnE372LDi9SRGv4U8Pjzm/4ANB6tvmKAeYuv/jVflcF4LqaOjF3oJ3BUmpaolSQEhxQsb+o/C/bjOWn3NEVLpfPtRPu/PBovY7giDoBBk28cSQx9AFXAuXm0UkR3puqt52lKFpSqYaUbgWl5M6YywtR/0aGesLcGbbcKfOVLaZQ== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: AqkGxbxZWOKE0if0GTzG3082VW1NjbYT22jTvm/mUhpkKoao/lObxYiBKzBDmuHy5poCQ/NSTwZXheLfwDHgeLmgl2TW4AtdB+STsfFNzD248Uycz4T0aFgQjULSlU/7BKmsGALua4kqKT0avdiRkJvmRvPB5nENGAnetABJElj80gqZmig7w+NZE36agxhIHA0jyVsEeoStIzVndxEmSBhMn0IWAyNIXXpNTgZyBF3fIxtV8VZDe9HSULhpfW2uJCfj9FWAgjafweHWAaEEVlzg7RbQ9rYV5VbQjFiCwj1ejlXDup/qlQ9MFYoQKqjqx8QauNox54EWgUyQBy44MgWz1y7FYKk7HbMTeZH6GS1xlVmSUTCVOkE7/JUM23VQMO/sqGrZ20ACHaOnTYtDidnWLX0Flr2mzqXzt2lqqeg2v57wD58x/00A5ThLxyWVQRQOhCxFT1E9wtMINW4eewPTNooEf/Q1nzz9h9zdMyhFzMgczIArE7OqPj34uwFlu7DcEpchRDXQN9aW6oDcOlvgEXUKH0gZlsbzMIkW6QgbtqtQ3Lm5fwZR9/wcfH1E7u/BRMNaAsL2ei1JuyOVmltHH1nEJQIriXN7AoEYv3U= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: cd7a8951-d8ce-4dcd-5282-08dcb0ad7c04 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:37:13.8603 (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: sDimCba/xC5hkRTnrbZB5SQdXrxrnKmJKETdmZxMw9YjxbAAoUeR+Vi4CMaicIhtXoWB/xsPUQBSvXnP09kMUA== 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 phishscore=0 mlxscore=0 suspectscore=0 malwarescore=0 adultscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2407300106 X-Proofpoint-ORIG-GUID: bRvG2JP19_NgoDl4-BqBd3VlxmMg1TYR X-Proofpoint-GUID: bRvG2JP19_NgoDl4-BqBd3VlxmMg1TYR X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_MSPIKE_H3, 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 <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 |
libctf: various bugfixes (including a write into freed memory), and loosen constraints on enums
|
|
Message
Nick Alcock
July 30, 2024, 3:36 p.m. UTC
So a few months ago (as part of the work to add functions letting you find the enumerator value corresponding to an enumerator without having to check every enum in the dict) we tightened the constraints on enumerator naming in CTF, and fixed up the deduplicator correspondingly: you could no longer add multiple enumerators with the same name in one dict, just like you can't do that in one translation unit in C. This matches the general principle "dicts are kind of like translation units", and seemed uncontroversial (and was requested by multiple users). Alas, it turns out that real software actually does add duplicate enumerators to different enums in dicts -- in particular, pahole emits lots of BTF like this, and tools that convert BTF to CTF are going to want to emit something at least fairly similar into the CTF dict, rather than having to reimplement half the deduplicator just in order to push those types and all the types they reference into child dicts to get some enumerators added. But detecting duplicate enumerators is still a nice thing to be able to do! So fix this by adding a new concept of dict-wide flags the user can turn on via a new ctf_dict_set_flag(), and make one of them a flag to turn on strict enumerator checking: it's off by default, unbreaking such apps. This is just one of a bunch of bugfixes that turned up as part of other (upcoming) work, some fairly serious: in particular, after commit 483546ce4f3 ("libctf: make ctf_serialize() actually serialize") CTF dicts have not been compressed; linking a dict with non-root-visible types in it made them all root-visible again (!), counting the number of dicts in an archive went wrong on big-endian platforms, and we were leaking string refs when freeing non-root-visible types. This latter thing sounds harmless, but a 'string ref' is basically a reloc: an instruction to please modify the value at particular address (to record a final strtab offset) when serializing a strtab. Leaking it by not freeing the ref when freeing the thing it points to means that on serialization we'll update the ref and write into freed memory! It seems likely that the combination of API calls that would do that has never been issued by anything outside the libctf testsuite (they're all used here or there, but some are pretty obscure), but in an abundance of caution I'll backport that one commit all the way to 2.35, where the bug was introduced. The rest are only going into master and the release branch, unless people would rather they didn't. All the usual tests passed. There are more of them now: in particular we are now lightly testing the ctf_link machinery everywhere, including on platforms without CTF support in GNU ld. This has shaken out one hard-to-fix outstanding bug: ctf_link is broken on mingw because it uses tmpfile() and tmpfile() is utterly broken on mingw. For now I've not fixed this, but just skipped those tests on gnulib: I tried, but gnulib fought back too hard. Nick Alcock (19): libctf: we do in fact support foreign-endian old versions libctf, dedup: drop unnecessary arg from ctf_dedup() libctf, string: split the movable refs out of the ref list libctf, dump: correctly dump non-root-visible types libctf: fix linking of non-root-visible types libctf: fix CTF dict compression libctf: improve ECTF_NOPARENT error message libctf: dedup: tiny tweaks libctf: fix dynset insertion libctf, subr: don't mix up errors and warnings libctf, open: Fix enum error handling path libctf: link: fix error handling libctf: link: remember to turn off the LCTF_LINKING flag after ctf_link_write include, libctf: improve ECTF_DUPLICATE error message libctf, include: add ctf_dict_set_flag: less enum dup checking by default libctf: clean up hashtab error handling mess libctf: fix ref leak of names of newly-inserted non-root-visible types libctf: dump: fix small leak libctf: fix ctf_archive_count return value on big-endian include/ctf-api.h | 20 ++- ld/testsuite/ld-ctf/diag-parname.d | 2 +- libctf/ctf-archive.c | 10 +- libctf/ctf-create.c | 52 +++++- libctf/ctf-dedup.c | 72 ++++---- libctf/ctf-dump.c | 5 +- libctf/ctf-hash.c | 9 +- libctf/ctf-impl.h | 18 +- libctf/ctf-link.c | 37 +++- libctf/ctf-open.c | 66 +++----- libctf/ctf-serialize.c | 51 ++---- libctf/ctf-string.c | 60 +++++-- libctf/ctf-subr.c | 41 ++++- libctf/libctf.ver | 2 + .../libctf-lookup/enumerator-iteration.c | 67 +++++++- .../libctf-writable/ctf-compressed.c | 158 ++++++++++++++++++ .../libctf-writable/ctf-compressed.lk | 2 + .../libctf-writable/ctf-nonroot-linking.c | 127 ++++++++++++++ .../libctf-writable/ctf-nonroot-linking.lk | 1 + 19 files changed, 620 insertions(+), 180 deletions(-) create mode 100644 libctf/testsuite/libctf-writable/ctf-compressed.c create mode 100644 libctf/testsuite/libctf-writable/ctf-compressed.lk create mode 100644 libctf/testsuite/libctf-writable/ctf-nonroot-linking.c create mode 100644 libctf/testsuite/libctf-writable/ctf-nonroot-linking.lk
Comments
On 30 Jul 2024, Nick Alcock said:
> All the usual tests passed.
... and also a bunch of unusual ones (building several thousand gentoo
packages with -gctf to make sure the linker was still happy).
Pushed to master -- one last check to make sure nobody objects to the
2.34 branch push.
(aside: my 'usual tests' for libctf are now documented here:
https://sourceware.org/binutils/wiki/CTF/Testing)
On 1 Aug 2024, Nick Alcock outgrape: > On 30 Jul 2024, Nick Alcock said: > >> All the usual tests passed. > > ... and also a bunch of unusual ones (building several thousand gentoo > packages with -gctf to make sure the linker was still happy). > > Pushed to master -- one last check to make sure nobody objects to the > 2.34 branch push. Uh. That should obviously be 2.43: apparently I am living in the past. (The heat is destroying my ability to think :/ ) Not pushed there yet, will do so shortly (quick subset of tests running).
On 1 Aug 2024, Nick Alcock spake thusly: > On 1 Aug 2024, Nick Alcock outgrape: > >> On 30 Jul 2024, Nick Alcock said: >> >>> All the usual tests passed. >> >> ... and also a bunch of unusual ones (building several thousand gentoo >> packages with -gctf to make sure the linker was still happy). >> >> Pushed to master -- one last check to make sure nobody objects to the >> 2.34 branch push. > > Uh. That should obviously be 2.43: apparently I am living in the past. > (The heat is destroying my ability to think :/ ) > > Not pushed there yet, will do so shortly (quick subset of tests > running). I got paranoid and ran more tests, including a full valgrinding, leak check, and ASAN of the libctf-related stuff. No failures. Pushed to the binutils-2_43-branch. I hope it doesn't cause any problems: if it does, feel free to revert. Now to cherry-pick the nasty leak fix all the way back to 2.35 :( (running the tests will, as usual, take the lion's share of the time).