From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140089.outbound.protection.outlook.com [40.107.14.89]) by sourceware.org (Postfix) with ESMTPS id 974A43840C3C for ; Wed, 4 Nov 2020 12:46:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 974A43840C3C Received: from DB8P191CA0028.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:130::38) by VE1PR08MB5678.eurprd08.prod.outlook.com (2603:10a6:800:1a0::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18; Wed, 4 Nov 2020 12:46:17 +0000 Received: from DB5EUR03FT033.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:130:cafe::d9) by DB8P191CA0028.outlook.office365.com (2603:10a6:10:130::38) 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:46:17 +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 DB5EUR03FT033.mail.protection.outlook.com (10.152.20.76) 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:46:17 +0000 Received: ("Tessian outbound ba2270a55485:v64"); Wed, 04 Nov 2020 12:46:17 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 213d3941c13b3c8f X-CR-MTA-TID: 64aa7808 Received: from 607932a7f283.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 0FBB47EE-8EA6-4124-A131-221077398252.1; Wed, 04 Nov 2020 12:46:11 +0000 Received: from EUR02-AM5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 607932a7f283.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 04 Nov 2020 12:46:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mYnR0xKT2qAeLCXyC5uZY3TzHBxLIrvreoAsm3bqZ7SVqpslCpv5jw6V4X2SM1qATJ+/+HSxW6pJZARQ3L5Qat/6hmf9qYTunUQQymNGm/FGAtNFk//qMQo5/QqwjLhZKCxc9WShb4tS/HiIRdGWD2JJBBuVOJenrPZPsGR0BBAY2QkGJHyEusifG8tvdihQZreopVLj2+O+SqaTZ+Gm+yMiYuRhUGHNhg7iRf0k3otG29xT5VLqV2d5HxYLwtOpzUp1B5Xey7/l3w0CYvPErwaqAu7TV+Bz8qMLmLQ8/VMtw3jp98H92mGeBC8PburbrLYIsGnVsUr/uCKd2PzHlg== 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=ineqPf5IPvimUexbyhwXLKzCo5FDXNw8tA99Zo0DMRI=; b=PhtnV9x9IlzN6yZn7rnfk7rjKcgjC03Xw0glsTqB5Mo8i3GyuivrQInUtl5daqbo7QBxrVhDF48UKby946rsYXLjUK1R/+Y1uaeQtSAwxCKqahGNkOyO7O0FIleXkQUU6oEsPgymvhvSaVKdDSe5cpNuTOXKvf+dIg2BPofPgPT9oNDP5nGkNjnpInpVCbhr0YinDhoGSf+wIkdN3YeHf4TCWjYlM2iDw6GCQwdL2SB9j5SxX4TQM4IA85HyMk8tOLn+3LsduDAz6XcQUcm+isQS3UNYvubNCVU1zTSMb+aN8L//z/Wb1II2+d1MyA7xWAPR1KwqZrlZen6+3NwZIA== 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 PR3PR08MB5865.eurprd08.prod.outlook.com (2603:10a6:102:92::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18; Wed, 4 Nov 2020 12:46:10 +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:46:10 +0000 From: Szabolcs Nagy To: libc-stable@sourceware.org Subject: [2.26 COMMITTED] aarch64: Fix DT_AARCH64_VARIANT_PCS handling [BZ #26798] Date: Wed, 4 Nov 2020 12:46:04 +0000 Message-Id: <20201104124604.20879-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: LO2P265CA0186.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a::30) 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 LO2P265CA0186.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a::30) 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:46:10 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 48e355db-9e34-4593-0626-08d880bf9f4a X-MS-TrafficTypeDiagnostic: PR3PR08MB5865:|VE1PR08MB5678: 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: d7tlgkgNbfrKgW/BbIYDAxAszPYwR6P2/pCeAz6F21ebpCFWjbVVpkTUttqdQfoDYNRIbAV9yLruO8f9izLTwFIBqpxzCoj8VhtmicXaHf/OZYEFh2Cd/UkDWS89V/9snCThC+VlGrQWwnk5EvGXaiydk7esXdj2k1M7bdSZfPREbzTBWPtQ6jehHe4qLoOy7MLVco4s73QrHDlYsH5S8t6QiLo5JcQfgxUDFWl5ubQwEadpreBlMPR1yQvmpHxCFSkBlBijPnQz9bxY2RQayYHOAy4J7IXyoZnut1spptcqwCjenkbGlD5GjH+kyVJGvBBT+g8DEEJzfW9GxTaT/6seS51J12topRNhrxlcEmlyRLA1BLWRCuHeuRd4BviL 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)(396003)(376002)(136003)(39860400002)(366004)(346002)(8676002)(6512007)(52116002)(26005)(44832011)(66556008)(86362001)(66476007)(66946007)(6916009)(69590400008)(1076003)(36756003)(6486002)(186003)(6506007)(6666004)(2616005)(316002)(478600001)(83380400001)(5660300002)(956004)(2906002)(8936002)(16526019); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: oL3raWWTuIArLxpk6tFMbkPVBoJ3/eQe/sSTw6PktISpDfr4zknaAE9QztDmihhhkLD0eWQa7PgTq9bOOgEuuew2e05oUEmdK879MtDJO1HyGmiQR2JY0DmDUYeGOu2axS1h1NadsrliAYI/f/AQHRKlpcEUDy0hJSHN5kybN4aHDKvdvpLxwKRHckwEI8UNysa/6HgaUTXjq5N87cxJNT0L2x9fSl6ZqoExdvoD60a9bskjTE9pWmlDbdyjpcrT5OmaowI0kYVP3bCGriO7mXJQPnmEdIZM3cgyeMutcjiFqaKtYZ5MREUFQqm0Hanjn9fIgT2RoIKRqvtCmdSfvprCOOrid+/kniCDNc5hQl+nE4sV8wJZ7ou5dz+XzJE2PFXTVm+JXA2D48Awx6HHLi6M1vpEjoe4qZn6y2nMYP3NI2TFKTofAmqnNw/b46+7Gt+JCeOTGuMoTYwjvZABDRSLJsUXH4tJDM5Y9frau8JiNGdeq6KFOE2/tucvtrvxH4TZk6auFfytUOZtJLMElQFp8+Ynr+53lLkah+D2olhjPYUvUf3TC2GnUadKLKawn3A8NRptQ3JFmxdPHKdzdYjAMlX5CGnfdFTw1PA0pQbErbDRqvorrKk99KSUbjlMPpbqae9ISk5oUYGotG0ZKg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR08MB5865 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: DB5EUR03FT033.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: fd876f3b-9db2-493b-60e3-08d880bf9b4e X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6LPLdJCsqsY2jyGsfBVUj52bS6bEK8fJdqBpTVxKUQ4T/xzoc6eZX5Kdq2NyhImyiWUEZvdK3Sa3yzh/MlGGMhwosVENxZAuG56FWd/3bzXnWpR+NFwFbM1CWhHsJIOZvrqT+BHaZtu52NpOGI4YmHSkwJpQCwaovcbWOqBWjb7qzp3Q9goHsaq0RD8tOfLvAljMZiolFPQcil3NwkjfTdZcRsX0NfN1NmLqBUGFZ9eKwe5B6iHv7OxgUQji1R520PUumsDBllSc5gxszpCRlI0rYin4QL7TxmFN1Ec2uPSSXCgE9++UIVD341ek9loF1DbX33nV46DohyJtrfytXiNauu0QozqA86R2BC68YtW5D6MZRqAM6ThlQJwblZBCBytT40OF2Rl5BDOqCZK+2Z4KQQj3C5oIIH9n4/AK5WSI3QUx/hBFJy1AspoSQmX5 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)(396003)(376002)(136003)(39860400002)(346002)(46966005)(6512007)(316002)(2616005)(8936002)(478600001)(8676002)(69590400008)(26005)(6486002)(956004)(336012)(82310400003)(44832011)(6916009)(16526019)(186003)(36756003)(5660300002)(83380400001)(70206006)(70586007)(1076003)(82740400003)(6506007)(86362001)(356005)(47076004)(2906002)(6666004)(81166007); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Nov 2020 12:46:17.2397 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 48e355db-9e34-4593-0626-08d880bf9f4a 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: DB5EUR03FT033.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5678 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:46:21 -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 9ffc2e4c9d..b5a0bdad95 100644 --- a/sysdeps/aarch64/dl-machine.h +++ b/sysdeps/aarch64/dl-machine.h @@ -391,13 +391,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. */ @@ -421,7 +414,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.