From patchwork Wed Apr 8 09:12:01 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Muhammad Kamran X-Patchwork-Id: 132795 Return-Path: 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 664A44BA2E19 for ; Wed, 8 Apr 2026 09:14:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 664A44BA2E19 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=NIkG91if; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=NIkG91if X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from OSPPR02CU001.outbound.protection.outlook.com (mail-norwayeastazon11013011.outbound.protection.outlook.com [40.107.159.11]) by sourceware.org (Postfix) with ESMTPS id 18D8C4BA2E10 for ; Wed, 8 Apr 2026 09:13:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 18D8C4BA2E10 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 18D8C4BA2E10 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.159.11 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1775639607; cv=pass; b=HorELNIQ/7QOCzxGp7Ua5zafJ9yHDm6W7tqlGAKQ6A4ZJITCZT47ne+HTlz7O9mzQTIQIiJaF1Ln/VsYDZ7NDVHd6MX07gTW2D56T0X90WAto/14PUmSq9CsthUoWgEa5REKIjZjGAwzDjiH+mE+DPTzjBvO7yjHRdGsUb8kiaQ= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1775639607; c=relaxed/simple; bh=szKUTAVzfDufWWjWvYuhJz5zlV92/yWjiN+8xIJNy7o=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=twyY15GhfjY+C5nszX0fO5b8926na3RI88tyW6pKXaHuuURJtlQjYUzLytfMi3XdnxwZXDwGNqz5mTPFQe9gOfKIEGfRHMkXlpuSSx2C1ExVTriMq8EM38AsWA6gfXGy0lU5pNluMMzSGzKGskZWMnjrc0IAqgBR+CtpOSV9Z0Y= ARC-Authentication-Results: i=3; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 18D8C4BA2E10 ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=RWmzcaP3GNOcK1j6dVIt1wA7igRNHKvXHaoWjhFHX0KudTnWaYU1w3lmyT76H8laGHDxAVXId+H+hI+zMfqkMeMcLoik0G13HpkBfjdd22xft5CchiSNfYThi0EiRQdpnDbk83a5irNIWMsH74rfUF0bvneF/N6UboU+wLs9KfnOyn41A/sLVPoa68X+WUdg1LUVmBMGt+JkpUEcLPKR3sUgZmUPA2KlJfGeEVg46hzBhdJgz9sgAckXRZNDp9nILYs1ofQKx5smoOnd+e5rYd1+3ZVuZtjwaj5HUD/DO0lQ9wsxM5/KKLxGmm/Qj3TN+EjR3l2qO4ofmqwN4R2WLA== ARC-Message-Signature: i=2; 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=frzu8h5iWOwjOjEiWGHIb2o7fhXQ6Vn40ztzk6U+VIo=; b=GPequSmsy9tGFNG7nAEiuu7xpvqHj6ByoA9YyaJxZRft7rYdkNIRsxngahk+njCVGLkURQ41Y08litp+dRN/ohPgaqKgEkm2XejllFILZ9xWctsso9ScHJvoeIqIkSwJSLXf5bie06l4E9CWJyiCrZ6bHZg4WkGACTsNjC//hUDtP8x0Tp0dWPaKpzsCVz4IJ6fVvzgM+8vUPOp1j3T7tRCc5vlCqme+W+8VVDPfaCpJtyN56strEqrMTqb42GGFWfGxABBAXXlfhhDenq04YMH5ahpHssJZpp0R/RohUmIU2LMGAWjqc4LIt+9G4Gi+xUl4v8xKyoYzUvC0lnJ9aQ== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=frzu8h5iWOwjOjEiWGHIb2o7fhXQ6Vn40ztzk6U+VIo=; b=NIkG91ifdpF7olJpQ0MpTbDkLMoiSvSCS1dCopeoyu3XmJrAhBJdKkHSKbunmtjZRgr2ObM6vb5JIVWHGj8mtZbWQIeeHTe/6LFYbc7Y+ef3gKyq+/AQI74hbMO9R90JgEbQNKdaYnI+BKw64I7j4fBQ4Fw/L1xkvXp/4Q9dVe0= Received: from DU2P251CA0028.EURP251.PROD.OUTLOOK.COM (2603:10a6:10:230::32) by PAWPR08MB9591.eurprd08.prod.outlook.com (2603:10a6:102:2ef::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9769.15; Wed, 8 Apr 2026 09:13:22 +0000 Received: from DB1PEPF00050A00.eurprd03.prod.outlook.com (2603:10a6:10:230:cafe::2c) by DU2P251CA0028.outlook.office365.com (2603:10a6:10:230::32) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9769.35 via Frontend Transport; Wed, 8 Apr 2026 09:12:58 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=arm.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 4.158.2.129 as permitted sender) receiver=protection.outlook.com; client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by DB1PEPF00050A00.mail.protection.outlook.com (10.167.242.42) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9745.21 via Frontend Transport; Wed, 8 Apr 2026 09:13:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Ela2pDIZG2ek5wo8wFZCzKnlnbKa6D5J3AK6JUiROE3T4a0M8tJilDzaQliheFCw1b2OxW2sB8Retiq4iVmn4g5bsc6qHdq+kvXp/dGW3cKnW2Q7ldBs4srwa6lzJC4m0qfdo0IIV9Do5r8bplzvH0ZFOoha2N9heEKZzEY2DjQKapKaV8CQvEKckS0CCR5QLlJmhgxsSjeEKGIm3cXBtKKumNxL+xwCQWzrxQZRdz4jfbDd6Whc42l0LJIeW+XLRef/79JEDKWj1TmJd+X/gB9p6/Q0SN+XXxnhSG6B7pyq7bcCfJloBSsxWXpeOb17Vrf/5aRJAgKbvEawBFt4LQ== 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=frzu8h5iWOwjOjEiWGHIb2o7fhXQ6Vn40ztzk6U+VIo=; b=PKy6iKfciBmVJOU6IM59tSeqUgNSjzakWxIGIKxuXdYDHr8kMTcudw2GZGl6liF1qf52gPi13OM/jIO13ghDJR1Die/6LopwYFC3GBvpctBk3q0y1ecvDSDxb91e20k4CsWKZfhW0O/ojxPnJrJ0jJs+bb0w5qhf37hndjwF02QZsNKzwB6tnvWI3GAq4oLT5WyOIC0mUSY/AWEwWLvkmmlN0wK2Fv+ymsWkHm8GjzKz9JEJnp4+Iow73WGYjRDwDxy/k0SY2GILa9aXVJLM5Wu3p50j0ljsU+qn1RY+RZaJzpGSabkvlM2LN23zFb7tIk74V80AXNe/A+8+em51FQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 172.205.89.229) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=frzu8h5iWOwjOjEiWGHIb2o7fhXQ6Vn40ztzk6U+VIo=; b=NIkG91ifdpF7olJpQ0MpTbDkLMoiSvSCS1dCopeoyu3XmJrAhBJdKkHSKbunmtjZRgr2ObM6vb5JIVWHGj8mtZbWQIeeHTe/6LFYbc7Y+ef3gKyq+/AQI74hbMO9R90JgEbQNKdaYnI+BKw64I7j4fBQ4Fw/L1xkvXp/4Q9dVe0= Received: from DU2PR04CA0341.eurprd04.prod.outlook.com (2603:10a6:10:2b4::30) by DB9PR08MB11338.eurprd08.prod.outlook.com (2603:10a6:10:60c::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9769.17; Wed, 8 Apr 2026 09:12:16 +0000 Received: from DB3PEPF00008859.eurprd02.prod.outlook.com (2603:10a6:10:2b4:cafe::d5) by DU2PR04CA0341.outlook.office365.com (2603:10a6:10:2b4::30) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9769.37 via Frontend Transport; Wed, 8 Apr 2026 09:12:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 172.205.89.229) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 172.205.89.229 as permitted sender) receiver=protection.outlook.com; client-ip=172.205.89.229; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (172.205.89.229) by DB3PEPF00008859.mail.protection.outlook.com (10.167.242.4) 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, 8 Apr 2026 09:12:16 +0000 Received: from AZ-NEU-EX03.Arm.com (10.240.25.137) by AZ-NEU-EX04.Arm.com (10.240.25.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29; Wed, 8 Apr 2026 09:12:13 +0000 Received: from ip-10-249-57-232.eu-west-1.compute.internal (10.249.57.232) by mail.arm.com (10.240.25.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29 via Frontend Transport; Wed, 8 Apr 2026 09:12:13 +0000 From: Muhammad Kamran To: CC: Richard Earnshaw , Tamar Christina , Kyrylo Tkachov , "Alice Carlotti" , Alex Coplan , "Andrew Pinski" , Wilco Dijkstra , Jakub Jelinek , Rainer Orth , Mike Stump , "Muhammad Kamran" Subject: [PATCH 1/2] testsuite: Extend object-readelf beyond attributes Date: Wed, 8 Apr 2026 09:12:01 +0000 Message-ID: <20260408091202.13538-2-muhammad.kamran@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260408091202.13538-1-muhammad.kamran@arm.com> References: <20260408091202.13538-1-muhammad.kamran@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DB3PEPF00008859:EE_|DB9PR08MB11338:EE_|DB1PEPF00050A00:EE_|PAWPR08MB9591:EE_ X-MS-Office365-Filtering-Correlation-Id: 262f9680-a317-4515-fdcf-08de954f14f2 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|376014|36860700016|82310400026|1800799024|56012099003|18002099003|22082099003|13003099007; X-Microsoft-Antispam-Message-Info-Original: FO0rs/mNDdHYUAfESoMY1+YyjOHBwfCVnr4NUZfHmLkkG0rJjIxkyHJ0nTz//pRmdRA0FbUeuUTLKxh/MzrXyuXLQstcVkyI4DHSSdNPzl/ub/pDPVXoSqFpSeWjiA6lB+VNxnpU/85XEHdo1JN5O1aF8N5MUAniapEY22V0FWEnZ7TFN364ofQVFMqgzuuAlef5AuiUtxbjRj5X8ttqGxFbuKpR74AbUWgl6NWNhoOr4zPKP5pkBYNNyiFCOTt4IWExSFrtc9h9AN0JlUpbCWXRfRW+x94jrJBnIpp4+tVeQ2gnUP0isx2R9XKxmQ7b0kmxz/mA4JxdjHnp+QxqbOmYITCrGoCyZOTx32zeGI45Rc4PYIB2DT7hgGpXY/5QgJnwcKjCTdzvJQ0pSeU/uCj49OtnooEDl+tmhB3pmknUdRq1B25P7+xOeipMoWqHToirLIm+UYLNFAhe1ZzLuyEb5sgcIFeq7/TZ35QliWgup5J9KSLeQdMXtXaLlBSrHnUHKPvWv0JGQIgR98Io9vK9IJfmg7LuOMHJDx2g+HToK010iBBj3n7KmeEMUVy7no/BWCt1aJwZDCmvakQvElDHVodqkiiXprmWgx8o8t9Cxr4HWLuaT5h5wg/iT7Lv5bH2bGMARYt7qE+NzraicYc3Ndn7zuRr3+wM1sz5i0gtL6U+nWYR0faf931fP/rqXh7IaWk5YMHLQgqxM7BvBd5ohbgOSVKzByEiTzWi2Cg= X-Forefront-Antispam-Report-Untrusted: CIP:172.205.89.229; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(376014)(36860700016)(82310400026)(1800799024)(56012099003)(18002099003)(22082099003)(13003099007); DIR:OUT; SFP:1101; X-Exchange-RoutingPolicyChecked: H3ZL/sdQwKBE+5IXlc1cgb7LJ89D0kGz0XE+ySdr64OgL1vbVrUYhlENKPlWpKpWo9u8HSBdSsvowZ2toamA6bBkWoq1ICRxXkUxwDYJ7B0PMJeIm5XqKCbg2+pTX0Wzfxk7vsoC4CV4fqabk56/2+68f8SZPz+CcKcBTojLJayXobn4uGKKRQDwNyRPgEEpJfM+F/1xjUR+b0JnSspbjFHBVluyoUZkYFyAGBfxYoGnfc6pUYkeKeY/Y1//X4hAVb0Be84o9a6rdiM4UfYwcdj8QG6q9BMEspdsmqTvG3KR7PZBFRG1gZeWwhkmotPYZP2R8iolDLvr2Cm86hWcDg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB11338 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB1PEPF00050A00.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: f15fc7e0-3ee9-41f4-838a-08de954eee2e X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|1800799024|14060799003|36860700016|376014|35042699022|18002099003|56012099003|22082099003; X-Microsoft-Antispam-Message-Info: Ie2irFNdq0MziuKYmtaD9VhN6gXyEeVsV2UD1XC2eq9tUKAAu81gww/n296YNo1+NGS2reYQFNgBnqXa8QQ+rR41xgaYD+6sXI3smhFmJT1EVDjnvH5n/zkv7g2q2SSHdo6SPo677uOQ4+ta0qbqtFy1u61JGY0IgvSffGu5tyBMFG0YiNkHS+CCilaSflFSYRqzbdqBAQmj2MTfz/U5fWq632UX4h71wLDayMmIutG/HJXmg2cQrIZnqu59qGwdXoGG9Ex0+RdqL451fEd9oDCbJVhk/LEXFR2xb0XKjTjKwIucjV1GhyexVygo5IgixZVQTy9Bl3mawFgyliNpbdaQqMesZBBQp1sfxPKW42KwLb53zP0BDW+6KU+nvoMgvaejDBCRACUXhwSnVW/2cw4Lmz/lz91HnDvMqMApsvyaL/Tc9wFozfkJKheEHnAIhjMgR6t1+JsroBxPhwNWFqAbdYVL4EvZfs8grBwV+IgBERLfJjf+GhxDMTxDTqi4qXJK4645SV6QzTX/Kq4+APn24d40mLJow/FPRAPXH3Dc1n43ld5i+7kPb+pNZORoM70QkcCDzjmv+7sBNSowzyknN7/kiW/t0gF19EZNRSurFxaOhaIO4xRz7wsSQnaUJePcAsJKjw3psDWJnomZpmZwGcO6W6gZuram/gfxXRrv4zN4KWrM9sU9j+jv9VaZ4xpR3egGJktynNfV0IpKNtb4yXE8nwDYGtrMtwMJm6A= X-Forefront-Antispam-Report: CIP:4.158.2.129; CTRY:GB; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:outbound-uk1.az.dlp.m.darktrace.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(82310400026)(1800799024)(14060799003)(36860700016)(376014)(35042699022)(18002099003)(56012099003)(22082099003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: M80ff37OiaECEuo4L8mjOiZZoGIzpoXnR5IV3f2cn0HoVljF4nYj3ZdEVM8DucBE8zivJM6IIxaKYkCPHbWWAM7Bu9L8P57gOLcFPrbQKAvGtApoaUQ0CqpULcOyghaapUtmV2tv9066lDEyPFuXkIs/3oOvwKSMG55uKMSg3rXEhFB8olVuBDEbjIwhsQ1Yiq5qpFHbsayUl4UZOuI+lVljvxmfK2SnfMeZ5boBCo0XpFrJyqeyPP/Ntog5KrTL81pD9tec3NpxKo6TUCyKRfBEMiWPT+GGvt7fDG/j+rNf0lT395hHUkcZGONAtf4MNfYAh4bWq86yI49fPgEMwiuWcOCpB17QgaE4VU2uNGY/KaRC9vWxCwm2mDMY9fhWBMKihy5uNirrgBB5MuFUJTPBfLD/gQd1DeIavFyhkLRLHRJ0yj+xEsWWQO8vept9 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2026 09:13:21.8337 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 262f9680-a317-4515-fdcf-08de954f14f2 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[4.158.2.129]; Helo=[outbound-uk1.az.dlp.m.darktrace.com] X-MS-Exchange-CrossTenant-AuthSource: DB1PEPF00050A00.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB9591 X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_PASS, 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: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org object-readelf in lib/lto.exp was hard-wired to use readelf -A, limiting it to attribute checks. Extend it to accept a readelf option and a regex, where the option selects the readelf flag and the regex is matched against the output. Add wrapper procedures for common use cases: • attribute checks, and • note checks. Also add support for negative checks via an "is-negative" argument, which requires that the regex is not present in the output. gcc/ChangeLog: * doc/sourcebuild.texi (Scan object metadata with readelf): Document object-readelf-attributes, object-readelf-attributes-not, object-readelf-notes, and object-readelf-notes-not as regex-based checks with optional target/xfail selectors. gcc/testsuite/ChangeLog: * lib/lto.exp (object-readelf): Accept a readelf option and a single regex; match against full readelf output. Keep positive/negative behaviour via wrappers. (object-readelf-attributes, object-readelf-attributes-not, object-readelf-notes, object-readelf-notes-not): Implement as wrappers over the generic matcher. * gcc.dg-selftests/dg-final.exp (dg_final_directive_check_num_args): Update for object-readelf-* wrappers to regex-style arguments (1..3). * gcc.target/arm/lto/pr61123-enum-size_0.c: Update to use object-readelf-attributes with a single regex. --- gcc/doc/sourcebuild.texi | 23 ++++++ gcc/testsuite/gcc.dg-selftests/dg-final.exp | 5 +- .../gcc.target/arm/lto/pr61123-enum-size_0.c | 2 +- gcc/testsuite/lib/lto.exp | 77 ++++++++++--------- 4 files changed, 68 insertions(+), 39 deletions(-) diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index 3bccb1384d9..958682907cb 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -3729,6 +3729,29 @@ stands for zero or more unmatched lines; the whitespace after @end table +@subsubsection Scan object metadata with readelf + +These commands inspect the linked test output file with @command{readelf}. +They are mainly intended for LTO tests. + +These commands take a single @var{regex} and test whether it is present +in (or absent from, for @samp{-not}) the corresponding @command{readelf} +output. + +@table @code +@item object-readelf-attributes @var{regex} [@{ target/xfail @var{selector} @}] +Runs @command{readelf -A} and checks that @var{regex} matches. + +@item object-readelf-attributes-not @var{regex} [@{ target/xfail @var{selector} @}] +Runs @command{readelf -A} and checks that @var{regex} does not match. + +@item object-readelf-notes @var{regex} [@{ target/xfail @var{selector} @}] +Runs @command{readelf -n} and checks that @var{regex} matches. + +@item object-readelf-notes-not @var{regex} [@{ target/xfail @var{selector} @}] +Runs @command{readelf -n} and checks that @var{regex} does not match. +@end table + @subsubsection Scan optimization dump files These commands are available for @var{kind} of @code{tree}, @code{ltrans-tree}, diff --git a/gcc/testsuite/gcc.dg-selftests/dg-final.exp b/gcc/testsuite/gcc.dg-selftests/dg-final.exp index 6dcfd3340a8..ff8fdf6d77a 100644 --- a/gcc/testsuite/gcc.dg-selftests/dg-final.exp +++ b/gcc/testsuite/gcc.dg-selftests/dg-final.exp @@ -94,7 +94,10 @@ proc dg_final_directive_check_num_args {} { verify_args scan-lang-dump 2 3 - verify_args object-readelf 2 3 + verify_args object-readelf-attributes 1 3 + verify_args object-readelf-attributes-not 1 3 + verify_args object-readelf-notes 1 3 + verify_args object-readelf-notes-not 1 3 verify_args scan-assembler-times 2 3 verify_args scan-assembler-dem 1 2 diff --git a/gcc/testsuite/gcc.target/arm/lto/pr61123-enum-size_0.c b/gcc/testsuite/gcc.target/arm/lto/pr61123-enum-size_0.c index 4ccbeb39f43..36013040cdf 100644 --- a/gcc/testsuite/gcc.target/arm/lto/pr61123-enum-size_0.c +++ b/gcc/testsuite/gcc.target/arm/lto/pr61123-enum-size_0.c @@ -20,4 +20,4 @@ foo1 (struct debug_ABI_enum_size *x) return sizeof (x->es); } -/* { dg-final { object-readelf Tag_ABI_enum_size int { target arm_eabi } } } */ +/* { dg-final { object-readelf-attributes {Tag_ABI_enum_size:\s+int} { target arm_eabi } } } */ diff --git a/gcc/testsuite/lib/lto.exp b/gcc/testsuite/lib/lto.exp index 2a7b8b0de93..b36ccded5d6 100644 --- a/gcc/testsuite/lib/lto.exp +++ b/gcc/testsuite/lib/lto.exp @@ -915,23 +915,21 @@ proc lto-execute { src1 sid } { initialize_prune_notes } -# Call pass if object readelf is ok, otherwise fail. -# example: /* { dg-final { object-readelf Tag_ABI_enum_size int} } */ -proc object-readelf { args } { +proc object-readelf { option is_negative directive args } { global readelf global base_dir - upvar 2 execname execname + upvar 3 execname execname - if { [llength $args] < 2 } { - error "object-readelf: too few arguments" + if { [llength $args] < 1 } { + error "$directive: too few arguments" return } - if { [llength $args] > 3 } { - error "object-readelf: too many arguments" + if { [llength $args] > 2 } { + error "$directive: too many arguments" return } - if { [llength $args] >= 3 } { - switch [dg-process-target [lindex $args 2]] { + if { [llength $args] >= 2 } { + switch [dg-process-target [lindex $args 1]] { "S" { } "N" { return } "F" { setup_xfail "*-*-*" } @@ -939,7 +937,7 @@ proc object-readelf { args } { } } - # Find size like we find g++ in g++.exp. + # Find readelf like we find g++ in g++.exp. if ![info exists readelf] { set readelf [findfile $base_dir/../../../binutils/readelf \ $base_dir/../../../binutils/readelf \ @@ -949,47 +947,52 @@ proc object-readelf { args } { verbose -log "readelf is $readelf" } - set what [lindex $args 0] - set with [lindex $args 1] + set regex [lindex $args 0] if ![file_on_host exists $execname] { verbose -log "$execname does not exist" - unresolved "object-readelf $what " + unresolved "$directive $regex " return } - set output [remote_exec host "$readelf -A" "$execname"] + set output [remote_exec host "$readelf $option" "$execname"] set status [lindex $output 0] if { $status != 0 } { - verbose -log "object-readelf: $readelf failed" - unresolved "object-readelf $what $execname" + verbose -log "$directive: $readelf failed" + unresolved "$directive $regex $execname" return } set text [lindex $output 1] - set lines [split $text "\n"] + set match [regexp -- $regex $text] - set done 0 - set i 0 - while { !$done } { - set line_tex [lindex $lines $i] - if { [llength ${line_tex}] > 1} { - incr i - if [regexp -- $what $line_tex] { - set match [regexp -- $with $line_tex] - set done 1 - } - } else { - set done 1 - } - } - - verbose -log "$what size is $with;" - if { $match == 1 } { - pass "object-readelf $what size is correct." + if { ($is_negative && $match == 0) || (!$is_negative && $match == 1) } { + pass "$directive $regex pattern is correct." } else { - fail "object-readelf $what size is incorrect." + fail "$directive $regex pattern is incorrect." } } +# Call pass if regex ($args 0) matches readelf -A output, otherwise fail. +# example: /* { dg-final { object-readelf-attributes {Tag_ABI_enum_size:\s+int} } } */ +proc object-readelf-attributes { args } { + object-readelf "-A" 0 object-readelf-attributes {*}$args +} + +# Call pass if regex ($args 0) does not match readelf -A output, otherwise fail. +# example: /* { dg-final { object-readelf-attributes {Tag_ABI_enum_size:\s+int} } } */ +proc object-readelf-attributes-not { args } { + object-readelf "-A" 1 object-readelf-attributes-not {*}$args +} +# Call pass if regex ($args 0) matches readelf -n output, otherwise fail. +# example: /* { dg-final { object-readelf-notes {AArch64 feature:\s+BTI,\s+PAC,\s+GCS} } } */ +proc object-readelf-notes { args } { + object-readelf "-n" 0 object-readelf-notes {*}$args +} + +# Call pass if regex ($args 0) does not match readelf -n output, otherwise fail. +# example: /* { dg-final { object-readelf-notes-not {AArch64 feature:\s+BTI,\s+PAC,\s+GCS} } } */ +proc object-readelf-notes-not { args } { + object-readelf "-n" 1 object-readelf-notes-not {*}$args +}