From patchwork Tue Jun 4 17:41:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 91504 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 945C038D472C for ; Tue, 4 Jun 2024 17:42:24 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2089.outbound.protection.outlook.com [40.107.22.89]) by sourceware.org (Postfix) with ESMTPS id 78A2A38D0EAF for ; Tue, 4 Jun 2024 17:41:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 78A2A38D0EAF 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 78A2A38D0EAF Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.22.89 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1717522911; cv=pass; b=ClKgentLunoqAQZ5q6V73nphyAyOIwV5uKOpQdMSTbGVmEmnJu0Uaeo8904PoaqVbyg93qzfxO0NiY5G02RhFa3T7DNbvOOoaAjj2va7tvoVSaU1ZuTphjisa0B+OVih7POk5n+6wKn320YdF1QQNdpx7uzkmkfMSdO2lahw2uk= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1717522911; c=relaxed/simple; bh=lUvzpogeB/q3Yt+xFtN2Ngk6+Y8Aw3ZxovbkF6jgbsk=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=dUfNRCjbau950Mx3xblxdy/3HXZI90qAcXdPpK+wXwFEkXxZjp6qp/hpczFDROxpRxDwaVo87bAFsK5uG6QQ4rqbu8WhWfj2V/reHKzA4igfsPyJc37MB3Nh5ZOEfSQVEoJdFSPj7oD8GDRf0WAGZo5LRNMwgupIcvldTct+3XE= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=huP+wxExhMTiZgpo9SaroejmQhQNW8Jch81bHW+uTwhrAPwg0aBQI3USiEKJC4/gObGqhYriOPGqUMBBkZPtV3/fnswOjKXRxZGzDW82+F7WYPTeN3x2hhO0K5BvXosGO/buWpp7vR445CYKSV1MugJ6LhMyeea8tu2Jl04xh7s4cJ+Ujs3QVkaHt8sfZN0pW3f9pBw2yctAFdBh1uKMddW/UQJlTxIbjqKfK/wSdWM9y4+cOK5Qndn8yQtn9+M5MeY6Dqa9HQvIKwtJ57yX6LUpErkOuJUPlb2u7AH9X7vKo3w13Ey+WsUwgCYHMK8fqxX3bNO+HiHPLSk+FHvoOw== 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=Z7yDuUMi01c5jS6ovm+yD7fVn7F9szpLwhoiclxelUk=; b=SJMlTfqkkNdKz95r37FeJCxhkwia5nBIKmmSWRCde7y2/HTx5X4E70FRo7NVn5220ZDxAK2ocz84GyvXnWeoY6yxfRf8AuSqAI7x7o17t425PCQCZUgcSInaySlIFUXnxiRoJRXzl4Tieh25Zr0phhkYjXqiWQo2+Amp39uiameDGiIT3SI232bs6zkiwI2ctuZfTwpg1ySghWEQR0TrW1yMtqRBRu6A4oKr5JB8bI8jqXKC6VQ87/q94M4HQgrQ5XwD6fbRFaDietgDBGn8f8ker1hRuc533XZrTXtYw+Dm8kvQZpC4Nl5F3V0y37C0TmmxWUjtdVoMmJcu3XXSDw== 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=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Z7yDuUMi01c5jS6ovm+yD7fVn7F9szpLwhoiclxelUk=; b=jAw4V3z/smki3tLmtjhZYYOf7dB/37pgtAUu4wAPWn5SQviv62fupAhBl4JMWlWl21PhrSGtSQO4iXehQdEceztq5FbRSxDGWvHSgFPp6pcd6i6p2ugnOdz4LtQ7CS/pj9MMHksStaAWHogSCEuS+rxDMaEbct5pIWWVb6WAN+w= Received: from AM9P195CA0029.EURP195.PROD.OUTLOOK.COM (2603:10a6:20b:21f::34) by GV1PR08MB10690.eurprd08.prod.outlook.com (2603:10a6:150:161::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.31; Tue, 4 Jun 2024 17:41:45 +0000 Received: from AM3PEPF0000A795.eurprd04.prod.outlook.com (2603:10a6:20b:21f:cafe::dc) by AM9P195CA0029.outlook.office365.com (2603:10a6:20b:21f::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.31 via Frontend Transport; Tue, 4 Jun 2024 17:41:45 +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=arm.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 AM3PEPF0000A795.mail.protection.outlook.com (10.167.16.100) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Tue, 4 Jun 2024 17:41:44 +0000 Received: ("Tessian outbound d79ebeff6a2c:v327"); Tue, 04 Jun 2024 17:41:44 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 1511c1d0b2c7e469 X-CR-MTA-TID: 64aa7808 Received: from b32fc214eb49.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id B53DC412-63E0-4CD6-910C-7E147667AD71.1; Tue, 04 Jun 2024 17:41:37 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b32fc214eb49.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 04 Jun 2024 17:41:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PpnaFKjb/EOZSvZ57JKtscfwaCoR25wAw77OS6pf6Bc4T7/j/y8sVRm5AwV6g7cUKU2H1RKBqcsUJEfeq6WnTtG3HjIzrePR/yRwptxJw1LJ6ccZUsIXWHw5ennfZYdQSY137NUB3u1vdhrbgWoZpBXSIkd3VJi1+xCvDI9Nkgbcte9Zemk9mq7L/mkdC2wizElfcHdhJ178Ve0qgmVCzr+GIjSuhbEIfTs4FBwVvo4VRm3Ek7YPtY74R66djca/bdUbBHoCvAm0E3hSb6q7dnP+NA4MMowvG0NHHn688hTIlcZc6FBfeSNtvVTNAlpaNgq+EnDaKV3PPrDnXGwJ9w== 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=Z7yDuUMi01c5jS6ovm+yD7fVn7F9szpLwhoiclxelUk=; b=Djci5fXfZdSVM47Rw11KE+ZsxD3q7SHuRv46ONUYg8BwGj6us9huf5EijrLts/lWehu/6tVpjq8XSx1gBTkK2CCpcDYQ0H4c+pBQk3VYi3CBb854mGq1jHuWBe13S6t4Y3ues58hSInrqOj41uqHX/Yf/PThOiNElBPFAh3IZQWE2DEh4G3Sd3gpsTsuvDBLitReRuF9cbmTdnFKY3MXexWDI/Xp5h7lx+Stmb7bjVBK/lu72slm2UPwrG0BnwlZUmrGHjjdq7OLGnyhIQqhxG9dbg7OHbj7vrH8X/rM5hEzONG5Lh6OOUMNHwNCu3OSLmbEfGCJMiad4Bgahi46Pw== 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=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Z7yDuUMi01c5jS6ovm+yD7fVn7F9szpLwhoiclxelUk=; b=jAw4V3z/smki3tLmtjhZYYOf7dB/37pgtAUu4wAPWn5SQviv62fupAhBl4JMWlWl21PhrSGtSQO4iXehQdEceztq5FbRSxDGWvHSgFPp6pcd6i6p2ugnOdz4LtQ7CS/pj9MMHksStaAWHogSCEuS+rxDMaEbct5pIWWVb6WAN+w= Received: from AM5PR1001CA0024.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:206:2::37) by GV2PR08MB8751.eurprd08.prod.outlook.com (2603:10a6:150:b3::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.23; Tue, 4 Jun 2024 17:41:35 +0000 Received: from AMS1EPF0000003F.eurprd04.prod.outlook.com (2603:10a6:206:2:cafe::4c) by AM5PR1001CA0024.outlook.office365.com (2603:10a6:206:2::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.22 via Frontend Transport; Tue, 4 Jun 2024 17:41:35 +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 AMS1EPF0000003F.mail.protection.outlook.com (10.167.16.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7633.15 via Frontend Transport; Tue, 4 Jun 2024 17:41:35 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.35; Tue, 4 Jun 2024 17:41:34 +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.35 via Frontend Transport; Tue, 4 Jun 2024 17:41:34 +0000 From: Szabolcs Nagy To: Subject: [PATCH v2 1/2] aarch64: Fix DT_RELR support with discarded sections Date: Tue, 4 Jun 2024 18:41:34 +0100 Message-ID: <164ea78d38dc1ee3fffe0380df23092fd3f8541d.1717522516.git.szabolcs.nagy@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AMS1EPF0000003F:EE_|GV2PR08MB8751:EE_|AM3PEPF0000A795:EE_|GV1PR08MB10690:EE_ X-MS-Office365-Filtering-Correlation-Id: 25a98315-0c64-4097-59ae-08dc84bd9a27 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230031|36860700004|1800799015|376005|82310400017; X-Microsoft-Antispam-Message-Info-Original: 1mUnPiT40eyRkzURq4FSR3DcWOFUdw5NAJD8Uj9QgZo43sBfeovm9pR+wqb1/8Dkj9jk2lT0C1sC1YI/FnKcAAolkXlg4SpFIXaEYELJ2E3Ov5IVvvDhpvKPq9aqOAn2316/+3h76M0lQJMl+r1OoJudgonXktUig07e2UUz+BXipPHn7dEhL0gFUr+E6o2nt6UtjXU040pGKFUkFEAOIDzQ6i6g3L369+sXgVadMBEjTJCzNIa1wdFbUy43stvWb4Z+IrXkui2p0OUfBbfDVVc/Ls9U2ey8AfSNB45b8XcRk5bGCE1PmHT5YiJyVdhY8pElW5fmHSqL7/YTpupyUHy1kJY7hbCEbEwum2NgJ3n7DrGKcOuvpk1DPRwraBlTmy+yspHS8ddDvQG9xnjzLixXA9dq7NDkdwMh7el2c+8EUY94ZpJvh9xiTGMZGy8BxflKxGkjac1OT4LMcjR4rjAmEJZ8BOyAdIiD+MPHk11a3l+/TVjZ28H3R/wtIz8s+BsNka/LkQZtbcI29B1ZZX4d8Eh5oibD0/lqq/tqR3scK6a8Q8kJoVWppZ9pJPfnz0JFDiXHOvZPQsW9GUx0/YvNhmxnF6TyRzyFlEEg0V8HGj0iq/ht6dS38UYOrBWeraCf68dSRrOfjI0U3q5RZIRk3B8AuSfCxIZ1En7oAXy9mJrqwjih63ClN+CXjNntrD0DrEyf7K2HsuN8PSWt6x+Vca7+q43CYEBnblm87FbMAHilG0nR8Kiyd1JBJpybIew2VcAaw0xrmI5hIz3U9oTkBa7iHR5+hUGIUH2HekOQvGRHT5Oka50FkTBZQEqSNj8hUB+z3/MuGyj88wnr8J0wukDLB7xcB7hjN/9G6tSB5yz3mNh2NthUTqvSLcwB7HnZi8CErQ8F24O9BbamdCAZ+gevX3IwJYjCdc2mB6sqUtN2/Yd2p+AwdklW2jKTxMPy3cAOYodfS4TuGV6aWj0rH0B4HoWZlqAWJU6kIkSKwJO1vFgwRmcAXPE+P5yYi8OcmAGZ/8mjovZtlWG4W3H9zGhxQ2TvY+hyj7BcpdFk7mciGw9HEFsrc2vCQAQubDU5nLsxE96P/pTcaaWWfXvc4eu0KbOM+3TzbUCN9Ywjzi4snWldGf/RgfXhIfHDkhSq8z8kWqfnLlzVJZdC1SChcUxgdTltCI+iGYA7LTv1F7w6YLPga2NpT3a94ls1+dnheznf31o2rNTN2gCMhRKtMfPxbzAiNclb6lJCbL2Q7/ktp7ovwgUKHMukDMwVlgL1hyVJCST+Z2M76jkTR+DRJcnUSjd4qyCXdeRQrDdCm/nS3xUCRhWI5Pc8y6kYtZbPybkkU7n+1Zw//kKlJTB6r0Ks7bcrfLy15VFDRpjdi8WNOlbXLrwkL9hjNRJU 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)(36860700004)(1800799015)(376005)(82310400017); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB8751 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM3PEPF0000A795.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 44f288b4-0fe4-4be5-5605-08dc84bd9455 X-Microsoft-Antispam: BCL:0; ARA:13230031|36860700004|82310400017|35042699013|1800799015|376005; X-Microsoft-Antispam-Message-Info: 2ZDKGapV9cSmBSydrIXHpPYtKKLRvckMH78yK6BjDnh4pbtPPmPmHANYr+Kb+VXd8+Gxy1AW3F0qse31wcJdCSm1aP1aYZwc3xtZr2A2rZu9aX1brTqM758ciYYiW0T5uabgm5HiF7dWfXhGHC+qP1e3ulYbd9ULAwhI4hVsNQKZx9uw9XeXPToPVuuVsZSkq6zu3+VEmgI1hLdCZMouP2g/mXpC4bDr1LD+M5xNYQdjq4dwELkg8SVGG+MB4dJOb92Xoo4k+3FIUzxq0uP8vfCqsYuawzgKaMzVSuapdxM3KSvWy963wCAG73QwwRGtQGueC65N5iumAX6+JoR3XSqql4StybSb7pm6xQ7CkqcVL18qbj6rR7dk92XOBaaWduR+LW5thL8XvLL/7fp5i/bgAcZYkszhqIB/ztea5gLIM3I9tJdATrFp6TuvPu3v1rrvi+Fx/urdCxxzq7rDiEIkGYyH4ZQPQN7FGInMHhhyc35LMSH8RDDPo1lpk60ejVE7onCyzCFntF9CQxphS2k4VlU2ynIsCVNXfV0ZhdlMX+tgsMDS8yJYC2fgN9AqtssGR8gUgtwU4D7deQvCv4zhGxir+wboc6QjtuEWDPvYPCQ+jfi+g//KrkGoxHYsuH3yj9+j4tocAYNBNuHTqA9f2Pw+LN0NI4sz5f0bc5FQOL/R0MV99O/afMDkkFCTsFy1z9TDyF3CP9t5LyqvYoQ6HGeh8fFRftiLeweWvy32Ld2qScYVaYoTUiXLbBQA1i6ZKverx7FWvtwidbQ52BQzhC/QMHym0s3tbtgUpFN+rD+RTm/rrkrK8+re9oUq5EsmysR85vGr/PjlkRj58s1Go8uiBwsqTd87sUtekgob/4Sx7OyeWa9iGdlIVn6hcXm3g1tkumrJDROrBohFq9sT8YUP+B4l9z+t8+sW4m3nwqfyuw3vKO+EnvEauZXT9PUkdVh8vmcpd00MR0ljo08aMK6OPB/3S0qkR/d8rkstb1RDLbZ7wy395pr5mvedu6fDZUx5TzR0F71T8XYDXLqsCiH+6MAeMZewVAojpTsgoS27EDohoPYFY7RFNZDXrCRdbYO23E7VoFxMl+kvb76zTLPTi7eBOi4ou51u0K0CkgnbAZz+u04j7rx3epHCf88PNS5f1NFmvFsXsHjMIXUJGif2JMGdDR6QWn0yMpCUbF8BPKrnMtkpj91GXs0B+0iKpO+Erxy4OjuWfLuiPweeEtHmOnUc1RDtX2c7h6m55eXf4J7bBFTxrPRral5QjlfNSRrA1JqlbCcOgtiqOj0LElFPG2+leS6PoY5XZafiIrQHapESDuiC+Z91eoqf6WboD46cDBA7G7/ZmWuasFhBKWcqobIjV6Fdd0R7U2mCGyV110yxh09ggsLe6+z7 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)(36860700004)(82310400017)(35042699013)(1800799015)(376005); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2024 17:41:44.9098 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 25a98315-0c64-4097-59ae-08dc84bd9a27 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: AM3PEPF0000A795.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB10690 X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, 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+patchwork=sourceware.org@sourceware.org In case of discarded sections, via /DISCARD/ or .gnu.linkonce, relr relocation accounting was wrong. This broke building linux. The issue was that the *_relocate_section logic was copied to *_late_size_sections to record relative relocations that can be packed, however *_relocate_section is not called on sections that are discarded, while record_relr_non_got_relocs is called for all input sections. The fix is to filter out the discarded sections with the same logic that is used to count non-GOT relocs for local symbols earlier. GOT relocations are affected too if all sections are discarded that reference the GOT entry of a particular symbol, however this can cause unused GOT entries independently of DT_RELR, and the only difference with DT_RELR is that a relative reloc may be emitted instead of a R_AARCH64_NONE for the unused GOT entry which is acceptable. A proper fix would require redoing the GOT refcounting after we know the discarded sections. --- v2: - only commit msg update: i realized that the GOT case is not handled right when DT_RELR is disabled so there is no point trying to fix that here and unnecessary relative relocation in such corner-case is acceptable. i updated the test case patch to cover the GOT cases that currently work. --- bfd/elfnn-aarch64.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c index 81f1a646125..02873f2ceb2 100644 --- a/bfd/elfnn-aarch64.c +++ b/bfd/elfnn-aarch64.c @@ -9327,6 +9327,10 @@ record_relr_non_got_relocs (bfd *input_bfd, struct bfd_link_info *info, return true; if (sec->alignment_power == 0) return true; + if (!bfd_is_abs_section (sec) + && bfd_is_abs_section (sec->output_section)) + /* Input section has been discarded. */ + return true; sreloc = elf_section_data (sec)->sreloc; if (sreloc == NULL) return true; From patchwork Tue Jun 4 17:41:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 91505 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 8913938D473C for ; Tue, 4 Jun 2024 17:42:33 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2061e.outbound.protection.outlook.com [IPv6:2a01:111:f403:260f::61e]) by sourceware.org (Postfix) with ESMTPS id 809703AA11E9 for ; Tue, 4 Jun 2024 17:41:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 809703AA11E9 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 809703AA11E9 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:260f::61e ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1717522921; cv=pass; b=IO8k4Jnk6wz3PZNGInPR+yAmbulU+LZePi/8VKFNMvdrBhjrKQq791rN3bNXoFQ0PNZQ1uaEUpUWUy31S7k7nHBAjEo/xPTi6N42DsUcbTV8f+ipNF6RfdHnji8wDSteCYvpsjlatqTW9vMDxIJqAdXpeCugVjwKdWVPB0RUnl8= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1717522921; c=relaxed/simple; bh=LYYAjO2z+Dy6FazLlEKv+JSfN7n9mAQry16kf3spFcU=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=l//WxTObELJFTSQ8o3ATPkC0WuFFLo2wPYOiqoH7lUwaTUVN8052e3PVKD9TY81SVzTfN8sim1vk7BucJD1qx7Ms6ITMWfXP5LUNl2fHbZ8yMLPLouqRg+TqhmceTCNvk3OQLTXzdVhQBBJzTSFRrBR0FEk8MlqhmDTaSW8LejA= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=NT9tnqHzjV/Rwz8wMOhRRiHw0S67SkUw19DPrHpcYxyxm2Xe0Y1DW81+0WFYKWB6UD1fiHU3UH+zYjPlku8c3ecJxapESDCMaOym01a8PMZ/FXEhu/7jvE+1Gh2enj+ll6JBMDVPs/qlX0jkfa3Ka0j9vNlT3pwaM9B2wPWJnYLGMwh0WK9I+BqtUQT0Oa5FeJRjy1hC+8rhkdS6/UqKckXUNAtdAjYd0lm0gswVYf9QWcVduTbbBHPGdFDTo16jbD1m4c7SdHA4nZryzYjKWOFQQr62EunGWNXR8/90YaPIC0jIIEDD0U3ll8Nyq6Q238jmyMGcdoYqZx4fKbcWtw== 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=fYaPNF73Ak5bZTSplADeXjXqZDESj7RL+UTZOeKmpwQ=; b=A2xI4dJ9c6cEGUFCrIW7CXx5PlzSNoQIh0CdRnxJbjFIDDGwb2oH3HcWf5EVZDWRwH2ouUXSSA1q7ahCpVvNX2aqILuA1/AQnPwW8oeD15PgvHVwIxY3ckXF1R69ybQ4d27ZSLQJZkykvAf54ldF6yAzkOXIALqE/b1BaHQKCM2YTf/C6H/u995wYzCbHGB4mdjMNRoZbAbj4MqMSPChGWUHuwBB4vrVKKqZRz+lJ5DPrDJdeFwWnyCR3TXRgZSryVecRga+8J4zt4fXbUrmvaaBe0g0cOioYWmmvWdObc/4iQz8azbxrT8ejtQ1ZBvcVcCPmIRqyTlwKibFOC6uAg== 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=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fYaPNF73Ak5bZTSplADeXjXqZDESj7RL+UTZOeKmpwQ=; b=iZeo3mrxcOkDZXPHe9ajUb3bWh0eMk20LxrIU9PYXLR9wsJNv5XPBVyEok2EKYfv4YmYCjuffjRnHEm9SZ9D9x4XiXvmP3RY3kRBSZJrLMSJDTEueP5yfZenH/anVvTSFr1LE8b7U6JZCuxtJ0T97Ah63LlxgzLJRYZCfM4v45E= Received: from AM0PR01CA0075.eurprd01.prod.exchangelabs.com (2603:10a6:208:10e::16) by AM9PR08MB5875.eurprd08.prod.outlook.com (2603:10a6:20b:2dc::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.31; Tue, 4 Jun 2024 17:41:55 +0000 Received: from AMS1EPF0000004E.eurprd04.prod.outlook.com (2603:10a6:208:10e:cafe::4d) by AM0PR01CA0075.outlook.office365.com (2603:10a6:208:10e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.30 via Frontend Transport; Tue, 4 Jun 2024 17:41:55 +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=arm.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 AMS1EPF0000004E.mail.protection.outlook.com (10.167.16.139) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Tue, 4 Jun 2024 17:41:55 +0000 Received: ("Tessian outbound 101c07e38e11:v327"); Tue, 04 Jun 2024 17:41:55 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 00d1dac23b212727 X-CR-MTA-TID: 64aa7808 Received: from b72f03c0b302.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 9D8ACDDE-F5B0-4FB3-9C74-0DED5CA1F51A.1; Tue, 04 Jun 2024 17:41:48 +0000 Received: from EUR03-DBA-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b72f03c0b302.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 04 Jun 2024 17:41:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WnRUgSbQ+BxCYJJBHU9M4JVFBNLaoViQcNLqATwSPnF4Jo5g38q6pCnYge7lyodbNtNH3Ydlie5pq7MdIPBRKqMRwE1fC0pbSa3AM0snnBQUdzxuYE6gIaFEQbPx0OhZdE2R/zIxGH5494VpZfcQ+mYrLlrIk5owNPMl9TeA+hYHnhiSqgBE5Z0Ft+aSMQFgdkBGMEH01lAzgcxJYgfFExK8uvWcrIdHzzyId7iOxl29jCSsSS02hVhObSItnPTa1iO0Hk0Vhia0d7sEcgvqT2IX1wCMC6EXFtOhWPja6sbcl6pbloiqZd7NeJwNc1yy4yXtpFxeIdSbWUES3D0cPw== 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=fYaPNF73Ak5bZTSplADeXjXqZDESj7RL+UTZOeKmpwQ=; b=cCx3G7Y03W2rXM1UgUw/BZ6eXY8KIAM5tHJkB79ut5eCv7QuKHougX/uVlxKTBRVk2vKUu4DUxkWn1/HDCJ4Vbr5XX8vP19d7U42vw5H1hOSg3v27p3dNjFuzDmZejXhT1GuAkiwliDhbYFEAeHBq75WhsNGqWyIIE71vGzDWUaNZRJyx53i34dthq6TntCadb4gdkR1pWYpreh9Tw8KrCX9Gb5jtAoRy3QiGexs5ocbrexHuDtfmjqhCvtMPs4wNooDqU+Br0rX2YxNPr7rOqqvnFv7qy8quEZOufEo2JbxVfvld6tgeyO/GieLQi9RvplrS2SmH3kmM0TWLgTIOQ== 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=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fYaPNF73Ak5bZTSplADeXjXqZDESj7RL+UTZOeKmpwQ=; b=iZeo3mrxcOkDZXPHe9ajUb3bWh0eMk20LxrIU9PYXLR9wsJNv5XPBVyEok2EKYfv4YmYCjuffjRnHEm9SZ9D9x4XiXvmP3RY3kRBSZJrLMSJDTEueP5yfZenH/anVvTSFr1LE8b7U6JZCuxtJ0T97Ah63LlxgzLJRYZCfM4v45E= Received: from AS9PR0301CA0007.eurprd03.prod.outlook.com (2603:10a6:20b:468::27) by PAWPR08MB9758.eurprd08.prod.outlook.com (2603:10a6:102:2e2::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.25; Tue, 4 Jun 2024 17:41:46 +0000 Received: from AMS1EPF00000041.eurprd04.prod.outlook.com (2603:10a6:20b:468:cafe::c3) by AS9PR0301CA0007.outlook.office365.com (2603:10a6:20b:468::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7656.16 via Frontend Transport; Tue, 4 Jun 2024 17:41:46 +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 AMS1EPF00000041.mail.protection.outlook.com (10.167.16.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7633.15 via Frontend Transport; Tue, 4 Jun 2024 17:41:46 +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.35; Tue, 4 Jun 2024 17:41:46 +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.35; Tue, 4 Jun 2024 17:41: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.35 via Frontend Transport; Tue, 4 Jun 2024 17:41:45 +0000 From: Szabolcs Nagy To: Subject: [PATCH v2 2/2] aarch64: Test DT_RELR with discarded sections Date: Tue, 4 Jun 2024 18:41:45 +0100 Message-ID: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AMS1EPF00000041:EE_|PAWPR08MB9758:EE_|AMS1EPF0000004E:EE_|AM9PR08MB5875:EE_ X-MS-Office365-Filtering-Correlation-Id: 246c63d9-4e66-49d7-6783-08dc84bda057 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230031|36860700004|376005|1800799015|82310400017; X-Microsoft-Antispam-Message-Info-Original: uy//9R/8hSWs1rUSd6y1kVCGph0LXysBksv72/t0xmm0Qrjvgu34lEQxgUnJNVfxrX6T9ASReyIZDdwD/HCp9QEgFCiM/lmBJjcc8PCf7RdXmipjP1aUi3TiL6s0hQ5xLYJGJuLBCoQyde+Q7oBHB+JPX7ZPsfS5OI4RpNXjCPnYVevyleLDsD3uFwETOHmfPqhnEbNfp95tFHCLtQFuZFy0ODjiC7bH5iijglx2fLi6nx3fewqCjDIB837jrsqn+Hz+oy9FKH+xYhypw4AyErwmZh5TLFfhGnIn+fY0BXgkv2jSQrDaAPalnzsD3r1MTp6JPaLnAKf+gCuUGUSLcz/ZS3PtNt7gCOBEqOFAX7b/GhRbRiZ7hyaGX74MRm2M6rcpphhezvP2MCI1SKns8302b/rBifdJCuxUs3OzHvWTYcvPm53+y1MOVqrQ5cdLT8cX7vwmJWlMez8X5+vdp/lToY94UTqSTEjlIRWBjXqoMRYqCDddbQYCYONTDo7KXzi/kV2apLjtMvC4QRL8y8H9fuRCpBeJ4RV7UY9vENnkEXABX7/PICbdzRrLeihKTsL0duUUz2NRZwnXnBLXJ4oG/2iB7mo2OPdpC9upE2r103rViCCPP0RGc35e++VZpVmE4EOFhTjPQ7+9snvPX71oEBctRV4OXGYMKol+iEGH5X8Z8fA+qhnhkt8dWhu6EALxhQM5NWNp4UgtjTMgXfqx2dAl0YtEIp8EmsUfPtYRy5YyNjh4Wlhlnmr05UzKjIqHM16VKhgl2YuEKFIjDWvR5oJoQNfJ0r0mOFfxKAzF5JQqyGnaBtYTyXzL+ydCg2bQrX+zz25TYu/piTeauJF8sZDvEt6a1bZkr36R19OZnMuAYJnz8grj9FHGhogXPiMZAzHCc3NeSp4LdNravaqQlwiJ7btjq+fAbROl27YJcNjUfIpetSLEhZ+83Gzl9jv6I1RmJKyCFXrulKwIIsNGHl/l0DUKnxqehlt4dTQ51fqfx8gmUzePyd/lsZEddeoYzLg2N1/GD+0hjnzc9yqMbDItNjncrWbcw7vv7n/sBCmHurBT2wVPsJ5aPFb8a6MZkwgNpl3PLnlhoc5OdgoOXW796jru/vcUz51/WGnCMeoL1x+9n7bKoMpjZ2puKdqlD3bwkeIVIiYfyIWCu3IqC7unLJB6iY6Yip+5lAYmvllzxWViVm9L5gDaNK2mtrRVuOciRBEgFEYcYwxJIqJBDPnnjtZR9drAVSnKdfH+/aYH+PZd70M7Frizzxp8PWHKa+BmJye+RplkikLwiE33EEcosFSYZRWx053gHgHZgsqlxqMV2vnbf76wuPFP7xJ/JefQC9+AKMC5vXkFau1U7kahzQAGQBivTpzk5+U= 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)(36860700004)(376005)(1800799015)(82310400017); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB9758 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AMS1EPF0000004E.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: bdde32cd-1932-4560-d45b-08dc84bd9b0c X-Microsoft-Antispam: BCL:0; ARA:13230031|1800799015|36860700004|376005|35042699013|82310400017; X-Microsoft-Antispam-Message-Info: dyi4ULARL7SXJolnc/baja99BVp6zRkjD3xfpYamlXrUFCE2YqB4VwGLR8/K4spQLhs/nJmsn4fPkBf+n4WnCv+nyRMKwiIgPw+mO3a1bYUffYpfGoyNsZikx6EzJxM3nTTBRQu2vGvxjYhdnReRZ/7NQMqGbNgk1Iq82tOKAVOWLFqDZOMD6/mj4QU3jxi0dcNof7tETc9HPZOhF265479/2aGGzNJ9JjdBStsvJNdQIIHXNrRD4n+6I9ft1/qtg+Rdn6BVqLrpZ2yEkhrSN9YVds7dvzSBEm6u4cpElKLHmtIfZGkb1mcNIVGLp3n3qof8WLg+x63AJP43n3T8Ve03QoJsR+v0h27mSf9qo8c03Xxzcba4XowZFAUZAWIfeu/FkDiesrTURaicuKSIoGoHSzV2t9aAc+BT0+zUL8rlsXhqBGPFhqGNgV7MEqSPVDV7EqhvxxzGnpV6BnA9ZKT27MyZf1fuepAE3KpA+nJvm92yAgmRER9pAw3E13vd4VzNM0fb34mUIS2pkZ+c4NRBJ2l/jQaMNbp1khvixJjRUWoLzGvLSe+H25a18D+KvzDhrkJhLs02ISWCxGCLWsrYyWolV8iSaX7giZ0Sh7z+fztJQeMOnuFfTnd4Y7mGujskkJYBcPaoXJWZhsIUUw6nmfCII3kslcpht75cyw7/xykCOLqRkZAjKhYlEuEyD6TdeuR+RI7zc237Ot67GTnQ2WZXKH0/WpjoVGrnE+LjM8zODclag3yTQ3Fd7jLywrNGVdpEEtyIRHe9KoAQWBpRzhzvcUV6/UTYB2NS0LpJWmSx+lG9HoVONXWHfNluVJtG1VmnEsLhfYG9JGfQqroKyfhfY7wf88NWI7TtpDC2Q/mtjCBY0ADREHHIprE003JxRVcMjTiMoN4DQhT9sVaBPbVwcLd0K7n5DvgeF0hmCa5UOYVCia7r5Pwn6XnUIkQK9mIFNaZB2NerS9XIte4mBXFlgYCyAFX1DQ7YbvdwHz7EIvGl2F3kqKWvNXLwm8PpeGV7RRChVywX6ulHiO4ndwvLlV7Q/qU923w3aSQFdOFKyz0KHRYILRwEnNITE0qMKMJDAxDF6QV4nYIYCAwNxSSZvq2pz2hhy/9RI1PE2n8RVdEQDum0PwmHwbOjnFHuOKvY7dw/vpiHikVU6KML/kgYk2fetMgZx4PgIp4OC0Pi3emc828Xtxx0btQ9OCjCWwcktgkiv2zi+pkb/flpObQ+LFbOe8eN20gPlCdftIyacbIB8g8z7W4kM0b6aW3cVAtLg2EwY7Jj0MpDPtsBrFHitYSQwKx0bDiIhqf9+LUbuK6qB526TlOlVgzr9h0w9zMlo+9dz9kVVfZ1ltx7Xu+qM4Mb35j/MFxnjHU= 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)(1800799015)(36860700004)(376005)(35042699013)(82310400017); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2024 17:41:55.3067 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 246c63d9-4e66-49d7-6783-08dc84bda057 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: AMS1EPF0000004E.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB5875 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, 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+patchwork=sourceware.org@sourceware.org --- ld/testsuite/ld-aarch64/aarch64-elf.exp | 2 + ld/testsuite/ld-aarch64/relr-discard-pie.d | 15 +++++ ld/testsuite/ld-aarch64/relr-discard-shared.d | 15 +++++ ld/testsuite/ld-aarch64/relr-discard.ld | 13 ++++ ld/testsuite/ld-aarch64/relr-discard.s | 63 +++++++++++++++++++ 5 files changed, 108 insertions(+) create mode 100644 ld/testsuite/ld-aarch64/relr-discard-pie.d create mode 100644 ld/testsuite/ld-aarch64/relr-discard-shared.d create mode 100644 ld/testsuite/ld-aarch64/relr-discard.ld create mode 100644 ld/testsuite/ld-aarch64/relr-discard.s diff --git a/ld/testsuite/ld-aarch64/aarch64-elf.exp b/ld/testsuite/ld-aarch64/aarch64-elf.exp index 38929ffc3c6..0e70ca3e028 100644 --- a/ld/testsuite/ld-aarch64/aarch64-elf.exp +++ b/ld/testsuite/ld-aarch64/aarch64-elf.exp @@ -475,6 +475,8 @@ run_dump_test_lp64 "relr-got-pie" run_dump_test_lp64 "relr-got-shared" run_dump_test_lp64 "relr-text-pie" run_dump_test_lp64 "relr-text-shared" +run_dump_test_lp64 "relr-discard-pie" +run_dump_test_lp64 "relr-discard-shared" if { ![skip_sframe_tests] } { run_dump_test "sframe-simple-1" diff --git a/ld/testsuite/ld-aarch64/relr-discard-pie.d b/ld/testsuite/ld-aarch64/relr-discard-pie.d new file mode 100644 index 00000000000..b1d16e30bc9 --- /dev/null +++ b/ld/testsuite/ld-aarch64/relr-discard-pie.d @@ -0,0 +1,15 @@ +#source: relr-discard.s +#ld: -pie --no-apply-dynamic-relocs -z pack-relative-relocs -T relr-discard.ld +#readelf: -rW + +Relocation section '\.rela\.dyn' at offset 0x1.* contains 4 entries: + Offset Info Type Symbol's Value Symbol's Name \+ Addend +0000000000000000 0000000000000000 R_AARCH64_NONE 0 +0000000000000000 0000000000000000 R_AARCH64_NONE 0 +0000000000000000 0000000000000000 R_AARCH64_NONE 0 +0000000000000000 0000000000000000 R_AARCH64_NONE 0 + +Relocation section '\.relr\.dyn' at offset 0x1.* contains 2 entries which relocate 2 locations: +Index: Entry Address Symbolic Address +0000: 0000000000020008 0000000000020008 _GLOBAL_OFFSET_TABLE_ \+ 0x8 +0001: 0000000000000003 0000000000020010 _GLOBAL_OFFSET_TABLE_ \+ 0x10 diff --git a/ld/testsuite/ld-aarch64/relr-discard-shared.d b/ld/testsuite/ld-aarch64/relr-discard-shared.d new file mode 100644 index 00000000000..b5f3ad87666 --- /dev/null +++ b/ld/testsuite/ld-aarch64/relr-discard-shared.d @@ -0,0 +1,15 @@ +#source: relr-discard.s +#ld: -shared --no-apply-dynamic-relocs -z pack-relative-relocs -T relr-discard.ld +#readelf: -rW + +Relocation section '\.rela\.dyn' at offset 0x1.* contains 5 entries: + Offset Info Type Symbol's Value Symbol's Name \+ Addend +0000000000000000 0000000000000000 R_AARCH64_NONE 0 +0000000000000000 0000000000000000 R_AARCH64_NONE 0 +0000000000000000 0000000000000000 R_AARCH64_NONE 0 +0000000000000000 0000000000000000 R_AARCH64_NONE 0 +0000000000020010 .*00000401 R_AARCH64_GLOB_DAT 000000000001000c sym_global \+ 0 + +Relocation section '\.relr\.dyn' at offset 0x1.* contains 1 entry which relocates 1 location: +Index: Entry Address Symbolic Address +0000: 0000000000020008 0000000000020008 _GLOBAL_OFFSET_TABLE_ \+ 0x8 diff --git a/ld/testsuite/ld-aarch64/relr-discard.ld b/ld/testsuite/ld-aarch64/relr-discard.ld new file mode 100644 index 00000000000..288ba23e11c --- /dev/null +++ b/ld/testsuite/ld-aarch64/relr-discard.ld @@ -0,0 +1,13 @@ +OUTPUT_ARCH(aarch64) +ENTRY(_start) +SECTIONS +{ + /DISCARD/ : { *(.discard.*) } + + . = 0x10000; + .text : { *(.text) } + . = 0x20000; + .got : { *(.got) *(.got.plt)} + . = 0x30000; + .data : { *(.data) *(.data.*) } +} diff --git a/ld/testsuite/ld-aarch64/relr-discard.s b/ld/testsuite/ld-aarch64/relr-discard.s new file mode 100644 index 00000000000..0ed9b4a9098 --- /dev/null +++ b/ld/testsuite/ld-aarch64/relr-discard.s @@ -0,0 +1,63 @@ +// Test DT_RELR with references in discarded sections. + +.text +.p2align 3 +.global _start +_start: + nop + +sym_local: + nop + +.global sym_hidden +.hidden sym_hidden +sym_hidden: + nop + +.global sym_global +sym_global: + nop + +.global sym_global_abs +.set sym_global_abs, 42 + +.global sym_weak_undef +.weak sym_weak_undef + +.section .discard.got_local,"ax" + adrp x0, :got:sym_local + ldr x0, [x0, :got_lo12:sym_local] + +.section .discard.got_global,"ax" + adrp x0, :got:sym_global + ldr x0, [x0, :got_lo12:sym_global] + +.section .discard.local,"a" +.p2align 1 +discard_local: +.xword sym_local + +.section .discard.hidden,"a" +.p2align 1 +discard_hidden: +.xword sym_hidden + +.section .discard.global,"a" +.p2align 1 +discard_global: +.xword sym_global + +.section .discard.global_abs,"a" +.p2align 1 +discard_global_abs: +.xword sym_global_abs + +.section .discard.weak_undef,"a" +.p2align 1 +discard_weak_undef: +.xword sym_weak_undef + +.section .discard._DYNAMIC,"a" +.p2align 1 +discard_DYNAMIC: +.xword _DYNAMIC