From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70078.outbound.protection.outlook.com [40.107.7.78]) by sourceware.org (Postfix) with ESMTPS id 166633986814 for ; Wed, 4 Nov 2020 12:45:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 166633986814 Received: from MR2P264CA0068.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:31::32) by VE1PR08MB5696.eurprd08.prod.outlook.com (2603:10a6:800:1ae::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.27; Wed, 4 Nov 2020 12:45:31 +0000 Received: from VE1EUR03FT044.eop-EUR03.prod.protection.outlook.com (2603:10a6:500:31:cafe::99) by MR2P264CA0068.outlook.office365.com (2603:10a6:500:31::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Wed, 4 Nov 2020 12:45:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; sourceware.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;sourceware.org; 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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT044.mail.protection.outlook.com (10.152.19.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3520.15 via Frontend Transport; Wed, 4 Nov 2020 12:45:31 +0000 Received: ("Tessian outbound a64c3afb6fc9:v64"); Wed, 04 Nov 2020 12:45:29 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: bd8c4c095c16feec X-CR-MTA-TID: 64aa7808 Received: from 2852509773f8.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 3A99650E-5973-47CE-AE96-D62473D23DFA.1; Wed, 04 Nov 2020 12:45:24 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 2852509773f8.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 04 Nov 2020 12:45:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FCmspZr6WBCrlxABvGwSbPXi2EgqTNS+pcf9ZYShQdSuEU4P0uDQ+OPGB3IhVIp3F5Oxa2uykf6IOY6edmJoZ0k/PNF8tyg5Moek3v2VFoMRJrZ7G+TVEJM7HmojGHOQQk4PCgTUC4+KqiXRaT4a1iGzHEgaIoTAMkYswN1wLKFTHNPlU+WA1eZk4CH5AnyP76NCsfyEp/I723zZ7Be7pwghP39Ce5C+HKzfHa59tzoVT+UDIlmO3vlDfqnxd6CmftzQ1CWBigIeBwT7SsMkDMlDD5Y2bQWHoazDc/vy1sV6hkBTUE7cm5NMOYni3plvqC8TXwp5beQ+tadkJdj0fw== 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-SenderADCheck; bh=aQYG2IjjGgfbxuo0yfSBloZHnZb2hxOjvPWZYGYxFBE=; b=N5pjc1pDG+FB2P23NeBB/CydHF+uNuQmJC+iQBW4Dq/3C2+lJe2g7gCfrucskCHaNZm58rfY/IIeg9qdEsZcLAJlPz0bMXEyIeJt4rkBcnZpLmR5R3050xg7e58upBvbYhR/3GW6CRuO49NrlxTCOOSYXLEz45LPrMmSJgKXxxO/dIw7Wg8K4WppBWxr0XaTCQ29EBkYvumTEeM0zBI8+un4UlA1Z2tiO6QrZBZNN0QAhJNFcAs0XUFV0t8PRmv37WHukFzimvwzDnjJm4wzGphnlE1r8KSr2ivO5bFtZpQPDgXdYXOGzHoA+6fqYm3J5WWUvJz8VIltlIKG62bxeQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Authentication-Results-Original: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=arm.com; Received: from PR3PR08MB5564.eurprd08.prod.outlook.com (2603:10a6:102:87::18) by PA4PR08MB6223.eurprd08.prod.outlook.com (2603:10a6:102:e8::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.27; Wed, 4 Nov 2020 12:45:22 +0000 Received: from PR3PR08MB5564.eurprd08.prod.outlook.com ([fe80::2904:edcf:b299:f792]) by PR3PR08MB5564.eurprd08.prod.outlook.com ([fe80::2904:edcf:b299:f792%3]) with mapi id 15.20.3499.032; Wed, 4 Nov 2020 12:45:22 +0000 From: Szabolcs Nagy To: libc-stable@sourceware.org Subject: [2.27 COMMITTED] aarch64: Fix DT_AARCH64_VARIANT_PCS handling [BZ #26798] Date: Wed, 4 Nov 2020 12:45:16 +0000 Message-Id: <20201104124516.20785-1-szabolcs.nagy@arm.com> X-Mailer: git-send-email 2.17.1 Content-Type: text/plain X-Originating-IP: [217.140.106.54] X-ClientProxiedBy: LO2P265CA0037.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:61::25) To PR3PR08MB5564.eurprd08.prod.outlook.com (2603:10a6:102:87::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (217.140.106.54) by LO2P265CA0037.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:61::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Wed, 4 Nov 2020 12:45:22 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: a8003606-4aae-4bf9-fdc8-08d880bf83e6 X-MS-TrafficTypeDiagnostic: PA4PR08MB6223:|VE1PR08MB5696: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true Content-Transfer-Encoding: quoted-printable NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:1332;OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: yhSD3P3aMOgeuxiG/klBb/+MCQneUfkdO6h89VIwS0X1yYohFRXnfg3+mYcZUDOHHOoPISBuX2EnPLQgk9C2BurISQItFsjPBv63QzrX0WcZxI5eNYCoK7vBab39+wX851O/Vyxl7HJFP8Cu5NNiO9WlZf0hUVoH/DFMVxl9wY55BM8uf/5Y2GFGHNTCC2VxzeeUuE2jdZdh4PZWwxm99bvpKTNPLC/Yr+tByUz9xNWOEWuz9IG3pZ2MZA5s4MWQJqdnjH4QhLmMl9/6hPRTCuYrAF/1DeASghNt3lctOvFoxEA5XWiK0TAQLZgs85gPkF5FGz/srUjrq1EWjYh9K7gN51pkDSSb/mkqJYjmsvCpKIQweXBD+gnZF5JEX11e X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PR3PR08MB5564.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(346002)(39860400002)(136003)(376002)(396003)(26005)(316002)(83380400001)(956004)(36756003)(8936002)(2616005)(16526019)(44832011)(69590400008)(186003)(52116002)(86362001)(5660300002)(6916009)(478600001)(66556008)(2906002)(1076003)(6506007)(6512007)(8676002)(6666004)(66476007)(66946007)(6486002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: Pd40BEXKLHYeb81pI2tkJ4UK/XztOaKc0JMc5eYBQu0bzPNLERDZFVYyls2cnVyCogt3MamrlyWbYK3JcaNZnQEr1o0aqlnE49JYZGPJu3tSNSx+/tiAiq3nEYlgDL3GEImhZalZ9roftKJBlqztWkdFEQHdbamTSQ1j4mr6ZNJvImOQ9/Fdc+vuQ03VXDQSdnpF8fd/pntnmGgExEk7Ay0Eax81QeXGtAsjLAL1sdG2fjMu2YqjpCjHXl/RGVAElcpSwq0IwRcsnU9mw472UbzhY9ksrf7ejjQa1xQUhqMnNgGM3TRsUbyVlTbxgLB27r91mc/NCIC6aE5oj5zlGbOh28Ho7Wwf48Nor5TuAHWo2LHtUrYYFx2bAoi3m1uiIKTW0oeBy8lj2UxFQw8ljGDqyC2lL9vNjokMpf66tO3zTdb7Gc2k5lCiDuPPIfifOHPIOo2Jna4Cdri+XXIBT0JkASxigdeov7juOCpliN+pzA8bt3Fbsj6P0oxHRP5EFPIiAxMUHv+Fttqhz9Cv7XfhzOCR54GCGEASSFoarpQFV+PEqd3/fOZ5XCkBj09CqyKjYFtn/uruLZ6nuW0WGPiLlDAy5ZosbwiMC/y+jfOSPlxxGh3ZGqKTtwJYXhcuVlvcaAwJ3Or78/vIUBk25A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB6223 Original-Authentication-Results: sourceware.org; dkim=none (message not signed) header.d=none; sourceware.org; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT044.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: ae5cdb94-eade-45c9-ea98-08d880bf7ec0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7tRzTjpRBL2q0PXE8vaoCoXfILD8QOGnjkbasMNGzERvqiIlhbNlG0QaGN3NRe4PzqRLrvP6OEc3VEy+jN6fuYrQGcs6SxS8v0BjDEANk5ZcbOxf74rHKYRw5IBIVM/6jXP4qQti6KqANfhK3a/watCDttdo9a6cDdir6Ep1ZdKIFeb2ZDsthOIpbtL9YNUmHWSj+X2Tf/53+Y99kjBP9J8t5YbnwLCG8fKwUPIotBbxglodqx0eWSj5xYK/hxFlQXJdixR/ok4QbxJMnrbrqz1qIVcVn8QSY7ewBalieTsIeJ2pVLYkflJIyrLzf9xHadqCLo90JX4kVQ2Gh4QQLn+8LjKLOKT1KsyOuzwQtH6lxE3XUkdqVqx61g7pdv70TMGY9HDeijid56aGnxgQhDeHaDZlayMA2udoN+BzA0y8Gye4jGTj3nJFT2xMB79K 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:(4636009)(346002)(396003)(376002)(136003)(39860400002)(46966005)(86362001)(36756003)(83380400001)(336012)(82740400003)(47076004)(478600001)(44832011)(6666004)(6486002)(316002)(36906005)(5660300002)(2616005)(8676002)(70206006)(70586007)(956004)(6916009)(1076003)(6512007)(6506007)(2906002)(69590400008)(82310400003)(26005)(8936002)(356005)(81166007)(16526019)(186003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Nov 2020 12:45:31.1698 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a8003606-4aae-4bf9-fdc8-08d880bf83e6 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: VE1EUR03FT044.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5696 X-Spam-Status: No, score=-14.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-stable@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-stable mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Nov 2020 12:45:35 -0000 The variant PCS support was ineffective because in the common case linkmap->l_mach.plt =3D=3D 0 but then the symbol table flags were ignored and normal lazy binding was used instead of resolving the relocs early. (This was a misunderstanding about how GOT[1] is setup by the linker.) In practice this mainly affects SVE calls when the vector length is more than 128 bits, then the top bits of the argument registers get clobbered during lazy binding. Fixes bug 26798. (cherry picked from commit 558251bd8785760ad40fcbfeaaee5d27fa5b0fe4) --- sysdeps/aarch64/dl-machine.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sysdeps/aarch64/dl-machine.h b/sysdeps/aarch64/dl-machine.h index 0c1f8d66b3..8989398186 100644 --- a/sysdeps/aarch64/dl-machine.h +++ b/sysdeps/aarch64/dl-machine.h @@ -388,13 +388,6 @@ elf_machine_lazy_rel (struct link_map *map, /* Check for unexpected PLT reloc type. */ if (__builtin_expect (r_type =3D=3D AARCH64_R(JUMP_SLOT), 1)) { - if (map->l_mach.plt =3D=3D 0) - { - /* Prelinking. */ - *reloc_addr +=3D l_addr; - return; - } - if (1) /* DT_AARCH64_VARIANT_PCS is not available, so always check. = */ { /* Check the symbol table for variant PCS symbols. */ @@ -418,7 +411,10 @@ elf_machine_lazy_rel (struct link_map *map, } } - *reloc_addr =3D map->l_mach.plt; + if (map->l_mach.plt =3D=3D 0) + *reloc_addr +=3D l_addr; + else + *reloc_addr =3D map->l_mach.plt; } else if (__builtin_expect (r_type =3D=3D AARCH64_R(TLSDESC), 1)) { -- 2.17.1 IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you.