From patchwork Fri Nov 3 13:15:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 161293 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp1022806vqu; Fri, 3 Nov 2023 06:16:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGtDG/Y4mFI5P0xxBDdjPRCb2dvmImtUdNvniP7IM4JHt5vbyIG4QreML1+jSCMHwNZQsew X-Received: by 2002:a05:6870:2116:b0:1e9:c315:9d66 with SMTP id f22-20020a056870211600b001e9c3159d66mr24642478oae.40.1699017372480; Fri, 03 Nov 2023 06:16:12 -0700 (PDT) Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id h8-20020ab03348000000b007ba2f723240si196129uap.201.2023.11.03.06.16.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 06:16:12 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=J5YceQnP; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=J5YceQnP; arc=fail (signature failed); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1713C385700D for ; Fri, 3 Nov 2023 13:16:10 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2047.outbound.protection.outlook.com [40.107.8.47]) by sourceware.org (Postfix) with ESMTPS id B44643857C66 for ; Fri, 3 Nov 2023 13:16:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B44643857C66 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B44643857C66 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.8.47 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699017365; cv=pass; b=mO/ZrJqEyeZCvhDKXNmiKutoarvijuaVcpTAX8dhHPUccV/01vKmXXYuI6xb2yZ41NJTTdMMeUf8nH+QRS/tXpgmQZSJTWTxKatet6CQnZFQS7T8Z01VQHHQo3uiFNvfSC1bC7uyA8G474SgUCvBqYuDy0aS2caz27Eo49tj2jA= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699017365; c=relaxed/simple; bh=SnXdbw75YJIVAFjr2v/0T0rB79NWoIPu3w+QOESJIl4=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=MNlqDJXLEu8wK5Ih2rWDfpyl7rSvTF+zOc4vEnkV5AJl0ZURh1KtdRC7b8hx5tS4gqrhG80vaEk3Pt0Q0fcYF2B7cWl1wRxNfZA3B3zkxz96gkLaTiYjETklGwJPBlKZEdFWCPiL0wDFFuI82J+pmTZZrlHP/ODnTv3z9exY2SE= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=BclBFOcWA4eVXTa+LtLJQWsUuEHt6hBzwla4eS0MXme670AewwvJjyn1eH0uZfv2DV/ihrKuHxn83UtofFhpOxx7uS27pTHHwvFRz01DBva+0aaA4rJIo+1/1OFz2FCuGjLDRFpWdR4yzKF7DE1CfRgirl1YOUTcKqA6BWowBnMmXiIb+PUDQVaRz3E/LhmrqIpzTeJeyCZ8ZP8J7WN9YUb8N7fGOgHK7St0xz02B1PWh1dg3/OSSQ0LM4PoWiNs7zaIAVf42YVUsM4nTOrlmJtr+A+coqP2nS0Q1jODTY2pIM0PJYTDRAqF7qwnaDAhMK1b79Al16v3BpuALrfUaA== ARC-Message-Signature: i=2; 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=td8gZhFx8b5jQKw2ZDHEwMydDG6h0B+Zu9gRQLw44kg=; b=lcw1UxdEe/m8RFsP+NBo1xuMTTceLovsO4DhxqR8QT6aDFtG4sX+tw7FOEuxHmVjf2l6wLymLtA6LEMXNcDhULOPJZ2ZM+NflEbc7q+XUx+8wIG+CShlMRO5zUwFcLe0Aj6CAeyk47cmq8S3Mo5XlvR5636Tee2V4+9SMo/Ll0MGgKskldmcMd8Yi4RqVE0B2/UgxvBGPdQ9xdiHgXcAx5w1tA+rVv2HRga5C4Gx/YEFhAb/o9N9K1M9qfdiCrnWbBFCbzFY5c3Y1e4FQ8+peGHSZXb03H1918Ool0wJ0LgqwzxIXbf1I9Godn+Ly23gWV6yraGOTR6sX/WnnSv/Xw== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1, 1, smtp.mailfrom=arm.com] dmarc=[1, 1, header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=td8gZhFx8b5jQKw2ZDHEwMydDG6h0B+Zu9gRQLw44kg=; b=J5YceQnPKHwERihzk/9riFFURXdy2LW5al87EEo3nX/OaXSAvAmupgbo5cREjBj2brHHeVbQqdTdjtMNXIW7hkI4zYKXmywsZQX3J1FHaWK+GRPufIsIdLQWR4A+anLoiCXmV2QCc+1zPoZctgMtI10VGLh7b8izF45DObUby0g= Received: from AM0P190CA0015.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:190::25) by AM9PR08MB5956.eurprd08.prod.outlook.com (2603:10a6:20b:2d4::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.21; Fri, 3 Nov 2023 13:15:58 +0000 Received: from AM4PEPF00027A68.eurprd04.prod.outlook.com (2603:10a6:208:190:cafe::aa) by AM0P190CA0015.outlook.office365.com (2603:10a6:208:190::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.19 via Frontend Transport; Fri, 3 Nov 2023 13:15:58 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM4PEPF00027A68.mail.protection.outlook.com (10.167.16.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.19 via Frontend Transport; Fri, 3 Nov 2023 13:15:57 +0000 Received: ("Tessian outbound 7671e7ddc218:v228"); Fri, 03 Nov 2023 13:15:56 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: bb91955b21dc1e85 X-CR-MTA-TID: 64aa7808 Received: from 97b6d7132f77.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 6D9A44C7-711F-44CB-80A4-151B2A353282.1; Fri, 03 Nov 2023 13:15:49 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 97b6d7132f77.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 03 Nov 2023 13:15:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IY+MoxzomQqs+S3wr3uFMSwzjWC4ai4k/gQV1/wZD9U7r6nm55nSOb1bx9/ozqwu5vyMoYkJDlP2NVwyiexfbXMlii2uzdV790N1t1boFZXIVPXfSt030YP/HJrkvWtTnS0Jc4EGHawtk2xyySrxBlMpOPr3A+kwcx7k8bAezM470Du8c5mzKK+SV4HK67qy4mZQlx9mA6CJH6QmH//rgwiDGr9UNz6yv7iYY5Nqyjhs8ozH6xgYw14NQu7GykiwxOVeW3f2OFZWeK4dg2HlcIFOCOibV3mWi9V46gHDWNkzoeOKozs2oZGzXtIRzc1tjy4JkCGfr/1Uvqq+nh78fQ== 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=td8gZhFx8b5jQKw2ZDHEwMydDG6h0B+Zu9gRQLw44kg=; b=JTKsoWRy7LM1w2WSf11bUBNoxYW922558/N3cAE3xJt6GHPQS+7jNCGp98OzBcCSOz/YNe8iyFfdwurj6V+50AbV7DA2RkXn7Rew2sVq2JBAoaKyMRorkXBXAWeoMJ+gBLRpYBmXW8kVcd54407Qa5HaXI1Lle2ddvgLbIxCj/So3oIRZRUTrUrcVm2q1QIib1mXK5vp8sb7V3QTeAVOdao3f9xpYbXmIO4yRhOC4KDQ3D4BAyhs9bXDGtpOsLvMMxMPugLOh/WKMPgNAnkxomV3JxrIQRLKuTT1uUEpq/pPMTWnRFv7K3JEQQV7LuCRPYbGY+feT3mAptTvuaejPQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=td8gZhFx8b5jQKw2ZDHEwMydDG6h0B+Zu9gRQLw44kg=; b=J5YceQnPKHwERihzk/9riFFURXdy2LW5al87EEo3nX/OaXSAvAmupgbo5cREjBj2brHHeVbQqdTdjtMNXIW7hkI4zYKXmywsZQX3J1FHaWK+GRPufIsIdLQWR4A+anLoiCXmV2QCc+1zPoZctgMtI10VGLh7b8izF45DObUby0g= Received: from DU2PR04CA0249.eurprd04.prod.outlook.com (2603:10a6:10:28e::14) by AS2PR08MB8502.eurprd08.prod.outlook.com (2603:10a6:20b:55d::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.20; Fri, 3 Nov 2023 13:15:45 +0000 Received: from DU2PEPF0001E9C5.eurprd03.prod.outlook.com (2603:10a6:10:28e:cafe::54) by DU2PR04CA0249.outlook.office365.com (2603:10a6:10:28e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.21 via Frontend Transport; Fri, 3 Nov 2023 13:15:45 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by DU2PEPF0001E9C5.mail.protection.outlook.com (10.167.8.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6954.19 via Frontend Transport; Fri, 3 Nov 2023 13:15:45 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Fri, 3 Nov 2023 13:15:45 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Fri, 3 Nov 2023 13:15:45 +0000 Received: from armchair.cambridge.arm.com (10.2.80.71) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.32 via Frontend Transport; Fri, 3 Nov 2023 13:15:45 +0000 From: Szabolcs Nagy To: Subject: [PATCH 3/5] bfd: aarch64: Fix leaks in case of BTI stub reuse Date: Fri, 3 Nov 2023 13:15:44 +0000 Message-ID: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DU2PEPF0001E9C5:EE_|AS2PR08MB8502:EE_|AM4PEPF00027A68:EE_|AM9PR08MB5956:EE_ X-MS-Office365-Filtering-Correlation-Id: 656d0bdc-d89c-4393-0a65-08dbdc6f040e x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: T68YmnhOdAzsFY6IS/DiKJ/4iqhajNLposQURfLT3htAslyIwftyfDXTn2eimWbk8Zy+9S3RM6xuJf5ix468hvzpkP4nFDJkS2UAGNRu6AKo02cb/j82kfRyNmk1e11it6dVAuxQd4FQkx+WudU/Zz9xj2sfJT/yYcOZk4BOOQZlYzm+uTCtYvncKMi2jreBfayqzcNf8TzB4cBn90riroG+pQxsFZ1UbAZRNa3sLoDdkbx8B1AuhuWtGwq1o/qpqN9CVr7uCgEAwmhkad0CSOqt4ucWwom3ddT7crwSX2/ZajfVWcyMXgWHxGq+yQ88UX6ZeF/cKbwhsCut32IwaVSMdx7ZWv1CbV3qFccJCdhS7mUQtYVfmuOlK9dPtkh0qKQ320iGL7MoImDonw1+uP2K6Q3BDAm04OVTcu+FBXlobHlFjz4LFZdympizjKOzbMl74jLQsnlglyHHpP9/LGOZpYzbLj/PMGZ0mRvic6jgy914u46y8ySqLz85FyUBwsoyFZXGp8ZIvCbESQaAbQZc8Oz+s8R1+3oaLXJpz6zYYJQxTafemqGz+AGALaX4DsJzoeDlFqvf4im9oqkRKT8tSLmjj8vINyzrdX0C8tJNj1vxD8j3CsHOXwuYu026bFcCXDHyb3lmt0NI41ertlvji3HsOWSVQp5SVz3A77FMqwpciAlFehyzx4v2oYFnjoCeNUUPdTgWhsJvxLIRP48RRpTMJVe4ROjv/6KSn9kM5cmhywV7zbTZf1ios5o8NRUbR1l/Dtx3A4I13o+8Dg== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(4636009)(39860400002)(136003)(346002)(396003)(376002)(230922051799003)(1800799009)(64100799003)(186009)(451199024)(82310400011)(46966006)(36840700001)(40470700004)(8936002)(426003)(8676002)(316002)(5660300002)(70206006)(70586007)(6916009)(336012)(2906002)(40480700001)(44832011)(41300700001)(478600001)(40460700003)(7696005)(26005)(36860700001)(2616005)(47076005)(36756003)(83380400001)(82740400003)(356005)(86362001)(81166007)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB8502 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM4PEPF00027A68.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 77508e00-3352-459a-2d1f-08dbdc6efd5d X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: i5UjRqNEWIwuQeh4f7oBgjEM/JYPUJn6VGSkkbXHj5e0bgiAgNjBjM5Pk9KeOSkaDzViwnH/Qq1M11DJJzT5NhnTsgOno0/zllPlBS74Id+6qdUXNLXIiBoIC15HpX2R2JQY3ovziNzz0fIo9qRo5Pnvfhzl68HXwiysJTuuhxWCrBzyd4MLxPKgOYUHCrRk0bpB0D8m4Usm1qan++dCw6+9yff64zznjN9RDsq/ye7o2bEU+H4vRmdTonceDyTedZIGu6d/teeMrRS/VeAf/Umxhg0T9VygtYK6Sycj8/OIiiVVU0sadHcjH4YJNd/FgvX9doClS7PudMlo/48C3TIp4GmIuZWDzzibjWFhz06bhtTzA97hIWeHFA5dJqeR1hlVrSqDhoGLGtMpp0XhekKYfw1byWbPV8F7wMEdxhtBLbJMWndUOVQcMlRrPPeI49cVUcX1SIUH7azDJSUR9VM03uOpZb7AzfVje+rvO4+SkLgQO5b+4vbsTZn+MFbdCotBzUwBhcj4UWw/MLbqiTG72UnGYeaqCCPWqrRAbKsVuLnepZbRUZpDkYOcHZBNEYOtWsNniZPzY196OUWAWCmtybF6IkNc2/A8aunKGs9POTYfu/HbMzKt5Cri2AHnfAxmDEcudR4+vg/DLIkBGqn6lS4ujg8+fdxgwMzlk/NGo2EP8h6wtkYmkfOPp3FK2wHHK60TOaeAS3oNslX7FgU7inqg0AHhGv1m8ZtjWbDpkyEAX4ZW1j5sCamwbXbR X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230031)(4636009)(39860400002)(376002)(136003)(396003)(346002)(230922051799003)(64100799003)(1800799009)(82310400011)(186009)(451199024)(40470700004)(36840700001)(46966006)(7696005)(36860700001)(478600001)(6916009)(316002)(82740400003)(26005)(2616005)(70586007)(70206006)(426003)(336012)(8676002)(2906002)(8936002)(41300700001)(86362001)(44832011)(5660300002)(47076005)(36756003)(81166007)(83380400001)(40480700001)(40460700003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2023 13:15:57.0097 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 656d0bdc-d89c-4393-0a65-08dbdc6f040e X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM4PEPF00027A68.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB5956 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781548840394216919 X-GMAIL-MSGID: 1781548840394216919 BTI stub parameters were recomputed even if those were already set up. This is unnecessary work and leaks the symbol name that is allocated for the stub. --- bfd/elfnn-aarch64.c | 56 ++++++++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c index 798643ade7c..3adece30250 100644 --- a/bfd/elfnn-aarch64.c +++ b/bfd/elfnn-aarch64.c @@ -4665,33 +4665,41 @@ _bfd_aarch64_add_call_stub_entries (bool *stub_changed, bfd *output_bfd, stub_entry_bti = aarch64_stub_hash_lookup (&htab->stub_hash_table, stub_name_bti, false, false); - if (stub_entry_bti == NULL) - stub_entry_bti = - _bfd_aarch64_add_stub_entry_in_group (stub_name_bti, - sym_sec, htab); - if (stub_entry_bti == NULL) + if (stub_entry_bti != NULL) + BFD_ASSERT (stub_entry_bti->stub_type + == aarch64_stub_bti_direct_branch); + else { - free (stub_name); - free (stub_name_bti); - goto error_ret_free_internal; - } - - stub_entry_bti->target_value = sym_value + irela->r_addend; - stub_entry_bti->target_section = sym_sec; - stub_entry_bti->stub_type = aarch64_stub_bti_direct_branch; - stub_entry_bti->h = hash; - stub_entry_bti->st_type = st_type; + stub_entry_bti = + _bfd_aarch64_add_stub_entry_in_group (stub_name_bti, + sym_sec, htab); + if (stub_entry_bti == NULL) + { + free (stub_name); + free (stub_name_bti); + goto error_ret_free_internal; + } - len = sizeof (BTI_STUB_ENTRY_NAME) + strlen (sym_name); - stub_entry_bti->output_name = bfd_alloc (htab->stub_bfd, len); - if (stub_entry_bti->output_name == NULL) - { - free (stub_name); - free (stub_name_bti); - goto error_ret_free_internal; + stub_entry_bti->target_value = + sym_value + irela->r_addend; + stub_entry_bti->target_section = sym_sec; + stub_entry_bti->stub_type = + aarch64_stub_bti_direct_branch; + stub_entry_bti->h = hash; + stub_entry_bti->st_type = st_type; + + len = sizeof (BTI_STUB_ENTRY_NAME) + strlen (sym_name); + stub_entry_bti->output_name = bfd_alloc (htab->stub_bfd, + len); + if (stub_entry_bti->output_name == NULL) + { + free (stub_name); + free (stub_name_bti); + goto error_ret_free_internal; + } + snprintf (stub_entry_bti->output_name, len, + BTI_STUB_ENTRY_NAME, sym_name); } - snprintf (stub_entry_bti->output_name, len, - BTI_STUB_ENTRY_NAME, sym_name); /* Update the indirect call stub to target the BTI stub. */ stub_entry->target_value = 0;