From patchwork Tue Feb 27 19:04:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cupertino Miranda X-Patchwork-Id: 86470 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 42BD53858426 for ; Tue, 27 Feb 2024 19:05:32 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by sourceware.org (Postfix) with ESMTPS id C76493858D33 for ; Tue, 27 Feb 2024 19:04:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C76493858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none 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 C76493858D33 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=1709060691; cv=pass; b=kPaBR11xYMz8G4k3S+wtTmG8Xo7NDhcUCtfFoN4RKT+hxEYvQaKycV4MLKO6FfUt9akni7QHq07QR9+bMWmioxbHrQ7lU6S0mL5/XAbTGBl9dcXTxcltYK48B1p5Vq2fFOaTFPAdE+zqyjKTeGcMTpyANlVOo2mLKLxW3ON6eT8= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1709060691; c=relaxed/simple; bh=xGxzBogL1Jw16ROtO27MYD0teoiV1ajx3a9kdKclF+g=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-Id: MIME-Version; b=M1iei4/AZ58/mC5iepW3GMlY0JkjpT8mBSW3sB/bq+QZ0gg+S25CU52gYDFsX07S/OX6/T8kJ8/YFkZbudY/dSz5E05nbqm2xgK3Q0r0Zs5qjv4LZ8Y23MKAdJBgHfROZfooaE2tj5N4gqt5MJGkeHwIH5Q8Sh3JCQwAAa6OyBA= 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.17.1.19/8.17.1.19) with ESMTP id 41RFXsWa022489 for ; Tue, 27 Feb 2024 19:04:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=rGQVMP7zTU2YGgCyfYfr1coJ05uSceReMAWfueqCudE=; b=G6QBW7E1tXDPIdscvQTAY8NQcBo+/M7M9Ne5sinwhzrPHIxUIJ8j+pBSfeFF/SLYWeCv nIEPrAB0QjMBDQ1bCYmwmdXow54ipub00kiTHrYfbr2jqFmUJa/61VIo2VMQR5UEHSO0 8GE2L10ovolkSYanFAGAafH1lNphxagZJaJgClRoOUD+lst+eUVzD1Ez6B3X9PG1yEdj xKBw3lmLGE6FkS168E5Lhlv5lBrypkuTqcOR+WlZ2YVFw9evdOjwd7ltn+MsdCxRLbXa W4ivxgeMFT6IeyRhQHdltN6bIa3T4NQP1YBCSyrDaVJtfxo/Na9tZxmz+8RnHUbrQsYy PA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wf784g9tq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Feb 2024 19:04:49 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41RHn94Z025680 for ; Tue, 27 Feb 2024 19:04:48 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2100.outbound.protection.outlook.com [104.47.55.100]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wf6we6pn3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Feb 2024 19:04:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m6mcicvC3jR5LpxtFkhRD54J/+h4x1ZhB2nEnA4nkM9Gal1YBac/fhKWxY222G9JtA5C/5PY0w+eE3xgYKG8qKtAU7DRnbMygLsTG/0yJvZNg/kDZMoFfkqCPV9bbRJuX7BOYaUoH4rJGz+GUvDVFcQvhThi2qg3Rqx0eF6lRDALo1D8Dg1MNIQIoApY0Y2GgoeiOKrbvcuDKq1v8+AnRMvhIkdEONoGjI7tHG7XJz3fkhpqzHOWyIRUps1jLSN8ypo6Lk2k9k+azzS+NCOYXT1l1wkhhzxViD5/MKYO66Nf/7h/LOPe8Bf56BY1LAq77BMKQ/NX2+RI7xKoA9SsVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=rGQVMP7zTU2YGgCyfYfr1coJ05uSceReMAWfueqCudE=; b=licF90Ee0Mqvhpk/1hf2d+aQO1iamsxtxEnPBPuAjUkXCl0d0xotYtH+58pPgkqLhtY8SA8uf/+djQExxmeoA7n1ETDKmNJV0O7hwvufeyd35qEAWAU9GEuop/p86GL8e0RzkAjMHP8KgpKMPhCQVvrvfRnliAsfmXKtz8B7dICGaNB2HJQTKicWnEuogOoFUIgnb8F58HqUNvcIZtao8sdpH3fAm4AbTwxQkW9mobmBf1UXsw0fe+1OrxeOpXVWaBtvHFz3M1+vtGz0tnqncVfb04L9fc6Xg3r7YvY8CWdbnUaq4KF47stKe+pU9exCDbfUF3AE0+YiiK/tAGutiA== 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=rGQVMP7zTU2YGgCyfYfr1coJ05uSceReMAWfueqCudE=; b=kzmgtJQnjYxQAzgqWulANsrXXGUXWnDE0jnItfoxV0yCXt6MBu4Q2ncj1JwuP3lugroithtAyCsu9749I96U7QHNp/WjQnQl9HSUFkVciUcwewlYF6ioJWFw+5BqdyvoI6ChJSkLz3/7rzAgzXUQC06XhFUo9ewqcI5ikm28QsA= Received: from MN2PR10MB4382.namprd10.prod.outlook.com (2603:10b6:208:1d7::13) by PH7PR10MB6625.namprd10.prod.outlook.com (2603:10b6:510:208::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.39; Tue, 27 Feb 2024 19:04:44 +0000 Received: from MN2PR10MB4382.namprd10.prod.outlook.com ([fe80::8aee:c094:84e2:9401]) by MN2PR10MB4382.namprd10.prod.outlook.com ([fe80::8aee:c094:84e2:9401%4]) with mapi id 15.20.7316.037; Tue, 27 Feb 2024 19:04:44 +0000 From: Cupertino Miranda To: gcc-patches@gcc.gnu.org Cc: jose.marchesi@oracle.com, david.faust@oracle.com, elena.zannoni@oracle.com, indu.bhagat@oracle.com, Cupertino Miranda Subject: [PATCH v2 1/5] btf: fixed type id in BTF_KIND_FUNC struct data. Date: Tue, 27 Feb 2024 19:04:31 +0000 Message-Id: <20240227190435.35750-2-cupertino.miranda@oracle.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240227190435.35750-1-cupertino.miranda@oracle.com> References: <20240227190435.35750-1-cupertino.miranda@oracle.com> X-ClientProxiedBy: LO4P265CA0062.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2af::18) To MN2PR10MB4382.namprd10.prod.outlook.com (2603:10b6:208:1d7::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN2PR10MB4382:EE_|PH7PR10MB6625:EE_ X-MS-Office365-Filtering-Correlation-Id: 66238b32-6e9d-42cd-e37f-08dc37c6f59b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +zNy25/muMXSTT7tO4snZVv/69vnJd7YCm9blF1dteW/RPHGUKOtBcBSJB5Q1n79z3huH6PNzr+W5a4oeB8t7UifHbHt0rwQrjtgCisFWXT6Acpl06m0ciO59CnlTW0sR1E/L7P1eAtTxji1zpaVkuaD4EqS71/4rv3Awebg4KX5HUUjDWB7wkAvYkaJ0QAPyds7AybAIXSap/oB4AXvIzVtGu+PfKF66hcbhhk8x7vhuNmH51KQSD5ImY2WQNCQqLwsSganBgZ1eovc3Cc0tsklId2T07y7j8KTHb8A5TRnQkyFhYkqY33k88F1d+FtLKGWIBju0KOfd8RLV818RmORBSWqjezZyJXxr6adbWW4FRXt7R4HNO97NIuRY62Zl+f9dL/XgUpJOkL4km+z9t0qh9w8z+ZDj/8uhQWFBhPwzTFraA97zlc2SPWssiqfACNbgUJ79vnu7DCmBz/JKN0sOKlU7mSSdihpBXv34A1fp+A7k55JYK6AOwP86iECsLt0jn00KQZumzAjL7/G2zqtlBxbjDgO0sh7M3VfCysK7dnKD/rcHgrTzs8XrijVoe3NOhkkVCAHfdnmBzojF8d2J6OHuz+FAph/+5AMcMFgOWd++lAR5fsiob/MG7IDmMSa2Y/9xs7f7LKJOQTI6A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR10MB4382.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: maVXPH1xKijYPQkbBx8Cxl6Avyg6Njizfn6PqJ5+5rCA0046Amvwv3swqfxtfRYCuA00hOXRqBPbZ+/RSpg0twF2d277YPQXUaT6MXqjAAzvDN/T/jGDd89IDXBIXBZQTiHo99ItwtKfO7WWPNPPziQdIF/qiws6vd2QGr4C+0WO0P2GmguFQdhp5Yx5wgFgYQdfiXMTOlxyf5HDB7WfU9Sl4Z9vhuFkQXRzBRk0Gh5iIiuTVjIANq9zfBjEy7PFDhFjFsb/7okBc0o7HTyWsVNehoDwp9WbJCqjkOmGKjXqa1GqO7KdowLdi+jxXFMoNgt1pOV8LZuA4ArNBxOVZPKgZ6yrZCNkvIN9ypm3sJrIx354pCvnWXW72Zw3TLHOfgGJX7tRPdI5WGbu4uR/YL5wGiqVb7Yaltrnczy/EONKuo6gZArZMr0WBjd9DA8uIsVcuqKSVNlgy7FLAyieFI/+F6wGCyh3d871TpbRUQx7kWZvOAqw3On8sYnZDPYcNVPXT/anTaO6I94aUR+DgyXzv19snNU3+zhksK2ftYf2I/+UObxbLhchc8apML6ubrkq8MaTGmAa346spoSjgRXE6S9ANZpB5JfcQCO2nBnU8rH9SLjvnxOvjLVz5fDL3qmQ9pi9KVhVxwvlhPpVCRhl55FDLlRmA6PPCr185gSaQ/DITEndj2KPjkksKni+4G1MLzyis/unuG18+J2q9+xUtnC3pwLyj8Y+pxHzGBdfS94rxDhp/EJ2z7pct917ggycuHGwfAbw9phYWK/MHKcx4RPSYlyyNsmAtBMTEzGhkQDOsaWpMZjXbTrO1bFMZxiaYfXnvXMhNzdSIo/ljvG4/9xuxsVXoBBOSco1Q5z+hWgcUxLHjdgjy5iJt3hsaNX2TADxLkYBvJG9x5ty2iYssNOGOVJHbirgLroNMFFwkJ8Lib6gYdLH4eyGHTXvZ1j9hj5GJDcDlYBMhnAAT2DsC5UFFn5N/0mKeJNQeRSgB6x9dL7N3VjnbxchYKcn6+tZ6kceT4knTdKAo1v3PfxYYqnifGvvQ67QVrk5+3AATwOaxVt7+K07fQ8seRdLhaM/pjrDRT12lHce2kZuSsJubeA/MAojDdO93dfk+n+FOfLEF/ZMltSuLjimoDSXH5Tirso9WfZty6dpBo3eCBZo9WHndhlwcg+OJ7vwdWBUTY1+Fh9jPHJhE0sW2KRdaRDHFEGadjwLbF0PEAnvZMyBBhsdHONsuvlnkx0p+NlgTr2/qmG2sumZnfX6MJ6PNRXJCqPUW6JP0wrU4IKcp+DpW4oWfG9s8yCNb6U4pKMF8kGrRyQgnGWu1jjVATLMmTYg8eS40zF4yCrwOpNsHV84MaPsdmQ1Z4I+LoptMWElS6YxIBbpbgznFSESyMnExWhNxJ8z23vCF9eqal6Wot5jQiCh+YsR9ZgHbsVYieYO9B6eqQs3CvBnppnqm6MscNeAvPEklcMCZtQRaZAoLS7lGHXSQAKjlnLmsPy2HIRMxVSlLoIdmUJsi8JXhOPtkQeHinx7sVJpGrHd8gCSBQfJWLSbN+h/lN1Ba3/fkrR6RTQKc3IOIhlXqVhSWIBlSYyC45fjnx7YLTyP0oCOWWPVq9ydM4d49Z1c1g5oCSI= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: h+TiEF2O6zNpwSlTEGVxVOxEjM9QjzkgFI/oP2agQFc9eCGoAipwuYRRV0MTYDOUyWEwM9xs79DzVxiRbRgqzLjlaOdhgvo19iy3pfPX3MDppGe3h0jmXeHpEq8Raq6nRxaEU81sBwJ5aH/R1eOe5rNEXlaBTuC2qcAFg/bMm2LT9c2IsUeoMfjmkTvoqK9eCtRVN42SoT8MbOSWjfmoFtg+e2hGmDjO3dqheMnjM4sQoe+TA3fnUcZSWczNAdy5giyiJlSG0pruatwKXVc5CqzCrlGiQGbWH5B1QPoMBscmo4LALYgRdciwy0ncX4673wX5qC5tzLIVOLINtXtg3bH5uO7iS1eI79LpzUWPLtIpX2AWWM2RVY/+jylrgsC1du4n46YTPEZJjV5Ni2v8Xz3Itru3OKTn4zB/1fa69700pDCeHF3S6GZEUKAv0KS21NREGyGUAQtoWuPOenUKFbffgO3m2fxyYHvdGi73dOyYxVDV6bMBi6yPpmesgU4MzM+/ndwCYILJrs8HayUi97MeWzE+flFuM3b5LTXCQg7/aYh++Oi/iNoRj8gzQ8X/PCCE/rHSkfxqZ5RSIElPzapPZg7XqSzwWNAz8VtC+jU= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 66238b32-6e9d-42cd-e37f-08dc37c6f59b X-MS-Exchange-CrossTenant-AuthSource: MN2PR10MB4382.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2024 19:04:44.5076 (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: T+uMX3L45qz+Sdp4ArJcrGXjN1oW01vuwlS9kSAI+3tngeDGoewu59so9Hztt3RH/RZoFcOGRo1m5/+zaa6ohZyu5HyulOVYzZFxgEHbWNk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6625 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-27_06,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402270148 X-Proofpoint-GUID: lU9sH-N9BeKTR8qZueW4SVLbibFRNRje X-Proofpoint-ORIG-GUID: lU9sH-N9BeKTR8qZueW4SVLbibFRNRje X-Spam-Status: No, score=-12.8 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, T_SCC_BODY_TEXT_LINE 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: 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 This patch correct the aditition of +1 on the type id, which originally was done in the wrong location and leaded to func_sts->dtd_type for BTF_KIND_FUNCS struct data to contain the type id of the previous entry. gcc/ChangeLog: * btfout.cc (btf_collect_dataset): Corrected BTF type id. --- gcc/btfout.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/btfout.cc b/gcc/btfout.cc index dcf751f8fe0d..7e114e224449 100644 --- a/gcc/btfout.cc +++ b/gcc/btfout.cc @@ -457,7 +457,8 @@ btf_collect_datasec (ctf_container_ref ctfc) func_dtd->dtd_data.ctti_type = dtd->dtd_type; func_dtd->linkage = dtd->linkage; func_dtd->dtd_name = dtd->dtd_name; - func_dtd->dtd_type = num_types_added + num_types_created; + /* +1 for the sentinel type not in the types map. */ + func_dtd->dtd_type = num_types_added + num_types_created + 1; /* Only the BTF_KIND_FUNC type actually references the name. The BTF_KIND_FUNC_PROTO is always anonymous. */ @@ -480,8 +481,7 @@ btf_collect_datasec (ctf_container_ref ctfc) struct btf_var_secinfo info; - /* +1 for the sentinel type not in the types map. */ - info.type = func_dtd->dtd_type + 1; + info.type = func_dtd->dtd_type; /* Both zero at compile time. */ info.size = 0; From patchwork Tue Feb 27 19:04:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cupertino Miranda X-Patchwork-Id: 86471 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 417DF3858413 for ; Tue, 27 Feb 2024 19:05:38 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by sourceware.org (Postfix) with ESMTPS id 998243858C98 for ; Tue, 27 Feb 2024 19:04:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 998243858C98 Authentication-Results: sourceware.org; dmarc=pass (p=none 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 998243858C98 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=1709060697; cv=pass; b=osd/Ah5lMGpShX2vyK6m1DgC4nA7MTvwGYLr6K7ebVJQ2phckHbfLPf1tr+GHiTSSHYHwGu5NaSuzOlXTZlSHspzIJSRG92N8UgxTpV6W+CdEfmmHGeZexZm+eNQVs73jKfHRhmDSVW/dwvTw/kw9IJ50bQmbohPPrPDhawG384= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1709060697; c=relaxed/simple; bh=eC7s6w6SjkuRDua5MLPQaBIS6QTDjEVCEb/j7DKVDAo=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-Id: MIME-Version; b=dUDsuaKoTJI/uk9OeWb460E0rK4lx60hqnkT5U8BjqupQjrqLp3TJz3BGrsWYBX8IBAiMfEm16bl74IkBQzYiWkWaqMRq38tvnIbqPEJ/1k8ANe39xUe+8pymmm4tUZKdhvuDW8fVkqJsn0E015m1e04TzX99bNkgGCxUU+52HA= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41RFY19M004804 for ; Tue, 27 Feb 2024 19:04:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=jHMSY+xa1Q/nFYSxVOCEetTuM6Yp1iLJUpEaoem92c4=; b=Y7pqnB1vPRbEmesdBx5b+5Rjy1oOTYmjDIGG+meq+60Y0i9P/oMOgARuKw7NoTAG/zMK 0SE4marRKx6OUpYZ5TvduTaiKh/J1wSBo+HM984c1K+1Gz6ikEZGRc1fsRQFEMwCL1KT aIUYZR05XfRGm0617ZwSfzY91IkDg/zIudeqcQwoMTIBJjiYFLefETQdWmbMIpgtFf0f JOw38doOBCZ6WJY1MFX1GOzEnMtVPlH9sNe57krcCvz1AX6CXYu6TKfFh4N3WKPXvhiJ 1NlfCrdUR/7wZf8Qo7+9J9/474R1rA7Q5r/tfIAMDBq3aKWZtVO0FJUWMTZR6iejmOG5 +w== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wf6ve05jr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Feb 2024 19:04:51 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41RIp2dx001736 for ; Tue, 27 Feb 2024 19:04:51 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2100.outbound.protection.outlook.com [104.47.55.100]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wf6w7qhng-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Feb 2024 19:04:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mO4fdHej9ysbEY+MhZkMEqY4g1rfFX+e4fpDLkksR/mzvUyMse/0LG3uCs+ZlocMq/NkSu13UHrX/NvSa0S79ynZrtWgT4hj154H13fj+S7SHwVSRGR10o4u4Nj12xKvle52KiNZ7QkjI+20W6xB/MPpVppUStFuum6ydNjl3H2w0r91CnQVZJH2+h3+2YbG+0e20INhkcDVcdgwyNDirNgNVp63Q48jUxeEevsOwkitHrTC5gzEOeys48rhmOcdgxXOUBAj18Lvb9J4mBO/r1DUojM6jQKjm3nOK8RuysmQ8igPkQRj5x99kJHkXleKWvCsLJqpdNVn2n/gxaeMbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=jHMSY+xa1Q/nFYSxVOCEetTuM6Yp1iLJUpEaoem92c4=; b=R80UJNZMX6iHqd6fcSyOKaLoP8TiTfOM94f5o8ylLcISdvnQ95l2igeYPV7yXiGFtRgBSehtplNrbx4igHzfcUJigtvA0Y32KzvcN7kGSCJaB1HxVIGkZsJXCiaxkLQGXW97uYgSNWErXqvScYh6aVLjjNyMBa1ghBhRB0GsQgFF3GDxKI6Eq71KmeSg2YLKtd+khjqlY9PU7jSpWStOvMHt1D1I48h/sEjuSL2o4LVaiozEwJoeS1F+Sl/tghB1pDEvgTh00wAcn2yRRnyEiP8d+fSckVbyHGOLTHKhAaDuh591ARCxUjkkCnBdgzB7mLhihGKXTgj8cqRtjosHpw== 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=jHMSY+xa1Q/nFYSxVOCEetTuM6Yp1iLJUpEaoem92c4=; b=BF9qfz/KVVa5pQUzIrU39zE0Yhu+0MU2w2Yj0EyeYHJoNqUaxLbyLTjp1Px24Bij1jTeeSZDQ8ik5mo3VWw+nD+5wjBODu8TkbTo8ppSbD7BHdil0prsziuM571RJp55lrDHY6mLlAaHRohGOylrNzGkV1ncrOhieq1n6ViYXY0= Received: from MN2PR10MB4382.namprd10.prod.outlook.com (2603:10b6:208:1d7::13) by PH7PR10MB6625.namprd10.prod.outlook.com (2603:10b6:510:208::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.39; Tue, 27 Feb 2024 19:04:48 +0000 Received: from MN2PR10MB4382.namprd10.prod.outlook.com ([fe80::8aee:c094:84e2:9401]) by MN2PR10MB4382.namprd10.prod.outlook.com ([fe80::8aee:c094:84e2:9401%4]) with mapi id 15.20.7316.037; Tue, 27 Feb 2024 19:04:48 +0000 From: Cupertino Miranda To: gcc-patches@gcc.gnu.org Cc: jose.marchesi@oracle.com, david.faust@oracle.com, elena.zannoni@oracle.com, indu.bhagat@oracle.com, Cupertino Miranda Subject: [PATCH v2 2/5] btf: added KIND_FUNC traversal function. Date: Tue, 27 Feb 2024 19:04:32 +0000 Message-Id: <20240227190435.35750-3-cupertino.miranda@oracle.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240227190435.35750-1-cupertino.miranda@oracle.com> References: <20240227190435.35750-1-cupertino.miranda@oracle.com> X-ClientProxiedBy: LO0P265CA0010.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:355::7) To MN2PR10MB4382.namprd10.prod.outlook.com (2603:10b6:208:1d7::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN2PR10MB4382:EE_|PH7PR10MB6625:EE_ X-MS-Office365-Filtering-Correlation-Id: ef586b8f-d8d1-4c1b-4e56-08dc37c6f804 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OtDjvZMFsBWCd5DfVOMA3ccthb1AgMF8YSMqJ/F82iveGVehO9QpfvqZArhZkxWbkv/SC9Uq4W3ahSfyMWKgaVbRB6grxUsdjaNCTbu7sPsnV2TmYs3nkgtUxNDHUh5aES7cTTT3BxZmfzW36/YenvTgatET8DQ+r1HmNAAJdGGejtfXgZ1pVu2JWwWryaITa3hkzk2uWu9aONFigY+Vu2V5At7uGs+g1HMVOn0Wdm1RrQeuePxNmlrlyxFNCYCsCQ/Gf9OH1Qe9I/JWpMsH1kKYsZz7eoJa/htlOQgidGg1MmzGlgBC31BCUn625P7SXYAjrAkD9OAAoN8yTdHKhGBWBFVSvT4I4vOgPf8q7JQKQm0rdG38og/GASteGbtbVUdyngECA9RjEVrcTZ2yOenXWcKMz6CSdMa9knmsS9ot4qir0wYaVpUw2kTDqJ8lwXGLHwOQ208OIn5HsaR194H+n+6kumifUyyQ3dGOp5NR55nmr1Q1RNYkLC8f/SOiJGpAKBHfmbkMYbLcc8vK0UIFvpT/MPDbhtDjiq/uASV3tVVXj7GkYkTKF4MAlpL5dcy90JDZb/Q8I9sKV61eVU2utfHhmUTt5hlsCLdYGzvQbhH0Pqykxe8xmhdxxRYHtgaysnlQzfjRcuywQJKoUQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR10MB4382.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: OHJ42Cxja/ZhopjrLIvZEpKM1rlw95ifu5FOE/qF49PxRSzCilwEvNRg8TihgmPc6+qJFGwk0ftgXH+G6VOqfbUualPlpqfHNys38DYFs8oW/691rSutpfy5Sc+Mlbh+/dKgD+Aho4GVDo0r1Z6nETD3IByiCK5hq21NTs1cfTwEhcCpMvMzXQDfxUKLpGpUJdG7FSs6B93f4TB21HUPPBxTs/zoZODB4ivJZW9TN7CLdO+V9v43/TruQ6mNwgcHwOo3ojDSlbJfgMIrwEShyROooFSg134i2lyhaoQf+txJbeDwZwXYQWlAi9McEZ4Qliim8/dr7rJzP5BskNg7dHh/2EtKFs/PIjts+QimFN1RASA//qcrdA2FQQmzKF5t5ZDZDi2eOZvQMI5Xop1ylX6pleveiQJy6ynJV1yrewzSSG84fHLfZdOtMMGwxRUSe2cCf5cVE9qUQQQ7/5HjDCQSXORKY+QKg/gwKV2yczFmBwR23fHF6OSugUS6pBWFinAF4hKSE+NvK8jCOB4vPjL6B1hg6g6pxBqbeqEgMqo/h1KRXm0DvyQiweRWAV1/l8nexWkxP0kDkloc81Le2PhybrQJ3PFMubCWQ9hXFCMMqYUwS8SLxyLQvsOYTpFXkVJkD2z6CoOESiqmN6/V+Xt1fzTJ3o+8Jbo9M74wozex7onW1jiC/KqWb77sn1BYTUcUAFBbnM0bBN4/T1CL+mbXGrmVfFU1lbsJco40jdS+J+9mdaREGdpnh8VqCJMb0XYsyQbv+yCkLEAEfJgwnnM7tBjOiBre+EEFA9Du1j3k/kVQczZU2RhZ3xK2bxjfyQavcIWEIMAkdSuJ+f6dIqa/YsuspE7Fo6KUsDFEP1LjUYIwmiYE2TdTzVdxC8Il9dhpYgACIwnwMiYtoRtcZbFHeVqQ+nrdkwp/YYll1dG4+oeAR0iufeRf9Y9n4gBaxCXSGZmQlgukhjyiE2Jnfw9k+gboyOSd9XNE/3UriBFKkhHHcYH3AYzihvK7PGbN4kXn6EkAjL0m3DxYJEsyDrFCaKFvAubwVUq8XyO2sEhUzq+zi5SryvzpCS9KfX1dWdKnxCxEOnkuRS+AKt4wlti8vOXDRARBHNRj2fcy1NmhskMNsp0w0lKwprwSxo7NT7agpy3gMEcgwE+urXBWPQdsV0gK5T96RBM6KI4u9PHBH0BmdiSed0Do5rbZ3NtO+O1ZRiTqKEYX+ZDHaPDDE/fvRelRa8Xr3AvC5P7Uvw7hhDVoMVP/x9STQuKmFqfJINaaEmyNMGnyjFSyVomRF4VuouxBo71Qw0ltQBJ13Rv30Xxn5hA4tbnguP8ozIoBXF4Ue6Tyi97sUENXwS9lSxOnBQH0z8fy7YgKUB4wi43PLPXjFz00xkMx9Pb8xOXNKiVn0YdQGA/svK7yKDZmCz75PGRfR7eAzVvPJ/DE7maVG0vuUGNCUeAKw8HzGH5JASy1wWvtd2W5Ft1ZAq1C9NoNzrIm3v3PNKdanoUiGCRUlAm3whbt8mRPg9T8G9wt7qxF6aoJ4Vn3mDaL5AmRIZ5WJGfBh6ATmiOcmTIH6qifShZ2/kwSBHMii6nNsuqLp8UcSYHmwLoWqc0WKXvPloFgEMI/QxCKCfGT80svg1k= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: wtPYy5r1UgvHl6pZOYjhyzfgD0ndMp+xNgXVdbKmZ50NoWI3pazRMxAQV8ok8w48nZmweOczoPvz+b4Tg10VnSwGN6jA1Lr818iDhhlE5cbAU45Q5fZvzoBBdktSfv5iHgMCsGKwx2Ok9trdq2QI3XouUGt+nK+69JdVsnVI3fr8muMfQpDZIZs/188oPdPtY3ss/35ndsS1+XgDOg95IMUhnch0RHPoJFmKZyLmjgzZOTIC6vP+qDJ6gdWID0PRAVEm5qdPiEvPJlQrth+ObNcKPBo5s+zQCou1GdCXyT1pJF1cBQ3SR+14E5T4EhrA3v/n10NBVDwtejBxHJagD6sXdxFlJict7i7Li7XqkzRt/XgZ5YmzJssXmMt4HQvPWwpMHX7s4eyP6WN1cIuPKqDVk+5wwriFzSVtsXnZjgQQxflIGxvvc8kUluOcGOXKUvp17HIO9lk+NKeh33hhLVBPNfUmt0scHCyJygMFBXy/Bp7q1uVpNtYyzPjvAKblNDzri9GMgkwHeaUsiO0hXyTgrb7yzF6ojuRuQEgokF/K6Z/MI7HDIY6PxRZtfJTnYcbPWYuOhfKFow4wuxuhau8j5zyV9T1G849hWhOq0u4= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ef586b8f-d8d1-4c1b-4e56-08dc37c6f804 X-MS-Exchange-CrossTenant-AuthSource: MN2PR10MB4382.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2024 19:04:48.5515 (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: J0v56By1mWlN6t19Tn8PiN/zTC5diXCBQkcjKsKKEUNcmu2JW7pScuiaJtpkx+j8teQUpf9IZNXJ3umhcMyKl19KcVbGZzfklEnaT/nY1P8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6625 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-27_06,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 malwarescore=0 adultscore=0 mlxscore=0 mlxlogscore=976 phishscore=0 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402270148 X-Proofpoint-ORIG-GUID: R-BnbVqQdn6lqpk15tCD9H5H62vy-mA_ X-Proofpoint-GUID: R-BnbVqQdn6lqpk15tCD9H5H62vy-mA_ X-Spam-Status: No, score=-12.9 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, T_SCC_BODY_TEXT_LINE 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: 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 Added a traversal function to traverse all BTF_KIND_FUNC nodes with a callback function. Used for .BTF.ext section content creation. gcc/ChangeLog: * btfout.cc (output_btf_func_types): Use FOR_EACH_VEC_ELT. (traverse_btf_func_types): Defined function. * ctfc.h (funcs_traverse_callback): Typedef for function prototype. (traverse_btf_func_types): Added prototype. --- gcc/btfout.cc | 22 ++++++++++++++++++++-- gcc/ctfc.h | 3 +++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/gcc/btfout.cc b/gcc/btfout.cc index 7e114e224449..7aabd99f3e7c 100644 --- a/gcc/btfout.cc +++ b/gcc/btfout.cc @@ -1276,8 +1276,10 @@ output_btf_types (ctf_container_ref ctfc) static void output_btf_func_types (ctf_container_ref ctfc) { - for (size_t i = 0; i < vec_safe_length (funcs); i++) - btf_asm_func_type (ctfc, (*funcs)[i], i); + ctf_dtdef_ref ref; + unsigned i; + FOR_EACH_VEC_ELT (*funcs, i, ref) + btf_asm_func_type (ctfc, ref, i); } /* Output all BTF_KIND_DATASEC records. */ @@ -1452,4 +1454,20 @@ btf_finalize (void) tu_ctfc = NULL; } +/* Traversal function for all BTF_KIND_FUNC type records. */ + +bool +traverse_btf_func_types (funcs_traverse_callback callback, void *data) +{ + ctf_dtdef_ref ref; + unsigned i; + FOR_EACH_VEC_ELT (*funcs, i, ref) + { + bool stop = callback (ref, data); + if (stop == true) + return true; + } + return false; +} + #include "gt-btfout.h" diff --git a/gcc/ctfc.h b/gcc/ctfc.h index 7aac57edac55..fa188bf2f5a4 100644 --- a/gcc/ctfc.h +++ b/gcc/ctfc.h @@ -441,6 +441,9 @@ extern int ctf_add_variable (ctf_container_ref, const char *, ctf_id_t, extern ctf_id_t ctf_lookup_tree_type (ctf_container_ref, const tree); extern ctf_id_t get_btf_id (ctf_id_t); +typedef bool (*funcs_traverse_callback) (ctf_dtdef_ref, void *); +bool traverse_btf_func_types (funcs_traverse_callback, void *); + /* CTF section does not emit location information; at this time, location information is needed for BTF CO-RE use-cases. */ From patchwork Tue Feb 27 19:04:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cupertino Miranda X-Patchwork-Id: 86472 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 9961F3858286 for ; Tue, 27 Feb 2024 19:05:40 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by sourceware.org (Postfix) with ESMTPS id 97D8D3858C54 for ; Tue, 27 Feb 2024 19:04:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 97D8D3858C54 Authentication-Results: sourceware.org; dmarc=pass (p=none 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 97D8D3858C54 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=1709060698; cv=pass; b=XfVv9WXWQhpoL+IOneZ/kL/goQ73uIuXwkinIvkXft7+85QJ8AF+ZYSPuTORycNB6TZnHMG6x0M+ri/YfPD3n4mmzbWXEyN9t+lPQQbjobKd9prXtgcpMrPpsNPJTXu3lTnWTVOcXCCLGyeYKmV7p31oMw3CiaX8Ou9iYGmzUnI= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1709060698; c=relaxed/simple; bh=rWZGAz2IKVzR+3TEmeOqPMTeoGKFKbixXXYTtvkwyoc=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-Id: MIME-Version; b=YC4k0pTW483OV/5g+eU+UDAf+EXaioPKEWQKh+72JgHlxt/Hw+pucPdMdLCVDff5p5q4ecU8AJLzBDHskN4vbSI0MNqWhElP3QlLq8HWtDZoWb30rZk0trnVRUdZauXRkETU0FPSXNl920eUO1XNhGkqTpeN8DVCqC1Jy7ic7sM= 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.17.1.19/8.17.1.19) with ESMTP id 41RFXsb6022493 for ; Tue, 27 Feb 2024 19:04:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=c8ua++/qof35FygHIWZaI1t460PEsuA5g/MXbayYdR0=; b=Jfcp1uG7Tyea691cb9dyatwde/pn4UYuK3sstwPD543clLl9M2T5bKrbEVDsoQi6PpdZ ndvZOkhgkBtpbs6klxcNY3Kq0Fd0SXMuqFNc/rKsdEvt+ZgTo43/06ELrFJ61yFXrUUE 6/YkaX+Xtyc4ogG2+4fkIqe4Mr5bWqDuqYnhDfZ/4sy25fa4H7aRQAoPuIBsV4Z2n8bu qlVmg34GrU6QycCQvEmfbe1r2mq5IGug9aloZopavpx+8GOUT7eNkujkwaNi7qv8xTeJ aNscEQi3bXceF9kIMR+3kDs2aLkIaqRiu0lDIOaVeFq17RxT2lvS6aruYNg63GfcVXv9 aA== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wf784g9u4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Feb 2024 19:04:55 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41RIxaSb001694 for ; Tue, 27 Feb 2024 19:04:54 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2100.outbound.protection.outlook.com [104.47.55.100]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wf6w7qhqw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Feb 2024 19:04:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=atUrR3bShjVlz5idhxEf7eQ3nnO+Q5by8itl8ZLPM/TA9thpMH2ldA3CRfBPF3vXlN5K9pRA5EsoclNvzFG0EtGG4WNTOQDlMOpF+mCDBhtnBCKKYALBIBVUDLkgzO6A8E09sBiVbhIOej02y+x0gVNbJkBoetp00DMNDnyXOanxOELnyPV+4Q82IpL8EMyrUSW5V986EpV0zcX7Y/z5a/uqHbEKyH8pbg99DiHQWF6xH+N3HzzNHsK6Lj6O1M1c+Z1evoIMfcQ/6w0CvPN7teplAW3oxpBPjdHDHGtl17TuL2QAj9AVHAnjLmjnv40kfCP31u23oIQyUkUjhOzNNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=c8ua++/qof35FygHIWZaI1t460PEsuA5g/MXbayYdR0=; b=BvIgmGv3nvGrB/dwQq1uJXJCJJv3uf0Da+2s3zkTi9DNc0NPsK6C4ossXcllnQR+o0JudgEk9vD11bZDD6taBokyfc0Zpp8CKcVSV+FOgiHH9Myg0eC7llp7O4Y4r27dCnNgraLEgO3lhZVweMYVAGRAkDyC+5IBPCSPBJaDzSI8FIxYU2+DnOcyJSmyMprtsM74a/Brj9YPiUTFD+znCpOahdVPdi/ntzqGExDL6GnZmIIwy8cjaqGeYsFCnlUVerSqrHo2KJMPiJZD9VxqA3J+J2zOUlpEQpyJX0FTzpoNcoUvXyWmuvuatwjNAbMTKqalnnj56cqa3b5KcIHUIQ== 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=c8ua++/qof35FygHIWZaI1t460PEsuA5g/MXbayYdR0=; b=S0FfsDpLCOK0JJ9zrvqVPuBCLNIgi0YSHkqu5vjrETjhmmf5lAUO8w/kJwTxx7yXJ5IWzhJ39Qor3vNYMzyb0cKFEBIIGXW7vb7R/C3UIRhikprrhbGSswh6bZ1ageCeObOFWBge7bp/QbRrYpkt7nAt7dM4RsW2MYI7XTz+cWQ= Received: from MN2PR10MB4382.namprd10.prod.outlook.com (2603:10b6:208:1d7::13) by SJ0PR10MB4416.namprd10.prod.outlook.com (2603:10b6:a03:2ae::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.36; Tue, 27 Feb 2024 19:04:52 +0000 Received: from MN2PR10MB4382.namprd10.prod.outlook.com ([fe80::8aee:c094:84e2:9401]) by MN2PR10MB4382.namprd10.prod.outlook.com ([fe80::8aee:c094:84e2:9401%4]) with mapi id 15.20.7316.037; Tue, 27 Feb 2024 19:04:52 +0000 From: Cupertino Miranda To: gcc-patches@gcc.gnu.org Cc: jose.marchesi@oracle.com, david.faust@oracle.com, elena.zannoni@oracle.com, indu.bhagat@oracle.com, Cupertino Miranda Subject: [PATCH v2 3/5] bpf: Always emit .BTF.ext section if generating BTF Date: Tue, 27 Feb 2024 19:04:33 +0000 Message-Id: <20240227190435.35750-4-cupertino.miranda@oracle.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240227190435.35750-1-cupertino.miranda@oracle.com> References: <20240227190435.35750-1-cupertino.miranda@oracle.com> X-ClientProxiedBy: LO4P123CA0104.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:191::19) To MN2PR10MB4382.namprd10.prod.outlook.com (2603:10b6:208:1d7::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN2PR10MB4382:EE_|SJ0PR10MB4416:EE_ X-MS-Office365-Filtering-Correlation-Id: 0bd19eae-e1e1-48bc-5eb4-08dc37c6fa20 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: M/j4DRCFAsvsOGzCchDBgiGTBXzdir/M5S1iEn3fKXBg8MbQk4lWCD7pIw5f0dXdQGRBbqycUv8TOhqDVP3wJxs0xPkntqhxSe7WgeCNW/TZAbiC6zSeuQNvoWG+DFzGWviBJi/VrfB8qand055vykzekrwCc5UW6YTIDzIjjVoCsJJr7SEjGApDEN56bP43g+rLxQ/r/8x7e+d8tsiRa7wttuQDbKm2cAyXNcy61kwe3spSD1qeAAm/AmzL96PIVwr2wFTMH0S4lkDhejyyo+yf7FAON6MIZXuhBl24AR/S/6D3EMKmM4aFmRFsQOVslHUVzxuZ0pcMOhHsBmtWKEzfjYX4zRPW6L/SMIZKceRRzm/ysLZRpOzBbhEv4mnOfbzmlHi7qwQAev8gh6C2cyh8fIvFPEG39G9Dv8Hag4uWvv6HNIJWukCjYPZgRCRi5EZ6WG0c/wavwQY5N2zQorWsYvxcgX3W+u9LPV5G2JyCgtnLhHtyCD+sU/fbmfablyeDtVwRdRCKnjduZcQLNFXmw8xF0dEzqanLcQ3X3SgXvVVslQUgwQmjEozPwQxxaq1wgizOOYue5N7Pv3gT6jnNqsImZ+aD8yoEqyFTIIHtSilnq1LJ5bw+laeIj7Py X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR10MB4382.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: HUc380B/LYvxZpKlDRycZ/cKaAilpNRTcm6Wh9hv72Zv43fH/mkQjO8g+Kpne7xLv/Igm+TPR30caSsC5uYvzF6FJqwXkloxzSY90iKAHvjPZ7zD1meXrhakYKT3UPdhYpDTJ5ieebzqu065mDvl94m+DL5lcyWxhafzisKRo2taW2R59EU+lODMAEI1MZ2pn98vJnRDJYjSZ/7rUdONk/mqM3QWYPhwvX83yJcM20XPCp1vSLIbLcEZbcZxE/tlEgoR4wHxwRKKVYaxI0mqN+QU4FG5qzB5sPE4JtZ6TottsxmeYnRNzCo/aRzSX8JBAtTDqQ1X0G22sYnsSoEKQS4MCSmafQpc5oKl8Qu3FHnBoe5cWNrd/Ve1capU+eptJFUb2+vKEUpcWJKggOby6BwseOWj3fr56uQoKK/bDu51NpwG3RFQVAuSF201N+k4jjoSQrNclwyywtdoqiWdkbpAYwthppGgg2fPM1NpSh/n3G/ACklg9+GSAom3t5F9sFdsgcyyBVgXB/i+QQx5Co8772nfW59sgBjYwRV1wjuYrVqRgdlCk3Tfs87wTJynTc/xRFbGCAGD1qPLrbIu0cs3Keh/5lOeo4EKKV4TRmh6hqPRbfeZ8H+sA6JeBpR4TQVP7qVhkEoInjox3bU3HFgOPqidEdTRH2Hf9SNg3xSCZ8vgPx7rk+j5iQbYv8eP632oIj9HRtmhAn5rnlDTy7ad/TciEV4WqGDi4e2yLkxyPqEnY5rDMMIX/9rH/1/EwHp8IIRow8tby/Gj+948xQWpTufYPu4uVCJ/6NQCnZxA8a3Wnm4B3EBB17j2kjmhrxE3PETeTgro4ArX4Da3BaKvOkzhTWDjlyhfL59uj2NfcO9kzfwqvODxsmFVdThT53v3QdDKDgErduLIqwBFLBIMp/rkD2edL32fgbPANtvFMtKgP0TR+eAbuZ45ryjLofcKMrtJIgldfH7Q0AsmrUGFq+LgpdVYamU3ixyi+A0LVlku8Sqta5XJwcnP/KtxmbLE+NINXfEdU3KRnNwF2vnOpZWv26DhWTb3EjX5pf0++NzJ76SZar/wUEOEc24TdY6JLvltdTTVRxUm7acHCp0XBAu4iZVm3nVGj2ZGHHXHQZoa0vMk/ul2KKQc2LiaV+fmR5ycDefwsGrlBH2gtENVhDtBiykoZEERy1iblUvpr4JjOKm8hEJiWLg9yAk3Gh/ygRQ+maWDKkZJPHBwXA9obyKcIJa9M8+1+prSk4Ml617eIu+CXw4Qt8sotRZE06XMZtkHeKSfaiVDtSev4/0ebDq8dPo6wCEOQPyFlQ1+tupFcd0Vqa4vh7RZzhTMD84FZ0/AT165IjoW2qQy6783xS/wKLsYFFiGdusA465+I+5FIRxIDDo8M0YKGgDjHHyLgyXmdPSyJ6ZanKVk+CXsz21h2zmUQapInb7pO8csG0ier6iqEh3xelNKN2qGtEPhDL2JjkapMCIkSrlPqbpwKa9dyAShC7Qi0qOXF1GSI8t0XPfSw5f5HAI2HV0Ef9HnY/OiIB0Ss+OjiNOgMHZeNFPVKqsoV4cPgTXQPgCx8Txiya68sp08ImJPSkIQhHSiqsX3RkO4vVJAIu0CscFAODRuE+MjXVxj+taEp5Y= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 1oL5V723VcmxK9dkCQppZJW/ou/PM1+V8Ob2k2WMpaJOV7g4e2Fgg2eS687SDOKGUxd2FdFJqpGRGdizOzoOh7hafDkyyHDL5wqGQQ5omvGRkimrBBc6CP8d5QGALjGJHcGr7fSuUZsBrTqeRKwu7HEz/JMbsJEt9gGwRVcCWf+84kPNfvEbUnUB/BwJ6jkFvt8YvyMrFx/s18lRz0jTwzrK1kADxv8vzIHjGc3qAtxkGBnrgjQlMRG/hV3MfIU+yjxJWVuF1T6un9epC9BZdJGBYOlrSyEx37PsI01xMrg/BjWhX/2rYjFJd1YcVyySRwlee90m1BA6vmhuw7VH99NdzZymXfmCFLKuBjRykTMzRdJE1pNKbJWL9Kn1GTCnnIh5SwSoABv6BYZzcyV5pOVpHZzeirgQyuM/fKGklVkEWYFTO9yiMCfOrjwqNaVb5W8m/3XZnZVS8/hoWwc0tDuoSlOh9JwUAvc5z9+VV5+WQitzd/dyXAtgpuILr8HwaayrTD+uGiEQUwOIarxlLfL7rTPxWLV01iohEbRe1ZcGGAJfQvfIUA3G5SGo9+Y1MjCStMiI6tbljv2EGcx9rYZXjt/WFG9smR4m+PRSyKo= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0bd19eae-e1e1-48bc-5eb4-08dc37c6fa20 X-MS-Exchange-CrossTenant-AuthSource: MN2PR10MB4382.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2024 19:04:52.0764 (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: yEds0DuWqYWS2+EALtce9FBK9NPBC4ZTXwzFvddzR/g3CpXXvxPNf3/loqtoUv3HIYvJam6fKVl2UlM1HmB6rHb6IW37sPnVqVvZg9NtEz8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4416 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-27_06,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 malwarescore=0 adultscore=0 mlxscore=0 mlxlogscore=999 phishscore=0 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402270148 X-Proofpoint-GUID: 6MMcg8W7ynGd5utFT0cD09VWvSpCbVO7 X-Proofpoint-ORIG-GUID: 6MMcg8W7ynGd5utFT0cD09VWvSpCbVO7 X-Spam-Status: No, score=-12.9 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, T_SCC_BODY_TEXT_LINE 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: 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 BPF applications, when generating BTF information should always create a .BTF.ext section. Current implementation was only creating it when -mco-re option was used. This patch makes .BTF.ext always be generated for BPF target objects. The patch also adds conditions around btf_finalize function call such that BTF deallocation happens later for BPF target. For BPF, btf_finalize is only called after .BTF.ext is generated. gcc/ChangeLog: * config/bpf/bpf.cc (bpf_option_override): Make .BTF.ext enabled by default for BPF. (bpf_file_end): Call BTF deallocation. * dwarf2ctf.cc (ctf_debug_finalize): Conditionally execute BTF deallocation. --- gcc/config/bpf/bpf.cc | 20 +++++++++----------- gcc/dwarf2ctf.cc | 12 ++++++------ 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/gcc/config/bpf/bpf.cc b/gcc/config/bpf/bpf.cc index d6ca47eeecbe..4318b26b9cda 100644 --- a/gcc/config/bpf/bpf.cc +++ b/gcc/config/bpf/bpf.cc @@ -195,10 +195,8 @@ bpf_option_override (void) if (TARGET_BPF_CORE && !btf_debuginfo_p ()) error ("BPF CO-RE requires BTF debugging information, use %<-gbtf%>"); - /* To support the portability needs of BPF CO-RE approach, BTF debug - information includes the BPF CO-RE relocations. */ - if (TARGET_BPF_CORE) - write_symbols |= BTF_WITH_CORE_DEBUG; + /* BPF applications always generate .BTF.ext. */ + write_symbols |= BTF_WITH_CORE_DEBUG; /* Unlike much of the other BTF debug information, the information necessary for CO-RE relocations is added to the CTF container by the BPF backend. @@ -218,10 +216,7 @@ bpf_option_override (void) /* -gbtf implies -mcore when using the BPF backend, unless -mno-co-re is specified. */ if (btf_debuginfo_p () && !(target_flags_explicit & MASK_BPF_CORE)) - { - target_flags |= MASK_BPF_CORE; - write_symbols |= BTF_WITH_CORE_DEBUG; - } + target_flags |= MASK_BPF_CORE; /* Determine available features from ISA setting (-mcpu=). */ if (bpf_has_jmpext == -1) @@ -267,7 +262,7 @@ bpf_option_override (void) static void bpf_asm_init_sections (void) { - if (TARGET_BPF_CORE) + if (btf_debuginfo_p () && btf_with_core_debuginfo_p ()) btf_ext_init (); } @@ -279,8 +274,11 @@ bpf_asm_init_sections (void) static void bpf_file_end (void) { - if (TARGET_BPF_CORE) - btf_ext_output (); + if (btf_debuginfo_p () && btf_with_core_debuginfo_p ()) + { + btf_ext_output (); + btf_finalize (); + } } #undef TARGET_ASM_FILE_END diff --git a/gcc/dwarf2ctf.cc b/gcc/dwarf2ctf.cc index 93e5619933fa..dca86edfffa9 100644 --- a/gcc/dwarf2ctf.cc +++ b/gcc/dwarf2ctf.cc @@ -944,7 +944,10 @@ ctf_debug_finalize (const char *filename, bool btf) if (btf) { btf_output (filename); - btf_finalize (); + /* btf_finalize when compiling BPF applciations gets deallocated by the + BPF target in bpf_file_end. */ + if (btf_debuginfo_p () && !btf_with_core_debuginfo_p ()) + btf_finalize (); } else @@ -1027,11 +1030,8 @@ ctf_debug_finish (const char * filename) /* Emit BTF debug info here when CO-RE relocations need to be generated. BTF with CO-RE relocations needs to be generated when CO-RE is in effect for the BPF target. */ - if (btf_with_core_debuginfo_p ()) - { - gcc_assert (btf_debuginfo_p ()); - ctf_debug_finalize (filename, btf_debuginfo_p ()); - } + if (btf_debuginfo_p () && btf_with_core_debuginfo_p ()) + ctf_debug_finalize (filename, btf_debuginfo_p ()); } #include "gt-dwarf2ctf.h" From patchwork Tue Feb 27 19:04:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cupertino Miranda X-Patchwork-Id: 86474 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 2EA4D3858408 for ; Tue, 27 Feb 2024 19:06:39 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by sourceware.org (Postfix) with ESMTPS id 101823858D20 for ; Tue, 27 Feb 2024 19:05:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 101823858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none 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 101823858D20 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=1709060706; cv=pass; b=kHhizdgRvav5tlgKQnYF8OyPVLJmreg899tmqq7CHHcyDEuJIGfdvkMsg/mDFsPetbbYiPQDeUH35BiGUcUigl03VVLQkqmmp10h2T/n1IfWsu8LeOpLT+xQ9REqAhhWboY3PP2r4Y92X333FALgvbcdfv4OYOWz+XAP5UXxqc4= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1709060706; c=relaxed/simple; bh=9nITQMrN+oZGRZnT+YN4ltV6XrNBi7J12G6E2jRcCDA=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-Id: MIME-Version; b=LmFSMERP8tWAbffaimPs9Qvny8TL6l1xN3RmEQo0CEax9eUmt/xADm7Sg3g+6tTQH5eLTxUwVjlx/DlG8RuVvfNNniRvCbSZ2IaT1NzmdpkIrRRWD+Hu3HcM2cH5GcN7PoCQH4KLXNoXFcKjPgB9rQYdnaR9dHMgqa9VP937EDM= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41RFYnHC009983 for ; Tue, 27 Feb 2024 19:05:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=WxKnsS3gu5IEZP4PyKXcvk8vAkKL+3hnJApZnWZtl9Y=; b=QP3uyJ1A4LzSUzBOVI5H5dMhEcyrpVpMnLZvE2cAXvjn40mj/+AsGByyaAZO9wEJjj9m rvDd4tF78zoA0bQzVPzB4IAUWp+VcDw8yW+NYoGVqbJGbCTO27aEAMWkC8VMKDKHZDTa JdbTLPLv5ufrEBvsqoxmBAONrdC+lJ/15OgsMhkx7Kd5sF4xLHz1BefNIxGOxrZMevOO wKK3yaYUJXWCRWsvcsEjaQsX+aK+TN8MP4O5TFksggoqbsJ5aVV26qY2OV4+LEcXNb4b oPUdsdY9icb9eTm4gdWx5pkB/fQknDX7F949+W4/hx2M/A0+9RcYbNJlJfZm1RjG6OkP Iw== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wf82u7ydx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Feb 2024 19:04:59 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41RHwK1W019266 for ; Tue, 27 Feb 2024 19:04:59 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2100.outbound.protection.outlook.com [104.47.55.100]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wgbdkj0a6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Feb 2024 19:04:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bUSnTW7h2iVCDYNzoe14Mi1KinXJXM9jJN9kFPHERE2G4YUY00ZO4m3C85HXkULWTirN0x8AvNenFZ5c6wLhAxe/kl2CZ009vsOeqSo/Xq90Uecjb9yx9wUWgK3tgjR9iSWTvzZdF78xeWvTIKpsto0ifsxHV7RmD4AV6Z4YbBVySNvtV389EO8oYHhEpYnkf62rFzyiwsCkUadZwkH+6gzX3Qrd8gvIlcuB6UEP9HB+nnVtzZDBgJ7qi0ujz/wEAO6d4JoQBd3QwcSsqb5aEDxO1ppeTXlo9ch4X4ssRdsIglaDUagXoNIDPYDcdxhmLi2ZNVGTLLgthuc4U58gWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=WxKnsS3gu5IEZP4PyKXcvk8vAkKL+3hnJApZnWZtl9Y=; b=JkYYDET3G1eO143K5gwhxTeHdrhFXygdqQ0wt0WcuNSzfQUrkTRay+bWXH666hOu/gg4sLFUDhCLnxVHVZCD6WKyty43n9aYNkzOZy5ACC+Xhh6AixDaYHhJB627Km4z6EvkKkAzdJ36TFfKyocJldNbVI0SMGRot6v2zEI9AFm5nFNG9efzzjXA9HntgBxJf71sZvsrA508/1xG04jXopXMkOUvwJzwmKUczw5JoymF7X72IxNBGLqU+bct6KxKuYS+wRY4e4pF/u1kDJfc/eWi7nlbDYXsmSdeUdL3JEsIjgPz2/uFyXsorT4LTEaq5MdJPFsaMYWf6BL6gP87mQ== 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=WxKnsS3gu5IEZP4PyKXcvk8vAkKL+3hnJApZnWZtl9Y=; b=lrqAXeciuDwbHB5d3ZtjGahklryqATwwOxUcJPZk1tispXbtvk2z9tU+CtxbrInHrqRpvE0eEYAO/zUkSs4bSntTXyAYqbCUkPbwjii85I3zBs9UY2nWNlu+sSncv1E9Q6eacsLkscJOy8EUdGYRroBLydHbcDMTFFkN4FQfp3Q= Received: from MN2PR10MB4382.namprd10.prod.outlook.com (2603:10b6:208:1d7::13) by SJ0PR10MB4416.namprd10.prod.outlook.com (2603:10b6:a03:2ae::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.36; Tue, 27 Feb 2024 19:04:55 +0000 Received: from MN2PR10MB4382.namprd10.prod.outlook.com ([fe80::8aee:c094:84e2:9401]) by MN2PR10MB4382.namprd10.prod.outlook.com ([fe80::8aee:c094:84e2:9401%4]) with mapi id 15.20.7316.037; Tue, 27 Feb 2024 19:04:55 +0000 From: Cupertino Miranda To: gcc-patches@gcc.gnu.org Cc: jose.marchesi@oracle.com, david.faust@oracle.com, elena.zannoni@oracle.com, indu.bhagat@oracle.com, Cupertino Miranda Subject: [PATCH v2 4/5] bpf: implementation of func_info in .BTF.ext. Date: Tue, 27 Feb 2024 19:04:34 +0000 Message-Id: <20240227190435.35750-5-cupertino.miranda@oracle.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240227190435.35750-1-cupertino.miranda@oracle.com> References: <20240227190435.35750-1-cupertino.miranda@oracle.com> X-ClientProxiedBy: LO4P123CA0050.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:152::19) To MN2PR10MB4382.namprd10.prod.outlook.com (2603:10b6:208:1d7::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN2PR10MB4382:EE_|SJ0PR10MB4416:EE_ X-MS-Office365-Filtering-Correlation-Id: 4a96b5d2-6d59-4503-4877-08dc37c6fc13 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cHWJ0ZIcpjRLwRj4sfsw3jYama0dcwndyCl0W5UuZkhNd2iXEezjtg55d8saCbvsMBZ9JjBEpGfiD1VPW3xy8dEsZuZ5FvrphDfVtjM6An1liYbaTg8t74Fli8MScKWQSENFHLGtPOYttYEs5daqbZ8VUEGN5UNmRZDO3ioUA8cKzTMCDOeXs4koWQlG+uCUYfIluiD/Ef1093ncw/6N/2ZfiMPXc8R5wR6e78z1Pnlipdug1k1U37LNfYwsvEtZhxnEhtXxe9+1nh5omkXoenIbof/sbecr8ty8zQqsDNinWZJQdwkb+fPtx0BQGrwDLHeDlZstlHCmbCaBgmAQ8sL25T2Oj8z8kR2SFqB87ymTiaBMvRdQHUO8oCTcF6Fs/B61R/sgQ/p1FZd0MlIbpQkyzrYeXN+UrgxrghkGYXZV3uaCKPlqQAf2g0MuN8N/HcJscqUYekEziM0AfQo8wTwtZ/u6tIq9pW9y1sQpZZbKvvGP3MfHpbsN8Qg8EEj79tvPqNeAJe7p487MuJLP3L5XY23y8pOVrxcjhzTJuEqfebkpgWtS78+5Ufq8IKY/m+5h8MDeL0WhX4FZW7ubTyRzOaWzlLNMtmqJpkQNOMTkr3SpzhpbTE3iLzJB+3X0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR10MB4382.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9LgVSg+5kX9AmwS/RO2ALF26IuOxmhSmpR+VHHvNuD8lBmaMG6ZgNIF4MvMR8ZAGL5+FtznclBOdW0RS4G5lKmn/ghEWqKy7VtsLJ+58v1Id+R+sDetyOwmDYOwr1wBSWkaaJJWXB7JSva9gVszAA0Um72G0PX9KpEXgSaJEEgutP2vnOOdAcazUebMDplsGjwTHVBl13f1VdfRPPCY4wErj6dSxl6yYBsznsJtLnwJDw78MLO5GSytGIeOu/A1wnL+LvKJXO6H6cUWMUNAcqnow1G6kmy9sRcsReBakGvlnXss4YORcm5vw2QdbL98tZwtiDDhO/zo0FdqzfXXgbgNE4uUQBZx01C6DaU9HlbVS7/vKhayWU7STpKOPsbf90hesdtOoS9UWtBctMJxw8rZubgLk/laznEKFmudV3VpuSTE0nYmjmHlvZrzSDEnRwyRMWJ0+E98exFbvfLSuLghxA0CGevy6m1AD5d+s5v5SyC1Une0SD71MOvMdL8zwRV15E0cb6d0FDbaepgMHDpNFlv27U8Pw1mmr41AXVOy/M8FaHMW8uNs9cm3qVESRVbnWFJs5JAQAKYkwSY+2zc/gJnzPjYoBLemY39y41pnz0fk9KuhRVYstP6kMP/jXM1UOARIFR24temU3vKT4hPJHOZSp8JLkuRHuHpTw7rvXkW2DkGH6POxEREvygVVP8ZcLSj2jOoWipTUs7u6vAPWW6KqBfsRwR5IjzdMainvAf/floEF3WEXA5Zz3Qd5v0lHQ6JEL73IsGEIu3tffD3ywVVAp6mVXABc5CYnAtJ1cxSX4Vz0bRge4KyGd/FMnQ3z2iNgLp3e2pSctSjljOwiy9SgKJ/nuTfIUBnLC2H8YQynvYmche3Xhgawu2LvWua99GjYJAqLvbUkH5KmQ0zsXR9yjlkymvnBrrf+gJictl2k7VflGaUda35VH/+HorbaeSpL/fqRKr7aZ8xbmN3LbucT0J83CRgxTMVkyVBlUdAp5Ir5UVLS/iMp8sTWMyuWrdWqaZ193XFtwa4X57Zg2WulA9FVHHRZaV5c3FLixMSQeQ8xqsqRz1V/TalhbePaViaISYNERVBV/Je8zYt2RBzgZxYoSSD0zfQFa/4BEt2X/pLIuVd1WqOvefblQbrLLGE3tCo79sKCe0P63AVMoMKsjnIVYi+lKckKM370TnOVQKHH6PkQ5d9xc8jSoecdw44m0PkCkUY/YK+Q9TkroYvP7T5giqDNXlwzLp4+EXrB39951ZXRCwTbZtyzNg3NBdgjX+m0HoSMnynjOzWeRZgNC5H30Z4q7aA5QHk3QWOGmlpWg9R9e7Sp8vgdPzDVl4l2McsrT8WY2hN1Rvia0SvUpkD3iCU1wZa7Tfs98Hdd9hty/WsG46CUXCwzAUAj+Q8xzYWOq0LznqZrZDeCoWazxNJLQhVSOWM4Pf5sRTKmz4FdvydGDwsfRRriRpS23gIRmv5yO0fGWImRdChlktwqQqOZUUhpWotyYwirbLIbeGWML1gxqnNlqo3Qq/xMn7ZSQRByxuoY6+i1Ox2oR/BK/k2Im5j6DKm26V84A9Tp51sAHpYPnkBZc2DrFI2Gt3BF0UqmxwH1PjjHz/AtNx7O7SkaAH5Lul+V5ufc= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: VlES7fIheNUg42GvSpelYJTFHEjo3P+pGWpSG+5Zb2C0X76vZLJI8EZrbgLEaEfgbrc+Z5H+yytkqcoZOIy0WTwEbei4LDcYNQRUR6k67G65kd2/S6SlbyuICgkEMqf8e7gSxmTOeU1Jq0O6nC5oYGpYYInUWii1T8hThPbGQw1geaTXarnHbML0cly/YsnVkgkInunb/87bz+UFAE+8IvCstb8UfQwjhEP9G8iTJfVnSRWVS/8eADunpkW5FKvE+hTdTvG1yoHUewYeAd42KNVKCpq2M8EPBHaHuewa3srzkVjrYPe8Cp5jGa9nXJKQPOqJMmHGEnYTR/rMnvzeQrwiKFRCaYUdOW5Xd5lRKMntSALge5xL1gsNz8Q6suvPvgwcVr+fctLFhrkDeE71SPkzLRSWSCuk18PArwBYICs1SKH0tBk0G3/RnzlO7v7FuaDFxHhkJ5UPs/hTxsnVm8oHqerVWwpZs6mkdAfRD7dYsORsuPKr+OZXFO7AUSQ4v75rhilxSxqN6LTBD+H9xtrnIzQ9qgBhk06Dhz67Mt8zn6/1o2kyBmFcTa4Ert6PCKXeDzB+vIMXl3rBCMMSl1uW+MXzXK6RkFP+qBFjN1s= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4a96b5d2-6d59-4503-4877-08dc37c6fc13 X-MS-Exchange-CrossTenant-AuthSource: MN2PR10MB4382.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2024 19:04:55.3996 (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: CL9KlKh6ciKrLGjTBhmFgYXW9Ba8fo/44R3K1amzFbcNbidT8vFZADCLRWMK22S+Vk8y8IL07mrDDQazELmWkrrqXpU6wnaNyaPIpRCKMx0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4416 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-27_06,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 phishscore=0 mlxscore=0 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402270148 X-Proofpoint-GUID: pjrh1zdv-IKuyFM4E6n3Gkrue0TpPlok X-Proofpoint-ORIG-GUID: pjrh1zdv-IKuyFM4E6n3Gkrue0TpPlok X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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: 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 Kernel verifier complains in some particular cases for missing func_info implementation in .BTF.ext. This patch implements it. Strings are cached locally in coreout.cc to avoid adding duplicated strings in the string list. This string deduplication should eventually be moved to the CTFC functions such that this happens widely. With this implementation, the CO-RE relocations information was also simplified and integrated with the FuncInfo structures. gcc/Changelog: PR target/113453 * config/bpf/bpf.cc (bpf_function_prologue): Defined target hook. * config/bpf/coreout.cc (brf_ext_info_section) (btf_ext_info): Moved from coreout.h (btf_ext_funcinfo, btf_ext_lineinfo): Added struct. (bpf_core_reloc): Renamed to btf_ext_core_reloc. (btf_ext): Added static variable. (btfext_info_sec_find_or_add, SEARCH_NODE_AND_RETURN) (bpf_create_or_find_funcinfo, bpt_create_core_reloc) (btf_ext_add_string, btf_funcinfo_type_callback) (btf_add_func_info_for, btf_validate_funcinfo) (btf_ext_info_len, output_btfext_func_info): Added function. (output_btfext_header, bpf_core_reloc_add) (output_btfext_core_relocs, btf_ext_init, btf_ext_output): Changed to support new structs. * config/bpf/coreout.h (btf_ext_funcinfo, btf_ext_lineinfo): Moved and changed in coreout.cc. (btf_add_func_info_for, btf_ext_add_string): Added prototypes. gcc/testsuite/ChangeLog: PR target/113453 * gcc.target/bpf/btfext-funcinfo-nocore.c: Added. * gcc.target/bpf/btfext-funcinfo.c: Added. * gcc.target/bpf/core-attr-5.c: Fixed regexp. * gcc.target/bpf/core-attr-6.c: Fixed regexp. * gcc.target/bpf/core-builtin-fieldinfo-offset-1.c: Fixed regexp. * gcc.target/bpf/core-section-1.c: Fixed regexp --- gcc/config/bpf/bpf.cc | 12 + gcc/config/bpf/coreout.cc | 518 +++++++++++++----- gcc/config/bpf/coreout.h | 20 +- .../gcc.target/bpf/btfext-funcinfo-nocore.c | 42 ++ .../gcc.target/bpf/btfext-funcinfo.c | 46 ++ gcc/testsuite/gcc.target/bpf/core-attr-5.c | 9 +- gcc/testsuite/gcc.target/bpf/core-attr-6.c | 6 +- .../bpf/core-builtin-fieldinfo-offset-1.c | 13 +- gcc/testsuite/gcc.target/bpf/core-section-1.c | 2 +- 9 files changed, 506 insertions(+), 162 deletions(-) create mode 100644 gcc/testsuite/gcc.target/bpf/btfext-funcinfo-nocore.c create mode 100644 gcc/testsuite/gcc.target/bpf/btfext-funcinfo.c diff --git a/gcc/config/bpf/bpf.cc b/gcc/config/bpf/bpf.cc index 4318b26b9cda..ea47e3a8dbfb 100644 --- a/gcc/config/bpf/bpf.cc +++ b/gcc/config/bpf/bpf.cc @@ -385,6 +385,18 @@ bpf_compute_frame_layout (void) #undef TARGET_COMPUTE_FRAME_LAYOUT #define TARGET_COMPUTE_FRAME_LAYOUT bpf_compute_frame_layout +/* Defined to initialize data for func_info region in .BTF.ext section. */ + +static void +bpf_function_prologue (FILE *f ATTRIBUTE_UNUSED) +{ + if (btf_debuginfo_p ()) + btf_add_func_info_for (cfun->decl, current_function_func_begin_label); +} + +#undef TARGET_ASM_FUNCTION_PROLOGUE +#define TARGET_ASM_FUNCTION_PROLOGUE bpf_function_prologue + /* Expand to the instructions in a function prologue. This function is called when expanding the 'prologue' pattern in bpf.md. */ diff --git a/gcc/config/bpf/coreout.cc b/gcc/config/bpf/coreout.cc index 2f06ec2a0f29..31b2abc3151b 100644 --- a/gcc/config/bpf/coreout.cc +++ b/gcc/config/bpf/coreout.cc @@ -31,6 +31,7 @@ #include "btf.h" #include "rtl.h" #include "tree-pretty-print.h" +#include "cgraph.h" #include "coreout.h" @@ -95,64 +96,193 @@ result, a single .BTF.ext section can contain CO-RE relocations for multiple programs in distinct sections. */ -/* Internal representation of a BPF CO-RE relocation record. */ +/* BTF.ext debug info section. */ +static GTY (()) section * btf_ext_info_section; + +#ifndef BTF_EXT_INFO_SECTION_NAME +#define BTF_EXT_INFO_SECTION_NAME ".BTF.ext" +#endif +#define BTF_EXT_INFO_SECTION_FLAGS (SECTION_DEBUG) + +#ifndef BTF_EXT_INFO_SECTION_LABEL +#define BTF_EXT_INFO_SECTION_LABEL "Lbtfext" +#endif + +#define MAX_BTF_EXT_LABEL_BYTES 40 +static char btf_ext_info_section_label[MAX_BTF_EXT_LABEL_BYTES]; + +/* A funcinfo record, in the .BTF.ext funcinfo section. */ +struct GTY ((chain_next ("%h.next"))) btf_ext_funcinfo +{ + uint32_t type; /* Type ID of a BTF_KIND_FUNC type. */ + const char *fnname; + const char *label; + + struct btf_ext_funcinfo *next; /* Linked list to collect func_info elems. */ +}; + +/* A lineinfo record, in the .BTF.ext lineinfo section. */ +struct GTY ((chain_next ("%h.next"))) btf_ext_lineinfo +{ + uint32_t insn_off; /* Offset of the instruction. */ + uint32_t file_name_off; /* Offset of file name in BTF string table. */ + uint32_t line_off; /* Offset of source line in BTF string table. */ + uint32_t line_col; /* Line number (bits 31-11) and column (11-0). */ -typedef struct GTY (()) bpf_core_reloc { + struct btf_ext_lineinfo *next; /* Linked list to collect line_info elems. */ +}; + +/* Internal representation of a BPF CO-RE relocation record. */ +struct GTY ((chain_next ("%h.next"))) btf_ext_core_reloc { unsigned int bpfcr_type; /* BTF type ID of container. */ unsigned int bpfcr_astr_off; /* Offset of access string in .BTF string table. */ rtx_code_label * bpfcr_insn_label; /* RTX label attached to instruction to patch. */ enum btf_core_reloc_kind bpfcr_kind; /* Kind of relocation to perform. */ -} bpf_core_reloc_t; -typedef bpf_core_reloc_t * bpf_core_reloc_ref; + struct { + const char *accessor_str; + tree type; + } info; -/* Internal representation of a CO-RE relocation (sub)section of the - .BTF.ext information. One such section is generated for each ELF section - in the output object having relocations that a BPF loader must resolve. */ + struct btf_ext_core_reloc *next; +}; -typedef struct GTY (()) bpf_core_section { - /* Name of ELF section to which these CO-RE relocations apply. */ - const char * name; +/* Main data structure to keep .BTF.ext section data. */ +struct GTY ((chain_next ("%h.next"))) btf_ext_info_sec { + const char *sec_name; + uint32_t sec_name_off; /* offset to section name. */ + + struct { + uint32_t num_info; + struct btf_ext_funcinfo *head; + } func_info; + struct { + uint32_t num_info; + struct btf_ext_lineinfo *head; + } line_info; + struct { + uint32_t num_info; + struct btf_ext_core_reloc *head; + } core_info; + + struct btf_ext_info_sec *next; +}; - /* Offset of section name in .BTF string table. */ - uint32_t name_offset; +static GTY (()) struct btf_ext_info_sec *btf_ext = NULL; - /* Relocations in the section. */ - vec * GTY (()) relocs; -} bpf_core_section_t; +/* Helper function to add a section structure to the linked list with entry + point in info static variable. */ -typedef bpf_core_section_t * bpf_core_section_ref; +static struct btf_ext_info_sec * +btfext_info_sec_find_or_add (const char *sec_name, bool add) +{ + struct btf_ext_info_sec **tmp = &btf_ext; -/* BTF.ext debug info section. */ + while (*tmp != NULL) + { + if (strcmp ((*tmp)->sec_name, sec_name) == 0) + return *tmp; + tmp = &((*tmp)->next); + } -static GTY (()) section * btf_ext_info_section; + if (add == false) + return NULL; -static int btf_ext_label_num; + struct btf_ext_info_sec *ret = ggc_cleared_alloc (); + *tmp = ret; -#ifndef BTF_EXT_INFO_SECTION_NAME -#define BTF_EXT_INFO_SECTION_NAME ".BTF.ext" -#endif + /* Set data for section info. */ + ret->sec_name = sec_name; + ret->sec_name_off = btf_ext_add_string (sec_name); -#define BTF_EXT_INFO_SECTION_FLAGS (SECTION_DEBUG) + return ret; +} -#define MAX_BTF_EXT_LABEL_BYTES 40 +#define SEARCH_NODE_AND_RETURN(TYPE, FIELD, CONDITION) ({ \ + TYPE **head = &(FIELD); \ + while (*head != NULL) \ + { \ + if (CONDITION) \ + return (*head); \ + head = &((*head)->next); \ + } \ + head; \ +}) + +/* Function to create or find a funcinfo node in info. */ + +static struct btf_ext_funcinfo * +bpf_create_or_find_funcinfo (const char *fnname, const char *sec_name, + btf_ext_info_sec **in_sec = NULL) +{ + struct btf_ext_info_sec *sec_elem = + btfext_info_sec_find_or_add (sec_name, true); -static char btf_ext_info_section_label[MAX_BTF_EXT_LABEL_BYTES]; + if (in_sec != NULL) + *in_sec = sec_elem; -#ifndef BTF_EXT_INFO_SECTION_LABEL -#define BTF_EXT_INFO_SECTION_LABEL "Lbtfext" -#endif + struct btf_ext_funcinfo **head = + SEARCH_NODE_AND_RETURN(struct btf_ext_funcinfo, + sec_elem->func_info.head, + strcmp ((*head)->fnname, fnname) == 0); -static GTY (()) vec *bpf_core_sections; + *head = ggc_cleared_alloc (); + (*head)->fnname = fnname; + (*head)->label = NULL; -struct GTY(()) bpf_core_extra { - const char *accessor_str; - tree type; + return *head; +} + +/* Function to create a core_reloc node in info. */ + +static struct btf_ext_core_reloc * +bpf_create_core_reloc (const char *sec_name, + struct btf_ext_info_sec **in_sec = NULL) +{ + struct btf_ext_info_sec *sec_elem = + btfext_info_sec_find_or_add (sec_name, true); + + if (in_sec != NULL) + *in_sec = sec_elem; + + struct btf_ext_core_reloc **head = + SEARCH_NODE_AND_RETURN(struct btf_ext_core_reloc, + sec_elem->core_info.head, + false); + + *head = ggc_cleared_alloc (); + + return *head; +} + +/* String caching to avoid repeated strings added to BTF string table. */ +struct GTY((chain_next ("%h.next"))) string_cache { + const char *str; + unsigned int offset; + struct string_cache *next; }; -typedef struct bpf_core_extra *bpf_core_extra_ref; -static GTY(()) hash_map *bpf_comment_info; +static GTY(()) struct string_cache *btf_ext_strings = NULL; + +unsigned int +btf_ext_add_string (const char *str) +{ + ctf_container_ref ctfc = ctf_get_tu_ctfc (); + struct string_cache **tmp = &btf_ext_strings; + while (*tmp != NULL) + { + if (strcmp ((*tmp)->str, str) == 0) + return (*tmp)->offset; + tmp = &((*tmp)->next); + } + + *tmp = ggc_cleared_alloc (); + (*tmp)->str = ggc_strdup (str); + ctf_add_string (ctfc, (*tmp)->str, &((*tmp)->offset), CTF_AUX_STRTAB); + + return (*tmp)->offset; +} /* Create a new BPF CO-RE relocation record, and add it to the appropriate CO-RE section. */ @@ -162,42 +292,23 @@ bpf_core_reloc_add (const tree type, const char * section_name, rtx_code_label *label, enum btf_core_reloc_kind kind) { - bpf_core_reloc_ref bpfcr = ggc_cleared_alloc (); - bpf_core_extra_ref info = ggc_cleared_alloc (); + struct btf_ext_info_sec *sec = NULL; + struct btf_ext_core_reloc *bpfcr = bpf_create_core_reloc (section_name, &sec); + ctf_container_ref ctfc = ctf_get_tu_ctfc (); /* Buffer the access string in the auxiliary strtab. */ - ctf_add_string (ctfc, accessor, &(bpfcr->bpfcr_astr_off), CTF_AUX_STRTAB); + bpfcr->bpfcr_astr_off = 0; + if (accessor != NULL) + bpfcr->bpfcr_astr_off = btf_ext_add_string (accessor); bpfcr->bpfcr_type = get_btf_id (ctf_lookup_tree_type (ctfc, type)); bpfcr->bpfcr_insn_label = label; bpfcr->bpfcr_kind = kind; - info->accessor_str = accessor; - info->type = type; - bpf_comment_info->put (bpfcr, info); - - /* Add the CO-RE reloc to the appropriate section. */ - bpf_core_section_ref sec; - int i; - FOR_EACH_VEC_ELT (*bpf_core_sections, i, sec) - if (strcmp (sec->name, section_name) == 0) - { - vec_safe_push (sec->relocs, bpfcr); - return; - } + bpfcr->info.accessor_str = accessor; + bpfcr->info.type = type; - /* If the CO-RE section does not yet exist, create it. */ - sec = ggc_cleared_alloc (); - - ctf_add_string (ctfc, section_name, &sec->name_offset, CTF_AUX_STRTAB); - if (strcmp (section_name, "")) - ctfc->ctfc_aux_strlen += strlen (section_name) + 1; - - sec->name = section_name; - vec_alloc (sec->relocs, 1); - vec_safe_push (sec->relocs, bpfcr); - - vec_safe_push (bpf_core_sections, sec); + sec->core_info.num_info += 1; } /* Return the 0-based index of the field NODE in its containing struct or union @@ -243,6 +354,113 @@ bpf_core_get_sou_member_index (ctf_container_ref ctfc, const tree node) return -1; } +/* Helper function to check if a particular named function exists as a + BTF_KIND_FUNC type record. */ + +static bool +btf_funcinfo_type_callback (ctf_dtdef_ref func, void *data) +{ + struct btf_ext_funcinfo *info = (struct btf_ext_funcinfo *) data; + if (strcmp (func->dtd_name, info->fnname) == 0) + { + uint32_t type = func->dtd_type; + info->type = type; + return true; + } + return false; +} + +/* Entry point function to add a func_info in local data structures + represented by info static variable. + This function is used in bpf.cc. */ + +struct btf_ext_funcinfo * +btf_add_func_info_for (tree decl, const char *label) +{ + const char *fnname = IDENTIFIER_POINTER (DECL_NAME (decl)); + const char *sec_name = decl_section_name (decl); + + /* Finding suffixed function names, due to the function cloning base on + optimizations. + This is required to recover the original function name that is the one + used in BTF_KIND_FUNC type records. */ + const char *cp_ptr = strstr (fnname, "."); + if (cp_ptr != NULL) + { + char new_name[100]; + strcpy (new_name, fnname); + int pos = cp_ptr - fnname; + new_name[pos] = 0; + fnname = ggc_strdup (new_name); + } + + if (sec_name == NULL) + sec_name = ".text"; + + struct btf_ext_info_sec *sec = NULL; + struct btf_ext_funcinfo *info = + bpf_create_or_find_funcinfo (fnname, sec_name, &sec); + + info->label = label; + return info; +} + +/* This function traverses all func_info entries and verified they do have a + BTF_KIND_FUNC type record associated. If they do not it is marked as + invalided by clearing the associated label. */ + +static void +btf_validate_funcinfo (btf_ext_info_sec *sec) +{ + while (sec != NULL) + { + struct btf_ext_funcinfo *funcinfo = sec->func_info.head; + while (funcinfo != NULL) + { + bool found = traverse_btf_func_types (btf_funcinfo_type_callback, + funcinfo); + if (found == true) + sec->func_info.num_info += 1; + else + funcinfo->label = NULL; + + funcinfo = funcinfo->next; + } + sec = sec->next; + } +} + +/* Compute the section size in section for func_info, line_info and core_info + regions of .BTF.ext. */ + +static void +btf_ext_info_len (uint32_t *fi_len, uint32_t *li_len, uint32_t *cr_len) +{ + *fi_len = *li_len = *cr_len = 0; + struct btf_ext_info_sec *tmp = btf_ext; + if (tmp != NULL) + while (tmp != NULL) + { + /* Size computation does 8 bytes per section entry plus num_info of the + * respective structure size: + - 8 bytes for func_info, + - 16 bytes for both line_info and core_info. */ + if (tmp->func_info.num_info > 0) + *fi_len += 8 + (8 * tmp->func_info.num_info); + if (tmp->line_info.num_info > 0) + *li_len += 8 + (16 * tmp->line_info.num_info); + if (tmp->core_info.num_info > 0) + *cr_len += 8 + (16 * tmp->core_info.num_info); + tmp = tmp->next; + } + + /* If there are entries within the regions, add 4 bytes to set the header of + the respective sections that contains the size for each of the entry. */ + *fi_len += *fi_len != 0 ? 4 : 0; + *li_len += *li_len != 0 ? 4 : 0; + *cr_len += *cr_len != 0 ? 4 : 0; +} + /* Compute and output the header of a .BTF.ext debug info section. */ static void @@ -256,23 +474,19 @@ output_btfext_header (void) dw2_asm_output_data (1, 0, "btfext_flags"); dw2_asm_output_data (4, sizeof (struct btf_ext_header), "btfext_hdr_len"); - uint32_t func_info_off = 0, func_info_len = 0; - uint32_t line_info_off = 0, line_info_len = 0; - uint32_t core_relo_off = 0, core_relo_len = 0; + btf_validate_funcinfo (btf_ext); - /* Header core_relo_len is the sum total length in bytes of all CO-RE - relocation sections, plus the 4 byte record size. */ - size_t i; - bpf_core_section_ref sec; - core_relo_len += vec_safe_length (bpf_core_sections) - * sizeof (struct btf_ext_section_header); + uint32_t func_info_len = 0; + uint32_t line_info_len = 0; + uint32_t core_info_len = 0; + btf_ext_info_len (&func_info_len, &line_info_len, &core_info_len); - FOR_EACH_VEC_ELT (*bpf_core_sections, i, sec) - core_relo_len += - vec_safe_length (sec->relocs) * sizeof (struct btf_ext_reloc); + if (!TARGET_BPF_CORE) + core_info_len = 0; - if (core_relo_len) - core_relo_len += sizeof (uint32_t); + uint32_t func_info_off = 0; + uint32_t line_info_off = func_info_len; + uint32_t core_info_off = line_info_off + line_info_len; dw2_asm_output_data (4, func_info_off, "func_info_offset"); dw2_asm_output_data (4, func_info_len, "func_info_len"); @@ -280,47 +494,47 @@ output_btfext_header (void) dw2_asm_output_data (4, line_info_off, "line_info_offset"); dw2_asm_output_data (4, line_info_len, "line_info_len"); - dw2_asm_output_data (4, core_relo_off, "core_relo_offset"); - dw2_asm_output_data (4, core_relo_len, "core_relo_len"); + dw2_asm_output_data (4, core_info_off, "core_relo_offset"); + dw2_asm_output_data (4, core_info_len, "core_relo_len"); } -/* Output a single CO-RE relocation record. */ +/* Outputs func_info region on .BTF.ext. */ static void -output_asm_btfext_core_reloc (bpf_core_reloc_ref bpfcr) +output_btfext_func_info (struct btf_ext_info_sec *sec) { - bpf_core_extra_ref *info = bpf_comment_info->get (bpfcr); - gcc_assert (info != NULL); - - bpfcr->bpfcr_astr_off += ctfc_get_strtab_len (ctf_get_tu_ctfc (), - CTF_STRTAB); - - dw2_assemble_integer (4, gen_rtx_LABEL_REF (Pmode, bpfcr->bpfcr_insn_label)); - fprintf (asm_out_file, "\t%s%s\n", - flag_debug_asm ? ASM_COMMENT_START : "", - (flag_debug_asm ? " bpfcr_insn" : "")); - - /* Extract the pretty print for the type expression. */ - pretty_printer pp; - dump_generic_node (&pp, (*info)->type, 0, TDF_VOPS|TDF_MEMSYMS|TDF_SLIM, - false); - char *str = xstrdup (pp_formatted_text (&pp)); - - dw2_asm_output_data (4, bpfcr->bpfcr_type, "bpfcr_type (%s)", str); - dw2_asm_output_data (4, bpfcr->bpfcr_astr_off, "bpfcr_astr_off (\"%s\")", - (*info)->accessor_str); - dw2_asm_output_data (4, bpfcr->bpfcr_kind, "bpfcr_kind"); -} - -/* Output all CO-RE relocation records for a section. */ - -static void -output_btfext_core_relocs (bpf_core_section_ref sec) -{ - size_t i; - bpf_core_reloc_ref bpfcr; - FOR_EACH_VEC_ELT (*(sec->relocs), i, bpfcr) - output_asm_btfext_core_reloc (bpfcr); + unsigned int str_aux_off = ctfc_get_strtab_len (ctf_get_tu_ctfc (), + CTF_STRTAB); + bool executed = false; + while (sec != NULL) + { + uint32_t count = 0; + if (sec->func_info.num_info > 0) + { + if (executed == false && (executed = true)) + dw2_asm_output_data (4, 8, "FuncInfo entry size"); + dw2_asm_output_data (4, sec->sec_name_off + str_aux_off, + "FuncInfo section string for %s", + sec->sec_name); + dw2_asm_output_data (4, sec->func_info.num_info, "Number of entries"); + + struct btf_ext_funcinfo *elem = sec->func_info.head; + while (elem != NULL) + { + if (elem->label != NULL) + { + count += 1; + dw2_asm_output_offset (4, elem->label, + NULL, "label for function %s", elem->fnname); + dw2_asm_output_data (4, elem->type, "btf_type_id"); + } + elem = elem->next; + } + } + + gcc_assert (count == sec->func_info.num_info); + sec = sec->next; + } } /* Output all CO-RE relocation sections. */ @@ -328,28 +542,51 @@ output_btfext_core_relocs (bpf_core_section_ref sec) static void output_btfext_core_sections (void) { - size_t i; - bpf_core_section_ref sec; - - /* BTF Ext section info. */ - dw2_asm_output_data (4, sizeof (struct btf_ext_reloc), - "btfext_core_info_rec_size"); - - FOR_EACH_VEC_ELT (*bpf_core_sections, i, sec) + struct btf_ext_info_sec *sec = btf_ext; + unsigned int str_aux_off = ctfc_get_strtab_len (ctf_get_tu_ctfc (), + CTF_STRTAB); + bool executed = false; + while (sec != NULL) { - /* Section name offset, refers to the offset of a string with the name of - the section to which these CORE relocations refer, e.g. '.text'. - The string is buffered in the BTF strings table. */ - - /* BTF specific strings are in CTF_AUX_STRTAB, which is concatenated - after CTF_STRTAB. Add the length of STRTAB to the final offset. */ - sec->name_offset += ctfc_get_strtab_len (ctf_get_tu_ctfc (), CTF_STRTAB); - - dw2_asm_output_data (4, sec->name_offset, "btfext_secinfo_sec_name_off"); - dw2_asm_output_data (4, vec_safe_length (sec->relocs), - "btfext_secinfo_num_recs"); - - output_btfext_core_relocs (sec); + uint32_t count = 0; + if (sec->core_info.num_info > 0) + { + if (executed == false && (executed = true)) + dw2_asm_output_data (4, 16, "CoreInfo entry size"); + dw2_asm_output_data (4, sec->sec_name_off + str_aux_off, + "CoreInfo section string for %s", + sec->sec_name); + dw2_asm_output_data (4, sec->core_info.num_info, "Number of entries"); + + struct btf_ext_core_reloc *bpfcr = sec->core_info.head; + while (bpfcr != NULL) + { + count += 1; + dw2_assemble_integer (4, + gen_rtx_LABEL_REF (Pmode, bpfcr->bpfcr_insn_label)); + fprintf (asm_out_file, "\t%s%s\n", + flag_debug_asm ? ASM_COMMENT_START : "", + (flag_debug_asm ? " bpfcr_insn" : "")); + + /* Extract the pretty print for the type expression. */ + pretty_printer pp; + dump_generic_node (&pp, bpfcr->info.type, 0, + TDF_VOPS|TDF_MEMSYMS|TDF_SLIM, + false); + char *str = xstrdup (pp_formatted_text (&pp)); + + dw2_asm_output_data (4, bpfcr->bpfcr_type, "bpfcr_type (%s)", + str); + dw2_asm_output_data (4, bpfcr->bpfcr_astr_off + str_aux_off, + "bpfcr_astr_off (\"%s\")", + bpfcr->info.accessor_str); + dw2_asm_output_data (4, bpfcr->bpfcr_kind, "bpfcr_kind"); + bpfcr = bpfcr->next; + } + } + + gcc_assert (count == sec->core_info.num_info); + sec = sec->next; } } @@ -362,22 +599,23 @@ btf_ext_init (void) BTF_EXT_INFO_SECTION_FLAGS, NULL); ASM_GENERATE_INTERNAL_LABEL (btf_ext_info_section_label, - BTF_EXT_INFO_SECTION_LABEL, - btf_ext_label_num++); - - vec_alloc (bpf_core_sections, 1); - bpf_comment_info = hash_map::create_ggc (); + "Lbtfext", 0); } + /* Output the entire .BTF.ext section. */ void btf_ext_output (void) { output_btfext_header (); - output_btfext_core_sections (); + output_btfext_func_info (btf_ext); + if (TARGET_BPF_CORE) + output_btfext_core_sections (); - bpf_core_sections = NULL; + /* Extra padding required by BPF code, just in case all structures are empty. + */ + dw2_asm_output_data (4, 0, "Required padding by libbpf structs"); } #include "gt-coreout.h" diff --git a/gcc/config/bpf/coreout.h b/gcc/config/bpf/coreout.h index 8a209f26e94b..1c26b9274739 100644 --- a/gcc/config/bpf/coreout.h +++ b/gcc/config/bpf/coreout.h @@ -38,22 +38,6 @@ struct btf_ext_section_header uint32_t num_records; }; -/* A funcinfo record, in the .BTF.ext funcinfo section. */ -struct btf_ext_funcinfo -{ - uint32_t insn_off; /* Offset of the first instruction of the function. */ - uint32_t type; /* Type ID of a BTF_KIND_FUNC type. */ -}; - -/* A lineinfo record, in the .BTF.ext lineinfo section. */ -struct btf_ext_lineinfo -{ - uint32_t insn_off; /* Offset of the instruction. */ - uint32_t file_name_off; /* Offset of file name in BTF string table. */ - uint32_t line_off; /* Offset of source line in BTF string table. */ - uint32_t line_col; /* Line number (bits 31-11) and column (11-0). */ -}; - enum btf_core_reloc_kind { BPF_RELO_INVALID = -1, @@ -113,6 +97,10 @@ bpf_core_reloc_add (const tree type, const char * section_name, extern int bpf_core_get_sou_member_index (ctf_container_ref, const tree); +struct btf_ext_funcinfo *btf_add_func_info_for (tree decl, + const char *label); +unsigned int btf_ext_add_string (const char *str); + #ifdef __cplusplus } #endif diff --git a/gcc/testsuite/gcc.target/bpf/btfext-funcinfo-nocore.c b/gcc/testsuite/gcc.target/bpf/btfext-funcinfo-nocore.c new file mode 100644 index 000000000000..09d3acc8c2d4 --- /dev/null +++ b/gcc/testsuite/gcc.target/bpf/btfext-funcinfo-nocore.c @@ -0,0 +1,42 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -dA -gbtf -mno-co-re" } */ + +struct T { + int a; + int b; + struct U { + int c; + struct V { + int d; + int e[4]; + int f; + } v; + } u; +} __attribute__((preserve_access_index)); + +__attribute__((section("foo_sec"), used)) +int foo_func (struct T *t) +{ + t->u.c = 5; + return t->u.v.e[3]; +} + +__attribute__((section("bar_sec"), used)) +int bar_func (struct T *t) +{ + int *x = &(t->u.v.f); + int old = *x; + *x = 4; + return old; +} + +/* { dg-final { scan-assembler-times "FuncInfo section string for foo_sec" 1 } } */ +/* { dg-final { scan-assembler-times "FuncInfo section string for bar_sec" 1 } } */ +/* { dg-final { scan-assembler-times "label for function foo_func" 1 } } */ +/* { dg-final { scan-assembler-times "label for function bar_func" 1 } } */ +/* { dg-final { scan-assembler-times ".4byte\t0x1\t# Number of entries" 2 } } */ +/* { dg-final { scan-assembler-times "Required padding" 1 } } */ + +/* { dg-final { scan-assembler-times "ascii \"foo_sec.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ +/* { dg-final { scan-assembler-times "ascii \"bar_sec.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ + diff --git a/gcc/testsuite/gcc.target/bpf/btfext-funcinfo.c b/gcc/testsuite/gcc.target/bpf/btfext-funcinfo.c new file mode 100644 index 000000000000..a59c5bd37eb9 --- /dev/null +++ b/gcc/testsuite/gcc.target/bpf/btfext-funcinfo.c @@ -0,0 +1,46 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -dA -gbtf" } */ + +struct T { + int a; + int b; + struct U { + int c; + struct V { + int d; + int e[4]; + int f; + } v; + } u; +} __attribute__((preserve_access_index)); + +__attribute__((section("foo_sec"), used)) +int foo_func (struct T *t) +{ + t->u.c = 5; + return t->u.v.e[3]; +} + +__attribute__((section("bar_sec"), used)) +int bar_func (struct T *t) +{ + int *x = &(t->u.v.f); + int old = *x; + *x = 4; + return old; +} + +/* { dg-final { scan-assembler-times "FuncInfo section string for foo_sec" 1 } } */ +/* { dg-final { scan-assembler-times "FuncInfo section string for bar_sec" 1 } } */ +/* { dg-final { scan-assembler-times "label for function foo_func" 1 } } */ +/* { dg-final { scan-assembler-times "label for function bar_func" 1 } } */ + +/* { dg-final { scan-assembler-times "ascii \"0:2:1:1:3.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ +/* { dg-final { scan-assembler-times "ascii \"0:2:1:2.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ +/* { dg-final { scan-assembler-times "ascii \"foo_sec.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ +/* { dg-final { scan-assembler-times "ascii \"bar_sec.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ +/* { dg-final { scan-assembler-times "FuncInfo entry size" 1 } } */ + +/* { dg-final { scan-assembler-times ".4byte\t0x1\t# Number of entries" 3 } } */ +/* { dg-final { scan-assembler-times ".4byte\t0x2\t# Number of entries" 1 } } */ +/* { dg-final { scan-assembler-times "Required padding" 1 } } */ diff --git a/gcc/testsuite/gcc.target/bpf/core-attr-5.c b/gcc/testsuite/gcc.target/bpf/core-attr-5.c index c0dc15fbb271..e71901d0d4d1 100644 --- a/gcc/testsuite/gcc.target/bpf/core-attr-5.c +++ b/gcc/testsuite/gcc.target/bpf/core-attr-5.c @@ -55,8 +55,13 @@ func (struct T *t, int i) /* { dg-final { scan-assembler-times "ascii \"0:4.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ /* { dg-final { scan-assembler-times "ascii \"0:1:1:3.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ /* { dg-final { scan-assembler-times "ascii \"0:1:1:1.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ -/* { dg-final { scan-assembler-times "ascii \"0:3.0\"\[\t \]+\[^\n\]*btf_aux_string" 2 } } */ +/* { dg-final { scan-assembler-times "ascii \"0:3.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ /* { dg-final { scan-assembler-times "ascii \"0:0.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:1:1:3\"\\)" 1 } } */ +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:4\"\\)" 1 } } */ +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:3\"\\)" 2 } } */ +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:1:2\"\\)" 1 } } */ +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:1:1:1\"\\)" 1 } } */ +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:0\"\\)" 1 } } */ /* { dg-final { scan-assembler-times "bpfcr_type \\(struct T \\*\\)" 4 } } */ /* { dg-final { scan-assembler-times "bpfcr_type \\(struct U \\*\\)" 4 { xfail *-*-* } } } */ - diff --git a/gcc/testsuite/gcc.target/bpf/core-attr-6.c b/gcc/testsuite/gcc.target/bpf/core-attr-6.c index 858ae627cb8b..34a4c367e528 100644 --- a/gcc/testsuite/gcc.target/bpf/core-attr-6.c +++ b/gcc/testsuite/gcc.target/bpf/core-attr-6.c @@ -37,10 +37,14 @@ func (struct T *t, int i) mset (&t->a); } -/* { dg-final { scan-assembler-times "ascii \"0:3.0\"\[\t \]+\[^\n\]*btf_aux_string" 2 } } */ +/* { dg-final { scan-assembler-times "ascii \"0:3.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ /* { dg-final { scan-assembler-times "ascii \"0:1:1:1.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ /* { dg-final { scan-assembler-times "ascii \"0:1:2.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ /* { dg-final { scan-assembler-times "ascii \"0:0.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:1:1:1\"\\)" 1 } } */ +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:3\"\\)" 2 } } */ +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:1:2\"\\)" 1 } } */ +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:0\"\\)" 1 } } */ /* { dg-final { scan-assembler-times "bpfcr_type \\(struct T \\*\\)" 3 } } */ /* { dg-final { scan-assembler-times "bpfcr_type \\(struct U \\*\\)" 2 } } */ diff --git a/gcc/testsuite/gcc.target/bpf/core-builtin-fieldinfo-offset-1.c b/gcc/testsuite/gcc.target/bpf/core-builtin-fieldinfo-offset-1.c index a4af9a53282a..27654205287d 100644 --- a/gcc/testsuite/gcc.target/bpf/core-builtin-fieldinfo-offset-1.c +++ b/gcc/testsuite/gcc.target/bpf/core-builtin-fieldinfo-offset-1.c @@ -52,9 +52,18 @@ unsigned int foo (struct T *t) /* { dg-final { scan-assembler-times "ascii \"0:1:0:3.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ /* { dg-final { scan-assembler-times "ascii \"0:1:0:4.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ /* { dg-final { scan-assembler-times "ascii \"0:1:1:0.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ -/* { dg-final { scan-assembler-times "ascii \"0:1:1:3.0\"\[\t \]+\[^\n\]*btf_aux_string" 2 } } */ +/* { dg-final { scan-assembler-times "ascii \"0:1:1:3.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ /* { dg-final { scan-assembler-times "ascii \"0:1:1:4.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ /* { dg-final { scan-assembler-times "ascii \"0:2.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ -/* { dg-final { scan-assembler-times "ascii \"0:3.0\"\[\t \]+\[^\n\]*btf_aux_string" 2 } } */ +/* { dg-final { scan-assembler-times "ascii \"0:3.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ + +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:1:0:0\"\\)" 1 } } */ +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:1:0:3\"\\)" 1 } } */ +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:1:0:4\"\\)" 1 } } */ +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:1:1:0\"\\)" 1 } } */ +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:1:1:3\"\\)" 2 } } */ +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:1:1:4\"\\)" 1 } } */ +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:2\"\\)" 1 } } */ +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:3\"\\)" 2 } } */ /* { dg-final { scan-assembler-times "0\[\t \]+\[^\n\]*bpfcr_kind" 10 } } */ diff --git a/gcc/testsuite/gcc.target/bpf/core-section-1.c b/gcc/testsuite/gcc.target/bpf/core-section-1.c index 4f16b087c1a2..c2bac46cee78 100644 --- a/gcc/testsuite/gcc.target/bpf/core-section-1.c +++ b/gcc/testsuite/gcc.target/bpf/core-section-1.c @@ -35,4 +35,4 @@ int bar_func (struct T *t) /* { dg-final { scan-assembler-times "ascii \"foo_sec.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ /* { dg-final { scan-assembler-times "ascii \"bar_sec.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ /* { dg-final { scan-assembler-times "bpfcr_type" 2 } } */ -/* { dg-final { scan-assembler-times "btfext_core_info_rec_size" 1 } } */ +/* { dg-final { scan-assembler-times "CoreInfo entry size" 1 } } */ From patchwork Tue Feb 27 19:04:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cupertino Miranda X-Patchwork-Id: 86473 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 BECBE3858C36 for ; Tue, 27 Feb 2024 19:06:37 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by sourceware.org (Postfix) with ESMTPS id D1C9D3858413 for ; Tue, 27 Feb 2024 19:05:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D1C9D3858413 Authentication-Results: sourceware.org; dmarc=pass (p=none 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 D1C9D3858413 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=1709060706; cv=pass; b=c08J3tO2wpOLew5etEy9FcWEDqj6r0psFTXTQwdP9l8ZEbDlaqniAsODkxrhhj0a4tuuql7U6NaJHVtMCK/bWlVVaevvrYKp9HvBMB/6YREsNtzoKBNTHht7dlpYcyYCVYvnBkL31OLU5yLk++ucPNAivoQmYuSX4+yC1Ain6gQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1709060706; c=relaxed/simple; bh=TNKjHHYb0C4k8Sr+D+/p3N/u1zFM97bHFFgCrnTpk3E=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-Id: MIME-Version; b=uPy2lo/bbWZ8A9jpp8VPo+zKgOp9PMDXKGZjn38BLJQk3i1++NfG3wwmd3iTR4XlJ4WtjcufP+uybl661JODQUVxpN5LDbEQTCYYIW/Ctp5QPXaa7uHEg19c1PFrJcrVlgCXboP39Sb7g3SfyMzJjROKVXtxMXrEa96nLbOQIgE= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41RFYj5K004695 for ; Tue, 27 Feb 2024 19:05:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=zz4+zsK3DFRt7ZccsRe7GIK2T6KrNaIIM6poHg31Isw=; b=UNyymd25rqjXpur3V73nm56h2ayXQmz1M3rD4RVXI5oYtAi5EMaJ24321VsuKamc/Gjt Luej21BeFq3m/gw1jKj7B0T5GjJtMQ3X4KepDEKWTELZHnPnfxJRKjvO2m2LqLSkdnxa i0luxFuAasr3o30UoJvRRmrtKYdav3j4qRr9HyV+puk5104gooliMYQIJeAK/LpwAv4W dMSKAgLttuD14euHM4kb7QxOUllv284vt8eMcwhvu2l0IR7nk63mCdB9tFJeusrynrZL nLWCKG4rqD80ReSvwLQe6MzJ//1Bqw3X06pv6sUOYxuX6KSfywIUnc3DeZk17+CxJZRZ Fw== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wf8bb81cs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Feb 2024 19:05:02 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41RHlJhG022404 for ; Tue, 27 Feb 2024 19:05:01 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2100.outbound.protection.outlook.com [104.47.55.100]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3wf6w7xa6v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Feb 2024 19:05:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U/wtcBXbKOUj/vCGWSltCOcveb5qNm0mwaN/IrCojdp+1ZOltCHTMJwZwUPYq9XFGhhM5EcI6cPmV0ak9J/v8UWW+EqynvonLnm7Ikaw1E/E2mMLxM2cU7Lmd8irSF3Z/jQOGRH6SW8JN4BhVzgI8oAogwugqGSPyf+WDLEZCr7YANqDTguaVSxr/nBh6rf2XXftGaS/sAOIqx/bR3O8+WfppA5q6YFqnqVeApShio4SLfrT4fg3M+jm0DERlRNUkrrdSdPsRPvl1fWqkhivEplRG2Y/NL/t9PwDWtyK4ISrk7KXQMtO33YHbOuhK6sSLYszKwVShW092lC0hh6dcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=zz4+zsK3DFRt7ZccsRe7GIK2T6KrNaIIM6poHg31Isw=; b=HOw/b8w7O6Pa2bA0ITaz08UHpImv6pTnxi3a0k2FXK5AOxSy0Us2/7P8En0w4z/oWPTGwOaQDAH3XBLXlbMdpVoG/3ZTZyaxM1gjZ4/gunyEb1iNN0FeMhPqiCPxMpL9b5T7crVyzSc6qHbNp3u3rQCrBavMaf3vvhfP/G3OWgaRQgkGN7s4ZNGAdYWGGus8hFaZwFbLIlqgcsC22uJ99+6id1QOHDjVWn5Q9CT3C1LOyQ3x1yd+4+osAbPmB5VjILFaPUtkNcoc2kdmKfIAODvzm+ka8zsn554a9KB9Md/rXh8NTqYMc19imfshENpkEemMGYP6VE52RMfVH73qHw== 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=zz4+zsK3DFRt7ZccsRe7GIK2T6KrNaIIM6poHg31Isw=; b=wx9eSYmT3dh4UrObe4plSuDW0X7Lc/OI3xtTL7gd3sl/Z6RZwAPsZuWEqBDYAMrqALLos2+tcwejtVJqFaXhSYDR2H+RdksdxzOuo1yKcvgaZx1c3VipR9SsrIToONOtx4M03vn8AGsfUlSMV6hvIXjkNs+kAXrFWt7rf1zBEdY= Received: from MN2PR10MB4382.namprd10.prod.outlook.com (2603:10b6:208:1d7::13) by SJ0PR10MB4416.namprd10.prod.outlook.com (2603:10b6:a03:2ae::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.36; Tue, 27 Feb 2024 19:04:59 +0000 Received: from MN2PR10MB4382.namprd10.prod.outlook.com ([fe80::8aee:c094:84e2:9401]) by MN2PR10MB4382.namprd10.prod.outlook.com ([fe80::8aee:c094:84e2:9401%4]) with mapi id 15.20.7316.037; Tue, 27 Feb 2024 19:04:59 +0000 From: Cupertino Miranda To: gcc-patches@gcc.gnu.org Cc: jose.marchesi@oracle.com, david.faust@oracle.com, elena.zannoni@oracle.com, indu.bhagat@oracle.com, Cupertino Miranda Subject: [PATCH v2 5/5] bpf: renamed coreout.* files to btfext-out.*. Date: Tue, 27 Feb 2024 19:04:35 +0000 Message-Id: <20240227190435.35750-6-cupertino.miranda@oracle.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240227190435.35750-1-cupertino.miranda@oracle.com> References: <20240227190435.35750-1-cupertino.miranda@oracle.com> X-ClientProxiedBy: LO2P123CA0005.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:a6::17) To MN2PR10MB4382.namprd10.prod.outlook.com (2603:10b6:208:1d7::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN2PR10MB4382:EE_|SJ0PR10MB4416:EE_ X-MS-Office365-Filtering-Correlation-Id: 49ae2534-368a-443b-80c7-08dc37c6fe9c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZqLcBtlWhzXxmPnVu2lpXDlOGUt4v3oAM3F4r8e6ZKraCQLQSTKB7kHWTuY8Qv5Oyd3C1FLChi6y1eT312+IychRkGwZbSvPic4Ni50ZblAWmG6pK2lTQrkG1pXrOiEBGGwvO53J6KRSIFqILMI+Idefo9aqOyVtTetbhhR+06Y//cNN6266giuTdQqpMA+6Vmk9wQozD/xZuT18iQKNNQk1lUHwQBqYxpEJsI61hTvE7OnQB5BzVcKKJozgwhqRRmn9fnV9MxXtMcz5DacK2AV4vIjghqwYmMmibyTeu7Iuz/JKukLi0GHVLtiLwVqwMebsYpeVcCG6VxnOVDFm6MVkMYXgkf5nGOoJgkXB1SIrsAUr7nQQNgKqr71Nqa7pS9WGEyAitpRWAuk4aMA/yjK3jBW3lUNE+fXiA2st/hZm1Toy4UzPH3hjV1Hl2iwMbekHPPQa9P6F+qTWeS1A9FIZvEE2oSkZEyKpmV5J9Mw94u/uk6RUX1wXmsxPCj5nt1mjLVQiETxFKSEIdRkEW1IAv2L+UwF1XMWR+zseFP32GHkdiJ53XJ5wj49u/Dk7Vw4LDSu3Ol2ElyCUNlDfaKKwFoUzUh5/J125CsCqqZFjQDkfCW/amR51kPp7faRXYchHC5UqPFAXfZyd/lq8PQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR10MB4382.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: XhIAfGPACxFyUWXfPLSB3owA/fPZ+1X44NfF0bZOLMomVggWfS3VPmtCVm7dgN+m7l7ZV8GtMWHcFB+vKdtNVjOwAWWtGks8beJh8cuZB6f0FthVJwkxwl7JC/Mt8/TtHxLFjf6gmuWm1boibDmOWhH9xcYiLOWyiTJHzQNPj23OdW3fT/qsiaE2TEuPqyU3RjYyNxHr5T8i1uX0xdERAHsmyElT6J+nQz4aeZQaZSdkracxIEhtEDq24y3yF1+0CHJZQWJzhYGedjx97i3znj65NDKUNM1+xLfO8/ReFFUHrvaj/qc/rGexfZfU5IzuQXd8nZ1/uvc9C6Pxd4biNvi6eQWQOE37EeaMSDQvW5zWmr6/EIs+Iv6++GpHlX3sQh6bPXYnHvogXcYAu4mYESF7mbLk8ELng9sm3JuC1pcxZtZbZh/WcNm9NZBc0VdeGoevcqNRbb0FdU/yU+Pw5Rtwhs9uNVQONTvXbQ1Vj3chJpGNSMcgq29S4f48JU1QRzgUX1R/W31y0+9L3B7BcibRYTh52ropjF1e6JPWP3wzIIZjbudMY0o8o+EnQCfIXl0ddsP+PZ9mCF4Wcyf9tHMym+JbzgwGsslsKR2iqmkmNtTCaslmn5pw+BMGrFbi26BVN4UR9XHlHUlhCOCiWTpiWmB2hTRAhdU+EhNZ805PY47V3ct1j+cf23MpDFJpPuQO8IrC5eISIWY9exuh2NthOXYLRb+i11n/sngWjVWDFCp+EyGnm3m21b5V9EAFzNjfTlRpHj0jVHKvcpk4ixdqOyzk6ji2B6LOn8UIOTSHPgLflRt2SN8Zn/uAtGtEQXgyepo1gFMlH8Bz+FB2CK6G7649ZR/xiF0K5MBsoHhG6mxz+WojxqZeteuug+V2w5Y5O5AVsjK2cWRb097JKhdMRWU2sfw26Cpq1bsgm/XGuj17X2r2eAUOXNTqaqB0K8v1szGtbkZc75MulLk1TCyAbRQc6fgTzPwLbmYeGjLjxINDUe0ACrWKpZBRM+SJaRqmqdf1IR36gtZzF4ZxE2sYqLOPUhQLF2tLcz1iXLaZ9afBmHl12D61KxpuqpSfjcCR0CuT/zkblIZ6r5KSBeJnUEMFNLeLrWYad/Ff0LykiMA1X51j+QC70vChG3lvRqxfTFCtpnQisieM0IO4o5qBAS0O4erxNu2lB7d1DdwZoOttAUuTvinpM8LhEzSRBWDBv5B+SXgBjIe9mv6JhCsBF7NT3bX8KpnBzmJ9NuLav5T+CGmUiUpyFWbjb13wHDcVse6JrVj8hSJXYILFp3xLehs+aVBjOm2d7SOXBg+p21WWGjoQACI2c5tVZO/rMKYUaLwnewfVd18cTWnTdCeOl1exZuS1y9aSflCXDpEFMmvu2boToVh6CFegIs30mCfbjn5hcrFz6Erw0doxX0Ex6KUwAqI/5d2syKrTC+zWTxQymC0gCB8fA5e/LLMnI+0IDM008Bb7/yPMmRVOmNWkyNQWiFfKuSJcahoDYBOTRKur42QV3eel4LyoZpkgzICA7ei/3iBT4T5mxLu3MXUdj0ZGscYp8MpRfY+78ebU9PY3bnQLeWYO5vs5vpGA3cXElA47uTg+XaWM2am805qaIRPrjajBoA8tDcSqzfU= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: wVlTP9cdP3GhjYYsLn3hUxvaPU7AouXFzr3gDXaiRa0i5kNLaP5/+zN7tIwTFwxy5vUkHzcQV+FBpVU86bWe96K/Edgr3Qqbu86Mzfw+3DTDx/r88AgjPd84Oke2afexz5CgO0i+luYdxn0y6zt1og5wk3JCWdeVq9UayMGE+28KDn4ksvBnVOZPeA70H/62pPAaQFldjNk/zMHMkmZVOpku9MimPxkXSUuLtFl3YwgIMvsNs5B0z6iqS4WPur7/3e0hCWni5hcUIOqJXaqep3V2SDxWsnQq41krx0mcpisTpn0kUeuFtKG49bFgsFx8lNiFxePD2WrM/RQRap39hbZ6p6ECwdgv20QTs0MiSu14Y9nb/8lnpt6rE5wvxYL1YsHsG65R34HO0CCX0iBLQKIQRzNra+6qo3AVN9rez6Kf7s8KpuVGkGg+yBa+rgYrBMQCLBqYXtT9OV8bUtE4vRHSHYW/2DTu+dkexkRI75sun8HvEptVsE24PPYyn0UUZINEsWI88i03mfpXK7Qnkuj9v6oJXczgJmFfYqTKGUdB8xTrx46MiYhTY83OXa2jzyEsVfzSgQLgJyDNPC88v1FcJk8LjCzBvjUPcDlB508= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 49ae2534-368a-443b-80c7-08dc37c6fe9c X-MS-Exchange-CrossTenant-AuthSource: MN2PR10MB4382.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2024 19:04:59.6110 (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: bRRwO/BPqyspfemQvdWKZHMpPdSHb8aeuN47351U+rp94XEd52WOGlPhCCvZWqIsrtvwztbFtlxBPizlGpy+cF3k/1JOzIovhzXZOzbGNSU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4416 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-27_06,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 spamscore=0 mlxlogscore=958 adultscore=0 mlxscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402270148 X-Proofpoint-GUID: Il2ttjXGo9qkHJHDRo3gUaaCfQ5yGkw_ X-Proofpoint-ORIG-GUID: Il2ttjXGo9qkHJHDRo3gUaaCfQ5yGkw_ X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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: 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 gcc/ChangeLog: * config.gcc (target_gtfiles): Changes coreout to btfext-out. (extra_objs): Changes coreout to btfext-out. * config/bpf/coreout.cc: Renamed to btfext-out.cc. * config/bpf/btfext-out.cc: Added. * config/bpf/coreout.h: Renamed to btfext-out.h. * config/bpf/btfext-out.h: Added. * config/bpf/core-builtins.cc: Changes include. * config/bpf/core-builtins.h: Changes include. * config/bpf/t-bpf: Renamed file. --- gcc/config.gcc | 4 ++-- gcc/config/bpf/{coreout.cc => btfext-out.cc} | 4 ++-- gcc/config/bpf/{coreout.h => btfext-out.h} | 2 +- gcc/config/bpf/core-builtins.cc | 2 +- gcc/config/bpf/core-builtins.h | 2 +- gcc/config/bpf/t-bpf | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) rename gcc/config/bpf/{coreout.cc => btfext-out.cc} (99%) rename gcc/config/bpf/{coreout.h => btfext-out.h} (98%) diff --git a/gcc/config.gcc b/gcc/config.gcc index a0f9c6723083..1ca033d75b66 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1653,8 +1653,8 @@ bpf-*-*) tmake_file="${tmake_file} bpf/t-bpf" use_collect2=no use_gcc_stdint=provide - extra_objs="coreout.o core-builtins.o" - target_gtfiles="$target_gtfiles \$(srcdir)/config/bpf/coreout.cc \$(srcdir)/config/bpf/core-builtins.cc" + extra_objs="btfext-out.o core-builtins.o" + target_gtfiles="$target_gtfiles \$(srcdir)/config/bpf/btfext-out.cc \$(srcdir)/config/bpf/core-builtins.cc" ;; cris-*-elf | cris-*-none) tm_file="elfos.h newlib-stdint.h ${tm_file}" diff --git a/gcc/config/bpf/coreout.cc b/gcc/config/bpf/btfext-out.cc similarity index 99% rename from gcc/config/bpf/coreout.cc rename to gcc/config/bpf/btfext-out.cc index 31b2abc3151b..4281cca83e13 100644 --- a/gcc/config/bpf/coreout.cc +++ b/gcc/config/bpf/btfext-out.cc @@ -33,7 +33,7 @@ #include "tree-pretty-print.h" #include "cgraph.h" -#include "coreout.h" +#include "btfext-out.h" /* This file contains data structures and routines for construction and output of BPF Compile Once - Run Everywhere (BPF CO-RE) information. @@ -618,4 +618,4 @@ btf_ext_output (void) dw2_asm_output_data (4, 0, "Required padding by libbpf structs"); } -#include "gt-coreout.h" +#include "gt-btfext-out.h" diff --git a/gcc/config/bpf/coreout.h b/gcc/config/bpf/btfext-out.h similarity index 98% rename from gcc/config/bpf/coreout.h rename to gcc/config/bpf/btfext-out.h index 1c26b9274739..b36309475c97 100644 --- a/gcc/config/bpf/coreout.h +++ b/gcc/config/bpf/btfext-out.h @@ -1,4 +1,4 @@ -/* coreout.h - Declarations and definitions related to +/* btfext-out.h - Declarations and definitions related to BPF Compile Once - Run Everywhere (CO-RE) support. Copyright (C) 2021-2024 Free Software Foundation, Inc. diff --git a/gcc/config/bpf/core-builtins.cc b/gcc/config/bpf/core-builtins.cc index aa75fd68cae6..8d8c54c1fb3d 100644 --- a/gcc/config/bpf/core-builtins.cc +++ b/gcc/config/bpf/core-builtins.cc @@ -45,7 +45,7 @@ along with GCC; see the file COPYING3. If not see #include "ctfc.h" #include "btf.h" -#include "coreout.h" +#include "btfext-out.h" #include "core-builtins.h" /* BPF CO-RE builtins definition. diff --git a/gcc/config/bpf/core-builtins.h b/gcc/config/bpf/core-builtins.h index c54f6ddac812..e56b55b94e0c 100644 --- a/gcc/config/bpf/core-builtins.h +++ b/gcc/config/bpf/core-builtins.h @@ -1,7 +1,7 @@ #ifndef BPF_CORE_BUILTINS_H #define BPF_CORE_BUILTINS_H -#include "coreout.h" +#include "btfext-out.h" enum bpf_builtins { diff --git a/gcc/config/bpf/t-bpf b/gcc/config/bpf/t-bpf index 18f1fa67794d..dc50332350c4 100644 --- a/gcc/config/bpf/t-bpf +++ b/gcc/config/bpf/t-bpf @@ -1,7 +1,7 @@ -TM_H += $(srcdir)/config/bpf/coreout.h $(srcdir)/config/bpf/core-builtins.h +TM_H += $(srcdir)/config/bpf/btfext-out.h $(srcdir)/config/bpf/core-builtins.h -coreout.o: $(srcdir)/config/bpf/coreout.cc +btfext-out.o: $(srcdir)/config/bpf/btfext-out.cc $(COMPILE) $< $(POSTCOMPILE)