From patchwork Wed May 29 09:03:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 91083 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 D98DA3858432 for ; Wed, 29 May 2024 09:05:14 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on20601.outbound.protection.outlook.com [IPv6:2a01:111:f403:2611::601]) by sourceware.org (Postfix) with ESMTPS id DC5EE3865C28 for ; Wed, 29 May 2024 09:03:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DC5EE3865C28 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 DC5EE3865C28 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2611::601 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1716973405; cv=pass; b=YiieubNaV5W33D1cekWb4ZNoDbTUoxVq5M7OYjprAja36jf5ERDLTJ7BzM2joJSTzWFdeOVR6jHIaYEhOpJOK1FKXv1zYePKlW3aaD0dpYBiDCEkYrz6XfvQ+eMLNdyEH31Mvs/HX4krX5p24NEquvKGVUETV2298meUMPIXZyQ= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1716973405; c=relaxed/simple; bh=82AGF8Vq/kfI4vOkyWwAHTMFk0MwIOQURFp71vgmQTc=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=ca37IlCxdJrUnpa28TyWkTODS1M9Nrnr75jloagcaCBmTAM97SFoYf+dxXDQi7LNYTnP08wVbMmOf7UXUh4YCmkwvVKoxGiZd4lWftVwobZXqGl+NORgj8j7DGU1QS6ctPE2sLzzK0PqgFAlpXu4C1wumUHuOsvmDTYkChCwxhA= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=U8jVX5wQggZl08qDf9vd/xXpj/cjalOFtLzfH04a/+0PrmM6Y2UV1oMOrXH2uIw5Vfr5KPpEvTUKb6zd+gwwggeJT6wxcrznFUkRFPJ8i4TTfiuFVbzA82x8vjoGiDRZvGhE4PG9LauGABVkEy/RSuf72D5E3/3Y7BxxZtnrYiwKphW+KgPwPr8CjhVZry40vwjxidoZfyoLh0S1K9X3WTRhd0oyd+wNlFggG1tLj8pQ6UgCSQIEbONtZ+TfEyS8rtK4F0WNKfk+lRDPl9O3wz1si7hUyNtxfBfnHwdJc5hSkfpxhK7FbL6V8hwfjJMBcmj8UPvoh6B5c3bgDd57Cg== 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=FBeNQ5vWFP2UZgcNaXvFa9Vc75tIqIXNmwT+N8igYA0=; b=FIVzVdi0oNrMHbR4KzESnOXN7MGfQKTcjzqXo8LaBAzNQvC9LzPPpIsW66osBjCwXxbWKBvE0c8/Y/75XpOtvjy8QE7HtOTgWMEhduxJBXtpaQgZ68BqenNeCZf3giJIHw4W6/uOI44L4bsrU9qJisobyvJ2ZumVODHoqHYuPjYTu7EnpgfZKANXSfxh2jo77K6R74GmtPlhWuCyN0JmOS7nwO0/w0FL06q7dllyVRFiLbQG5tb8AGRJ7kdHknpGy/d5sHkPBoDmu+fFPLX4XA7fgO/VolbjtYmHeRrdFq7WUFxcbZMhz6VGEKh5780thGkjCkPp3guHrihQzqMk2A== 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=FBeNQ5vWFP2UZgcNaXvFa9Vc75tIqIXNmwT+N8igYA0=; b=E/7nJROAqDApBqusLjR//sjMEPvJim3uhASpUqpdcRPM3pw4M1twK1d+23ExITNuLed/jIiaWCWfufbcyLPjpGhnkVRkV/b8xTb4i+oEScgCAzYOM/YbV+lpNEzE8pBJye+QGls7YLEaJesh7yAxXmch0W43wPDhJ1H/wdoF7Yk= Received: from AS9PR06CA0576.eurprd06.prod.outlook.com (2603:10a6:20b:486::10) by DBBPR08MB6267.eurprd08.prod.outlook.com (2603:10a6:10:20d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30; Wed, 29 May 2024 09:03:16 +0000 Received: from AM1PEPF000252DF.eurprd07.prod.outlook.com (2603:10a6:20b:486:cafe::8e) by AS9PR06CA0576.outlook.office365.com (2603:10a6:20b:486::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.29 via Frontend Transport; Wed, 29 May 2024 09:03:16 +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 AM1PEPF000252DF.mail.protection.outlook.com (10.167.16.57) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Wed, 29 May 2024 09:03:16 +0000 Received: ("Tessian outbound fffbb209f6c2:v327"); Wed, 29 May 2024 09:03:15 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: cc5fdcfa79e4cf55 X-CR-MTA-TID: 64aa7808 Received: from 3e5d378e75ba.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 471CAEA0-376B-4831-B569-F68C49246D93.1; Wed, 29 May 2024 09:03:08 +0000 Received: from EUR03-DBA-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 3e5d378e75ba.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 29 May 2024 09:03:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e51+dUFgIayEBik38E04PdPmoQVNWy+ddNUyS6I0R9wrird2u4iHdga1/y+atuOV6te4178/2S1hdLroKEctNk0BhGBc/t6HD4Rvn/yfbFdlaqJOSVyT+HZjS5CHTkIrAFmtqOxgeLOzGYbjkUCgnvr6JkT+ecwXiB2Bp9O/nDhl6biOn5zNGdlY1U5jSqAEmGzzHVD6xdWJ2VKkZDH4JC22ETfa//v3S77QRyysXGq3wZKL5n2Dmhh033q+Il5R8ceJyOTytAYgKyKGbRuTDN0xyKLFOaIWoPo5nWQ4d1XuYreggSBcHqX7cnbLd+oXWn8Wc2Piw0nxLZq2kQuVOw== 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=FBeNQ5vWFP2UZgcNaXvFa9Vc75tIqIXNmwT+N8igYA0=; b=nMNkeUDWL9rAA+ZP/BgK9LCZImn3//StzAX+hB4Ddfy4vZxlkOKPiXj0XQxAgyIYaohHxls6yBe/bA/GqEksVQT04iIIBJ7vari+6Jx2cU0PoJTJm0TtZtNrb43misuaSO8/DfrGCpTTQvUF5gcu+2hUG2inKHh2mjZ5GtB8l2aJnH8ZS1N44Sh8FORV95nn09lKsDu2bPZZNHL+VGvz415xDPD16+NA0QNVhv32thikFz++nigu9uhN5YmCh2teL4ddSnJtjZevRkn5kgMuORCuE/tZlgOg8sDjGcVir9am3jY/ynuJGqWSo/6eVf2JSM20tTw2OpxFKadRaa6Jkg== 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=FBeNQ5vWFP2UZgcNaXvFa9Vc75tIqIXNmwT+N8igYA0=; b=E/7nJROAqDApBqusLjR//sjMEPvJim3uhASpUqpdcRPM3pw4M1twK1d+23ExITNuLed/jIiaWCWfufbcyLPjpGhnkVRkV/b8xTb4i+oEScgCAzYOM/YbV+lpNEzE8pBJye+QGls7YLEaJesh7yAxXmch0W43wPDhJ1H/wdoF7Yk= Received: from AS4P189CA0047.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:659::19) by AS2PR08MB8262.eurprd08.prod.outlook.com (2603:10a6:20b:551::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30; Wed, 29 May 2024 09:03:07 +0000 Received: from AM3PEPF00009B9B.eurprd04.prod.outlook.com (2603:10a6:20b:659:cafe::5b) by AS4P189CA0047.outlook.office365.com (2603:10a6:20b:659::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30 via Frontend Transport; Wed, 29 May 2024 09:03:07 +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 AM3PEPF00009B9B.mail.protection.outlook.com (10.167.16.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7633.15 via Frontend Transport; Wed, 29 May 2024 09:03:07 +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; Wed, 29 May 2024 09:03:01 +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; Wed, 29 May 2024 09:03:01 +0000 From: Szabolcs Nagy To: Subject: [PATCH 1/2] aarch64: Add DT_RELR support Date: Wed, 29 May 2024 10:03:01 +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: AM3PEPF00009B9B:EE_|AS2PR08MB8262:EE_|AM1PEPF000252DF:EE_|DBBPR08MB6267:EE_ X-MS-Office365-Filtering-Correlation-Id: abcab34a-7e6f-447c-319b-08dc7fbe2d82 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|82310400017|1800799015; X-Microsoft-Antispam-Message-Info-Original: QkUkQKvuMBo07IyOB1PLdpnE3YkQ4vo1lD0ll1HvM6GJCBViAiEeRV+jHhYbwV0q9xVBn7xSrz7kw4rvhrF6+JEBFSPpty18cYV0NdaEA5BvYUNr3CQ1AMR5NBTA6CHMOQZuiiHfEe1UWX+2JBbFYWm2AsoCBiIP5wvn4eltjfv2KjqUkVMsoI54vy3J8ysPCqsBl382So5zTXBvAMRs4h50s4V5Zetg5pq3OoMdF0zlkBgD/4fT7lv/5VD4Pyvs39y15XaM6NRykusKKKxD5wdMtmTud4WyH8Vaiej3b9cODQE3/Z0JRCifn0TBC+TFJdH5wo/9q58qW7xs89AEfzgcFw+s8KAdQRLTbw5FZBKxPw+oxyNXJFCxqQ/wAibLBT7W6EUU2kp0BW9C1ZhOJFhrj3XZbO9GaxouDmO/vx0n6ksipFsuXHaQJcyToKFv1PfoZnJ+fzTqg9udSK1o6rflxFjkovnRt/gpFkfpn9PI3f9bNiu/8CLWLTzyLJI0Mug5zbJ20alZObA6A+8WyqJjl3Jj8NuTVwQku4CeF9J8l/YMwi5haxM/frvbYFVMRGkU8gyPjdO+pheZjqs0mZriIXRmPfGFlgGEn6ihQjB3iH6EOE6eJ9XRhwi+oDssW/MKQaFZFZejSw/cdJFe06EM7LyZDykxlb7aWYUG9p4G6xuNLC7jl2Lqwo5F2NXKoaDS9kteosGo6YvH6l608O30T4TVO2/GGWTChmw1o7FhIXQvRvV1bcXF5NqQjh26Z+hgjxgltg23z/mFfV+jkDMnnoEYJjn+PGh1w7eh2lYijjoVNd5CAqLD+S96fxZypsj+WZxu8MiTbewg+Zvg+dHPa6vzxo4tg2tRlzMnwWpDFVK2LK8ZJfQTnKUQMusgJnVcdoG184wHvYoqw4gpRQtQFYV+ls5SmPSV75+bx57ZyIBacUElAlqApc6qz5MYEEiY/Fmdg/FPVWgxpaCr+LRJFmc+9qFNpa4Z5PdArXkx5T4kqS2gkduI2IE1xG/SVYFNduKCsmxoYUDgLm6jPJR1hsDeIQ0BCQfPviHQbOtaCN7Eiq7vdph7ld1WuSLlXqkY5P9UI8beZXxnsxITdEvQpC5SbMvHXfmF8drvNmIDaYzAJxy5gHmOPnEmJ6jK0nV5H8Itxcz+RoloFZ3on76QvSC2CiFPvz7uxMYhvoFCph8Vza9AeTgu+q8R3pl7nEKHg/xLyRT86nnU/WhEfMz/ix7qh8CA+0b6aVjbfhduP/0XktBjQusOQ4aKuqRE/p2QF/HPVNYB9BHsGcsm8lt7R4Z7uM7I55GvJeXQxg12JA2wSjUnZ1Utxx+RqP3MVUMAOOqYKbXL1VFJRt2C2z11RYayJQtnvgv5AiZkILqAIJsMsqN+LqdJdw73I9o6 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)(82310400017)(1800799015); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB8262 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM1PEPF000252DF.eurprd07.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 744c8a6a-df80-455f-c356-08dc7fbe27fa X-Microsoft-Antispam: BCL:0; ARA:13230031|36860700004|82310400017|1800799015|35042699013|376005; X-Microsoft-Antispam-Message-Info: OVEzAkp8YnFLr7k3UOlA1quKfl7baFch3jiPjCGMhLDHrQDgH37pD4K/VJkdO/+s3/mmBkSA4mpLNn7JyjGu5vmVuXhT3d0IB+wRIYEwA7RO5Hba8iM/XRxPZxz8iuvquE+iCNrFHxbaQTSzmf6v9Xg2dXO7kvk9Nz4lA1fa9RFG/OeAibWGTzUfsMVkJQzAlfhg1LlC90LP3si9xi0mvhBmnrG+TTfEOr3zL6Oz43iVHt5WkEecehqxTPlD9KCgPF16H9P63E/6bu7cDViStYAK1/s6LntUbo0GQ7kLlFa+5A7/Gx/1nXXoIyrEUJCbiYejgLaDZJ0aQuDd3HlvnIW012GBwaTAzhgxqZuEzXcID492NAdtdf5Guaru30LevJRNkz+CHu1rU0SOhPrDpW4oK0gFo8Y98lPPNAKL2lh3UKFcat/EDAUjXB44LjnRm35Yg6h7sB34kqAQGHghb4GtqNAqrEGRLC3MdnHieHMjGCUd8NF67fwK8n1O1R7WNbDKrdWt8CzHsn/IVcJdqi9rJ6I3SpL+eODja84Wsd212J2dCOTHSPq7JdN4hPJ+p9lMlFHHXsKIdQ6wTOLmgjzoqBIC9W3bW9bDZTucHlllMtrb/rYGbn5H3otVHilHexIjvOGXgxD6VcUC+zM7N/5mk/xSgglejNhFStf81n4AmyaV0k6SvJG1gTkk+lC+t64Xf7idxacW/2PabROxpt73CukI6WRfqxi7hVzV75hvjDflaMt6cpXOPcvpBwuScq8CwWwaejMhtITivVCSr2TMxXs4nsu7yHP7sZJeaFhoSvFRjnWLI1faag6cFrKX+++zaTXdwFhr4lAzJunDyx0Nsq1KLai9lbHU0TXbBJS0b8ARvbJIPdO3tfUdIb0RMssGSAZPOEpnxKHR41Knt0L6oeB+C1vGLXI4txAqCCU6RpD3Zz/du/o8UAZooBktVZta8g0FxR1sdXr7pTk9S3j7qMaKZhTdIYhZpAYcIo2g3HBhyBMpxrbpN0mTXspaWQyiWOKi8SehVqAo+fPPGskBvH6lyknssmSg3DITwoQgpujKmHi5yIKFTYl6Imn46EJRSSD5+t5uJEJDTZ67mqYA9y/ykFtrdwkaz+GGOYMwYCYhSkBQRnw07GhuEgWsj7a5FXSyVqYpcsW0pVuU0a90DH/6c6bCLwqYgbgwURYbwGhlS29xNEx/elDY/xHPVIOSxU6by1fHUz1Ky0jbaaPMQVKPxkmvcNdnGnktUT9wHYG01t3iyUsR5NTfCJsWH3oa3gEMbhn3AQw2REIaEhjoj2Vbo744oDPBc/CV9WyG5xDAseAn06LMuD16iu92iDLlQT4ltVdfGFFzluRozYU4gmephSVngRE4tKEoHYWgHgPP0N7c0xTt0HazMtsv 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)(1800799015)(35042699013)(376005); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2024 09:03:16.3163 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: abcab34a-7e6f-447c-319b-08dc7fbe2d82 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: AM1PEPF000252DF.eurprd07.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB6267 X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, KAM_STOCKGEN, 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 The logic to decide if an input relocation for a symbol becomes a particular kind of output relocation is one of the hard to maintain parts of the bfd ld backend, since it is partially repeated across elfNN_aarch64_check_relocs (where dynamic relocations are counted per symbol and input section), elfNN_aarch64_late_size_sections (where relocation sections are sized and GOT offsets assigned), elfNN_aarch64_relocate_section (where most relocations are applied and output to a relocation section), elfNN_aarch64_finish_dynamic_symbol (where some of the GOT relocations are applied and output). The DT_RELR support adds another layer to this complexity: after the output relocation sections are sized, so all dynamic relocations are accounted (in elfNN_aarch64_late_size_sections), we scan the symbols and input relocations again to decide which ones become relative relocations that can be packed. The sizes of the relocation sections are updated accordingly. This logic must be consistent with the code that applies the relocs later so each relative relocation is emitted exactly once: either in .rela.* or packed in .relr.dyn. Sizing of .relr.dyn is done via elfNN_aarch64_size_relative_relocs that may be called repeatedly whenever the layout changes since an address change can affect the size of the packed format. Then the final content is emitted in elfNN_aarch64_finish_relative_relocs, that is called after the layout is final and before relocations are applied and emitted. These hooks are only called if DT_RELR is enabled. We only pack relative relocs that are known to be aligned in the output during .relr.dyn sizing, the potentially unaligned relative relocs are emitted normally (in .rela.*, not packed), because the format requires aligned addresses. --- bfd/elfnn-aarch64.c | 429 +++++++++++++++++++++++++++++++++- bfd/elfxx-aarch64.h | 11 + ld/emulparams/aarch64elf.sh | 2 + ld/emulparams/aarch64fbsd.sh | 2 + ld/emulparams/aarch64linux.sh | 2 + 5 files changed, 445 insertions(+), 1 deletion(-) diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c index 55871dbe763..81f1a646125 100644 --- a/bfd/elfnn-aarch64.c +++ b/bfd/elfnn-aarch64.c @@ -2706,6 +2706,19 @@ struct elf_aarch64_link_hash_table /* Used by local STT_GNU_IFUNC symbols. */ htab_t loc_hash_table; void * loc_hash_memory; + + /* Array of relative relocs to be emitted in DT_RELR format. */ + bfd_size_type relr_alloc; + bfd_size_type relr_count; + struct relr_entry + { + asection *sec; + bfd_vma off; + } *relr; + /* Sorted output addresses of above relative relocs. */ + bfd_vma *relr_sorted; + /* Layout recomputation count. */ + bfd_size_type relr_layout_iter; }; /* Create an entry in an AArch64 ELF linker hash table. */ @@ -5971,6 +5984,18 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto, || !(bfd_link_pie (info) || SYMBOLIC_BIND (info, h)) || !h->def_regular)) outrel.r_info = ELFNN_R_INFO (h->dynindx, r_type); + else if (info->enable_dt_relr + && input_section->alignment_power != 0 + && rel->r_offset % 2 == 0) + { + /* Don't emit a relative relocation that is packed, only + apply the addend. */ + if (globals->no_apply_dynamic_relocs) + return bfd_reloc_ok; + return _bfd_final_link_relocate (howto, input_bfd, input_section, + contents, rel->r_offset, value, + signed_addend); + } else { int symbol; @@ -6237,7 +6262,8 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto, addend, weak_undef_p); } - if (relative_reloc) + /* Emit relative relocations, but not if they are packed (DT_RELR). */ + if (relative_reloc && !info->enable_dt_relr) { asection *s; Elf_Internal_Rela outrel; @@ -9169,6 +9195,363 @@ elfNN_aarch64_allocate_local_ifunc_dynrelocs (void **slot, void *inf) return elfNN_aarch64_allocate_ifunc_dynrelocs (h, inf); } +/* Record a relative relocation that will be emitted packed (DT_RELR). + Called after relocation sections are sized, so undo the size accounting + for this relocation. */ + +static bool +record_relr (struct elf_aarch64_link_hash_table *htab, asection *sec, + bfd_vma off, asection *sreloc) +{ + /* Undo the relocation section size accounting. */ + BFD_ASSERT (sreloc->size >= RELOC_SIZE (htab)); + sreloc->size -= RELOC_SIZE (htab); + /* The packing format uses the last bit of the address so that + must be aligned. We don't pack relocations that may not be + aligned even though the final output address could end up + aligned, to avoid complex sizing logic for a rare case. */ + BFD_ASSERT (off % 2 == 0 && sec->alignment_power > 0); + if (htab->relr_count >= htab->relr_alloc) + { + if (htab->relr_alloc == 0) + htab->relr_alloc = 4096; + else + htab->relr_alloc *= 2; + htab->relr = bfd_realloc (htab->relr, + htab->relr_alloc * sizeof (*htab->relr)); + if (htab->relr == NULL) + return false; + } + htab->relr[htab->relr_count].sec = sec; + htab->relr[htab->relr_count].off = off; + htab->relr_count++; + return true; +} + +/* Follow elfNN_aarch64_allocate_dynrelocs, but only record relative + relocations against the GOT and undo their previous size accounting. */ + +static bool +record_relr_dyn_got_relocs (struct elf_link_hash_entry *h, void *inf) +{ + + if (h->root.type == bfd_link_hash_indirect) + return true; + if (h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + if (h->type == STT_GNU_IFUNC && h->def_regular) + return true; + if (h->got.refcount <= 0) + return true; + if (elf_aarch64_hash_entry (h)->got_type != GOT_NORMAL) + return true; + + struct bfd_link_info *info = (struct bfd_link_info *) inf; + struct elf_aarch64_link_hash_table *htab = elf_aarch64_hash_table (info); + + if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak) + && bfd_link_pic (info) + /* Undefined weak symbol in static PIE resolves to 0 without + any dynamic relocations. */ + && !UNDEFWEAK_NO_DYNAMIC_RELOC (info, h)) + { + bool relative_reloc = SYMBOL_REFERENCES_LOCAL (info, h) + && !bfd_is_abs_symbol (&h->root); + if (relative_reloc) + if (!record_relr (htab, htab->root.sgot, h->got.offset, + htab->root.srelgot)) + return false; + } + return true; +} + +/* Record packed relative relocs against the GOT for local symbols. + Undo the size accounting of elfNN_aarch64_late_size_sections. */ + +static bool +record_relr_local_got_relocs (bfd *input_bfd, struct bfd_link_info *info) +{ + struct elf_aarch64_local_symbol *locals; + Elf_Internal_Shdr *symtab_hdr; + struct elf_aarch64_link_hash_table *htab; + + if (!bfd_link_pic (info)) + return true; + + locals = elf_aarch64_locals (input_bfd); + if (locals == NULL) + return true; + + symtab_hdr = &elf_symtab_hdr (input_bfd); + htab = elf_aarch64_hash_table (info); + for (unsigned int i = 0; i < symtab_hdr->sh_info; i++) + { + bfd_vma off = locals[i].got_offset; + if (locals[i].got_refcount <= 0) + continue; + if ((locals[i].got_type & GOT_NORMAL) == 0) + continue; + + /* FIXME: If the local symbol is in SHN_ABS then emitting + a relative relocation is not correct, but it seems to + be wrong in elfNN_aarch64_final_link_relocate too. */ + if (!record_relr (htab, htab->root.sgot, off, htab->root.srelgot)) + return false; + } + return true; +} + +/* Follows the logic of elfNN_aarch64_relocate_section to decide which + relocations will become relative and possible to pack. Ignore + relocations against the GOT, those are handled separately per-symbol. + Undo the size accounting of the packed relocations and record them + so the relr section can be sized later. */ + +static bool +record_relr_non_got_relocs (bfd *input_bfd, struct bfd_link_info *info, + asection *sec) +{ + const Elf_Internal_Rela *relocs; + const Elf_Internal_Rela *rel; + const Elf_Internal_Rela *rel_end; + asection *sreloc; + struct elf_aarch64_link_hash_table *htab; + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes; + + if (sec->reloc_count == 0) + return true; + if ((sec->flags & (SEC_RELOC | SEC_ALLOC | SEC_DEBUGGING)) + != (SEC_RELOC | SEC_ALLOC)) + return true; + if (sec->alignment_power == 0) + return true; + sreloc = elf_section_data (sec)->sreloc; + if (sreloc == NULL) + return true; + htab = elf_aarch64_hash_table (info); + symtab_hdr = &elf_symtab_hdr (input_bfd); + sym_hashes = elf_sym_hashes (input_bfd); + relocs = _bfd_elf_link_info_read_relocs (input_bfd, info, sec, NULL, NULL, + info->keep_memory); + BFD_ASSERT (relocs != NULL); + rel_end = relocs + sec->reloc_count; + for (rel = relocs; rel < rel_end; rel++) + { + unsigned int r_symndx = ELFNN_R_SYM (rel->r_info); + unsigned int r_type = ELFNN_R_TYPE (rel->r_info); + + bfd_reloc_code_real_type bfd_r_type + = elfNN_aarch64_bfd_reloc_from_type (input_bfd, r_type); + /* Handle relocs that can become R_AARCH64_RELATIVE, + but not ones against the GOT as those are handled + separately per-symbol. */ + if (bfd_r_type != BFD_RELOC_AARCH64_NN) + continue; + /* Can only pack relocation against an aligned address. */ + if (rel->r_offset % 2 != 0) + continue; + + struct elf_link_hash_entry *h = NULL; + asection *def_sec = NULL; + bool resolved_to_zero = false; + if (r_symndx < symtab_hdr->sh_info) + { + /* A local symbol. */ + Elf_Internal_Sym *isym; + isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, + input_bfd, r_symndx); + BFD_ASSERT (isym != NULL); + if (ELF_ST_TYPE (isym->st_info) == STT_GNU_IFUNC) + continue; + def_sec = bfd_section_from_elf_index (input_bfd, isym->st_shndx); + } + else + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + /* Filter out symbols that cannot have a relative reloc. */ + if (h->dyn_relocs == NULL) + continue; + if (bfd_is_abs_symbol (&h->root)) + continue; + if (h->type == STT_GNU_IFUNC) + continue; + + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + def_sec = h->root.u.def.section; + resolved_to_zero = UNDEFWEAK_NO_DYNAMIC_RELOC (info, h); + } + if (def_sec != NULL && discarded_section (def_sec)) + continue; + /* Same logic as in elfNN_aarch64_final_link_relocate. + Except conditionals trimmed that cannot result a reltive reloc. */ + if (bfd_link_pic (info) + && (h == NULL + || (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + && !resolved_to_zero) + || h->root.type != bfd_link_hash_undefweak)) + { + if (h != NULL + && h->dynindx != -1 + && (!(bfd_link_pie (info) || SYMBOLIC_BIND (info, h)) + || !h->def_regular)) + continue; + if (!record_relr (htab, sec, rel->r_offset, sreloc)) + return false; + } + } + return true; +} + +static int +cmp_relr_addr (const void *p, const void *q) +{ + const bfd_vma *a = p; + const bfd_vma *b = q; + return *a < *b ? -1 : *a > *b ? 1 : 0; +} + +/* Produce a malloc'd sorted array of reloc addresses in htab->relr_sorted. + Returns false on allocation failure. */ + +static bool +sort_relr (struct bfd_link_info *info, + struct elf_aarch64_link_hash_table *htab) +{ + if (htab->relr_count == 0) + return true; + + bfd_vma *addr = htab->relr_sorted; + if (addr == NULL) + { + addr = bfd_malloc (htab->relr_count * sizeof (*addr)); + if (addr == NULL) + return false; + htab->relr_sorted = addr; + } + + for (bfd_size_type i = 0; i < htab->relr_count; i++) + { + bfd_vma off = _bfd_elf_section_offset (info->output_bfd, info, + htab->relr[i].sec, + htab->relr[i].off); + addr[i] = htab->relr[i].sec->output_section->vma + + htab->relr[i].sec->output_offset + + off; + } + qsort (addr, htab->relr_count, sizeof (*addr), cmp_relr_addr); + return true; +} + +/* Size .relr.dyn whenever the layout changes, the number of packed + relocs are unchanged but the packed representation can. */ + +bool +elfNN_aarch64_size_relative_relocs (struct bfd_link_info *info, + bool *need_layout) +{ + struct elf_aarch64_link_hash_table *htab = elf_aarch64_hash_table (info); + asection *srelrdyn = htab->root.srelrdyn; + *need_layout = false; + + if (!sort_relr (info, htab)) + return false; + bfd_vma *addr = htab->relr_sorted; + + BFD_ASSERT (srelrdyn != NULL); + bfd_size_type oldsize = srelrdyn->size; + srelrdyn->size = 0; + for (bfd_size_type i = 0; i < htab->relr_count; ) + { + bfd_vma base = addr[i]; + i++; + srelrdyn->size += 8; + base += 8; + for (;;) + { + bfd_size_type start_i = i; + while (i < htab->relr_count + && addr[i] - base < 63 * 8 + && (addr[i] - base) % 8 == 0) + i++; + if (i == start_i) + break; + srelrdyn->size += 8; + base += 63 * 8; + } + } + if (srelrdyn->size != oldsize) + { + *need_layout = true; + /* Stop after a few iterations in case the layout does not converge, + we can do this when the size would shrink. */ + if (htab->relr_layout_iter++ > 5 && srelrdyn->size < oldsize) + { + srelrdyn->size = oldsize; + *need_layout = false; + } + } + return true; +} + +/* Emit the .relr.dyn section after it is sized and the layout is fixed. */ + +bool +elfNN_aarch64_finish_relative_relocs (struct bfd_link_info *info) +{ + struct elf_aarch64_link_hash_table *htab = elf_aarch64_hash_table (info); + asection *srelrdyn = htab->root.srelrdyn; + bfd *dynobj = htab->root.dynobj; + + if (srelrdyn == NULL || srelrdyn->size == 0) + return true; + srelrdyn->contents = bfd_alloc (dynobj, srelrdyn->size); + if (srelrdyn->contents == NULL) + return false; + bfd_vma *addr = htab->relr_sorted; + bfd_byte *loc = srelrdyn->contents; + for (bfd_size_type i = 0; i < htab->relr_count; ) + { + bfd_vma base = addr[i]; + i++; + bfd_put_64 (dynobj, base, loc); + loc += 8; + base += 8; + for (;;) + { + bfd_vma bits = 0; + while (i < htab->relr_count) + { + bfd_vma delta = addr[i] - base; + if (delta >= 63 * 8 || delta % 8 != 0) + break; + bits |= (bfd_vma) 1 << (delta / 8); + i++; + } + if (bits == 0) + break; + bfd_put_64 (dynobj, (bits << 1) | 1, loc); + loc += 8; + base += 63 * 8; + } + } + free (addr); + htab->relr_sorted = NULL; + /* Pad any excess with 1's, a do-nothing encoding. */ + while (loc < srelrdyn->contents + srelrdyn->size) + { + bfd_put_64 (dynobj, 1, loc); + loc += 8; + } + return true; +} + /* This is the most important function of all . Innocuosly named though ! */ @@ -9344,6 +9727,27 @@ elfNN_aarch64_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, } } + /* Record the relative relocations that will be packed and undo the + size allocation for them in .rela.*. The size of .relr.dyn will be + computed later iteratively since it depends on the final layout. */ + if (info->enable_dt_relr && !bfd_link_relocatable (info)) + { + elf_link_hash_traverse (&htab->root, record_relr_dyn_got_relocs, info); + + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) + { + if (!is_aarch64_elf (ibfd)) + continue; + + for (s = ibfd->sections; s != NULL; s = s->next) + if (!record_relr_non_got_relocs (ibfd, info, s)) + return false; + + if (!record_relr_local_got_relocs (ibfd, info)) + return false; + } + } + /* Init mapping symbols information to use later to distingush between code and data while scanning for errata. */ if (htab->fix_erratum_835769 || htab->fix_erratum_843419) @@ -9383,6 +9787,19 @@ elfNN_aarch64_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, if (s != htab->root.srelplt) s->reloc_count = 0; } + else if (s == htab->root.srelrdyn) + { + /* Remove .relr.dyn based on relr_count, not size, since + it is not sized yet. */ + if (htab->relr_count == 0) + s->flags |= SEC_EXCLUDE; + else + /* Force dynamic tags for relocs even if there are no + .rela* relocs, required for setting DT_TEXTREL. */ + relocs = true; + /* Allocate contents later. */ + continue; + } else { /* It's not one of our sections, so don't allocate space. */ @@ -9741,6 +10158,9 @@ elfNN_aarch64_finish_dynamic_symbol (bfd *output_bfd, if (!(h->def_regular || ELF_COMMON_DEF_P (h))) return false; BFD_ASSERT ((h->got.offset & 1) != 0); + /* Don't emit relative relocs if they are packed. */ + if (info->enable_dt_relr) + goto skip_got_reloc; rela.r_info = ELFNN_R_INFO (0, AARCH64_R (RELATIVE)); rela.r_addend = (h->root.u.def.value + h->root.u.def.section->output_section->vma @@ -9760,6 +10180,7 @@ elfNN_aarch64_finish_dynamic_symbol (bfd *output_bfd, loc += htab->root.srelgot->reloc_count++ * RELOC_SIZE (htab); bfd_elfNN_swap_reloca_out (output_bfd, &rela, loc); } +skip_got_reloc: if (h->needs_copy) { @@ -10395,6 +10816,12 @@ const struct elf_size_info elfNN_aarch64_size_info = #define elf_backend_merge_gnu_properties \ elfNN_aarch64_merge_gnu_properties +#define elf_backend_size_relative_relocs \ + elfNN_aarch64_size_relative_relocs + +#define elf_backend_finish_relative_relocs \ + elfNN_aarch64_finish_relative_relocs + #define elf_backend_can_refcount 1 #define elf_backend_can_gc_sections 1 #define elf_backend_plt_readonly 1 diff --git a/bfd/elfxx-aarch64.h b/bfd/elfxx-aarch64.h index 6c084f75796..f21e5ee5efc 100644 --- a/bfd/elfxx-aarch64.h +++ b/bfd/elfxx-aarch64.h @@ -96,6 +96,17 @@ extern bool elf32_aarch64_size_stubs extern bool elf32_aarch64_build_stubs (struct bfd_link_info *); +/* AArch64 relative relocation packing support for ELF64. */ +extern bool elf64_aarch64_size_relative_relocs + (struct bfd_link_info *, bool *); +extern bool elf64_aarch64_finish_relative_relocs + (struct bfd_link_info *); +/* AArch64 relative relocation packing support for ELF32. */ +extern bool elf32_aarch64_size_relative_relocs + (struct bfd_link_info *, bool *); +extern bool elf32_aarch64_finish_relative_relocs + (struct bfd_link_info *); + /* Take the PAGE component of an address or offset. */ #define PG(x) ((x) & ~ (bfd_vma) 0xfff) #define PG_OFFSET(x) ((x) & (bfd_vma) 0xfff) diff --git a/ld/emulparams/aarch64elf.sh b/ld/emulparams/aarch64elf.sh index 8f68e517b45..72616b57691 100644 --- a/ld/emulparams/aarch64elf.sh +++ b/ld/emulparams/aarch64elf.sh @@ -1,3 +1,5 @@ +source_sh ${srcdir}/emulparams/dt-relr.sh + ARCH=aarch64 MACHINE= NOP=0x1f2003d5 diff --git a/ld/emulparams/aarch64fbsd.sh b/ld/emulparams/aarch64fbsd.sh index 0bcab7a4baa..db68d436544 100644 --- a/ld/emulparams/aarch64fbsd.sh +++ b/ld/emulparams/aarch64fbsd.sh @@ -1,3 +1,5 @@ +source_sh ${srcdir}/emulparams/dt-relr.sh + ARCH=aarch64 MACHINE= NOP=0x1f2003d5 diff --git a/ld/emulparams/aarch64linux.sh b/ld/emulparams/aarch64linux.sh index 7b4a0e86073..6fe82a70659 100644 --- a/ld/emulparams/aarch64linux.sh +++ b/ld/emulparams/aarch64linux.sh @@ -1,3 +1,5 @@ +source_sh ${srcdir}/emulparams/dt-relr.sh + ARCH=aarch64 MACHINE= NOP=0x1f2003d5 From patchwork Wed May 29 09:03:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 91084 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 4CD203858C50 for ; Wed, 29 May 2024 09:06:47 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on20600.outbound.protection.outlook.com [IPv6:2a01:111:f403:2611::600]) by sourceware.org (Postfix) with ESMTPS id 03C21385B50C for ; Wed, 29 May 2024 09:03:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 03C21385B50C 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 03C21385B50C Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2611::600 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1716973416; cv=pass; b=CfFQFyzugEMMP/lce0dH7rkoSqBdtOHrZv9xyIc7ZInJyM6eK/EIN9uBaZfYm2GNK5mbdfeasY2TJBJvJJ9hkQip2ZONhxAgKfp/fd1BH+ZC49KtxDfIkkjOpPX04BYn9bYclSc7PkJ+xqIYCQOSjuJJQ7e0BJ5iWtYM/Cnyy+w= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1716973416; c=relaxed/simple; bh=5gdjp/kq/VV09RH8kWSp6HHVThrqdhQoDInpos7tuVA=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=qfwIlO9UGHF6JrnS8xucnRJpadee+9tM+AzigpXVy5tSbOVpAx1SdSkRc0PDJAmsvRI9MBxa61Ur+HuYd7WuDGgyLa1eURC3Vg9u2Uo8n4iDIouKlqgQQrmjC4G9L/o0vc7aMhlSIaccdkLj+D6COBXBFLWrWZEm/hl2aMW4Zao= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=OmhMg7kQbP5Usq6dxrgjfct/OePVJbnI7ng2IBKgBhCpIl1zaqIzzVuP3i0XDbBc2AEAsFNweG4ai2p7cdwV4VsguGNfhJ1EzKWZftC35/tCfVsItncP1Jx4Pqxb7bTt/ibEDtDMlw/gpomX6+JBRus5qRBuepAl8GS9HwePrh8J6pKUrHgk4vBEenmTkoNALgCA6Z6NQWg1W5vcA/1pAr1LrSlN7pEwzv1IkIRk2CfKeEdtLKh4nxwDcxsEpAcyektnzn7PHtTJvTZphlQZ/AqRZwrV4l+SRhqif9vf+Z7WzK0QnmjAfuMXqmL/hPCbMSnZmtcO+q4sEr3VyJF3gg== 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=2JTuEEKaLVVLrK9yLGkMY5+MU3J30k3sTvff7WkBMB4=; b=EO6pTsD2W0GlL6Gjt0/LS6qlZFI7affHlYydVX60jyUNFCQpWSIJ9MDbJtyhN9Ene68GS68Gyp2Q2Kpfj2AvxaEpBjFidhdIS+I47H3Lbfwu0HQSOeNh4sY86hwciEHoIROGmZLha4fpZr4Fbz3RrQ7VA6cy81Cr1Ohs2xevmf07CT7eki35m6UIh/xbI+G5lllXN9fIS1mYaRIB0KY3J9guCD787jx9vZjNXjJDMQM7tIevWWWmavx7fefY1XmkNH2JOyTO+d9IW7GPJLsCAw81ykTf5f0KMY9bZT1LoxTUNL2wM+JO8AIoL5wR2E8Rvhnsub+T5XYWEx/xAtq2aQ== 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=2JTuEEKaLVVLrK9yLGkMY5+MU3J30k3sTvff7WkBMB4=; b=m5q1uz4pIExBVhz6GjarPM2UeUVO21q9+hMWL08uUn6cJi+NgGVcd8svYGaKDm4mXmojzlU7uvlJSuBVqFhQj6gHiMGIYoRHt093JTXKBcQPgZaIxfLj5v+rWpqiTfkwmRhv1QrasePS1T5Q8pEvRmACA5XbQYRS1GSx1/4ywSI= Received: from AM0PR04CA0056.eurprd04.prod.outlook.com (2603:10a6:208:1::33) by DB3PR08MB8892.eurprd08.prod.outlook.com (2603:10a6:10:43d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.31; Wed, 29 May 2024 09:03:27 +0000 Received: from AMS0EPF0000019A.eurprd05.prod.outlook.com (2603:10a6:208:1:cafe::56) by AM0PR04CA0056.outlook.office365.com (2603:10a6:208:1::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30 via Frontend Transport; Wed, 29 May 2024 09:03:27 +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 AMS0EPF0000019A.mail.protection.outlook.com (10.167.16.246) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Wed, 29 May 2024 09:03:27 +0000 Received: ("Tessian outbound f97ed8ca492d:v327"); Wed, 29 May 2024 09:03:27 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: c2b9fdd6e468581e X-CR-MTA-TID: 64aa7808 Received: from 6f7b74644618.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 868E4748-2B39-4789-B828-22EBFECD8DA2.1; Wed, 29 May 2024 09:03:20 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 6f7b74644618.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 29 May 2024 09:03:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Sbz9Q/9hm98gxLoQ86hGxUySjhzQj7MgKckhDJbjqTw6a1Lo9CAfUAVAubFtcF8CnajxhelusMymr3qwB9gdWpiVgOmLulW4bzK0Q8D2h5p0UyVneqxJcVMPeJFPEiUNvJhyVNKEqKaI+8RSZsVlMMo3yxh7Gj8liQ5CAT09/wizLvxR/wdqXyWc8/742pNLxfbjUyu5GySON74CugFjXgA80J5c0CIz3oeataZnfjJNtDfNk6PedTk2VwFXSCXn/2dSwLxsdM+w+HR6h87EBLEBRfu72CorSbOjqj2E+UX8St4eKWRX6PAQX+LsBvXPJ9VXkl25yq0qq5sjdPAAfw== 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=2JTuEEKaLVVLrK9yLGkMY5+MU3J30k3sTvff7WkBMB4=; b=KagWOtLSAl+W0komV7uxfLpLNnjLAXU4j8w/RhHWW1BdwBFDZRlSsvosSoLiBAxTMwuXyQ/XWkTYs5xDoiinbi4tLuuSPffzGmzPzSEJtFBNhL7zN8Vymovoq/7oVoCBq5FmhgF8GRtuP4/kJxQmx2FcwsIBECtz0d+t7sxiUnK3bxBEY6/5keogPi+M25QNciIIHaTICgYD8X6ld04QvZ+dETdTWD/Lo38KUsLnEzPTIfvKFcaQLd29nbgihZF1xMgI9EvbJ9UOTmlRp7xOOEYKj3QbtuLXokhxyoQYpyZPnILqEzx7jsF6CGiHllxYvpPvJljVbtITgG41WVbLCA== 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=2JTuEEKaLVVLrK9yLGkMY5+MU3J30k3sTvff7WkBMB4=; b=m5q1uz4pIExBVhz6GjarPM2UeUVO21q9+hMWL08uUn6cJi+NgGVcd8svYGaKDm4mXmojzlU7uvlJSuBVqFhQj6gHiMGIYoRHt093JTXKBcQPgZaIxfLj5v+rWpqiTfkwmRhv1QrasePS1T5Q8pEvRmACA5XbQYRS1GSx1/4ywSI= Received: from AS4P250CA0024.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:5e3::17) by DBAPR08MB5574.eurprd08.prod.outlook.com (2603:10a6:10:1ab::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.19; Wed, 29 May 2024 09:03:18 +0000 Received: from AMS0EPF00000190.eurprd05.prod.outlook.com (2603:10a6:20b:5e3:cafe::15) by AS4P250CA0024.outlook.office365.com (2603:10a6:20b:5e3::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.19 via Frontend Transport; Wed, 29 May 2024 09:03:18 +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 AMS0EPF00000190.mail.protection.outlook.com (10.167.16.213) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7633.15 via Frontend Transport; Wed, 29 May 2024 09:03:18 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 29 May 2024 09:03:13 +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; Wed, 29 May 2024 09:03:12 +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; Wed, 29 May 2024 09:03:12 +0000 From: Szabolcs Nagy To: Subject: [PATCH 2/2] aarch64: Add some DT_RELR ld tests Date: Wed, 29 May 2024 10:03:12 +0100 Message-ID: <054bee743aec947fbc466ac3fa3a5e0678a06057.1716972656.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: AMS0EPF00000190:EE_|DBAPR08MB5574:EE_|AMS0EPF0000019A:EE_|DB3PR08MB8892:EE_ X-MS-Office365-Filtering-Correlation-Id: 221c13c3-67e1-45f3-72e5-08dc7fbe3413 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230031|82310400017|1800799015|36860700004|376005; X-Microsoft-Antispam-Message-Info-Original: qRSJuA11C4wEWo4okZLDZuAoxC6toUSn317EdXxlKpSxagJ14Rxq+7dbIBmfv9rWLr8N30sfUX39iyILagOmwznsCILjX5DCvJm+nYuyNsXwC1lSWFHJxk8lE2r9ktud6x+0snuxQvZBLwRK0vU7X4xW2uq8ROKIT7p+9ZXnlHMW1bVFF8UWFJ88r19w5t/AmyiGgSOb+4nIRIP3ZOPp1kOeIibY4WeCsX0VFPPX6f2+xSWAdVjyweXipkmi8HQ9a4agSfCfGTvWzSWbMU3S9QwbX6TE/TzDd+Im2ng28vvON+ONf64ovYO5HPL9HpP6tAyf78c8ecpkFMEvxO/197cywiI+clpDaQ52sUXxtzFgs3S/6CRgrHUl8FVSZSvv95CM3zr6zJ1l/9KdU7y8T9j7uLD8I4FKwQXxi/JnB87T94jJjIXZ2aTqPZ41aHNSObSjQnopU3K9RTQcrIdUKfimOfzYZlz4GngxTJxxQOljSfKiFbw31zltIyrzldZFwCZS24+NehXaprP8UXvC46XJsgkHfwSlOJHl3YqkMOMU79OGEjq325mbgBrNXc0yw5WPduQayS2SAkGd4JZKkQAyWzRmdVRiwPOIus29zrWNn7yxqkCnGsRWn14smTpZqSqKzyoK3RLkrCfuAmoAC92IyJdtOCCH5CWaFVLu1OHSqT/muDNtstsKyXCOLqqyKzdWzR0z/eLoZIqNVbs/SXoD/nvVtUxBCGbctRVT3uivRC4GqkC9vkvV2zwpYCZD/DvaQrBlW9NXXlMkH6S2BKODbGR5zhLhmU6mbHyTYf5fLVbenRk6GIpdIsShh1LDDR9Tazdla7X4ygEIsabQm781XzDGR4f45ru3PdRkXHaZjqH/XZFLOhjePOqJrR13P7QDSbOkyEWh/CPfwXjIHR6FrjVtjExwFe4EgBdCmFBAC3PVbIOj+JsOXwY8w6pMx/96DUJ4/Or38LceaSRnI6f07EhUKM2JgBdDGlqSzGsyt+Y0xa2uuLUaGdChNz54NbX7nVGnlmQfob6kBwJ3oE3FQrVF7EByTLkevg+X2QNIw5CHzHB9RJlTEkDsPeLKhF7NdMs4l2FShsYpU3TaxL99sh+58kQiRrgSYZvyaGaYJ1MC3aa8Dwo0Y1S36SMJd1/FYE5cRzLqmhCDUyLTmVI/iaZNbzLS0dCMrB6m+tVjIRlL4IuKLF3zZI07H0o0QDNLBn+Cwo2WViygp7bWqdXzvLbNe6EX4G7RGnuOn5Vf8KRvEKdzXGUfh8GV+OvSX1Dqozo26AFSfMHVsxsep0SB+c9co+9KG26vk+bxqGqXTLfOBWOB6QynMx84chB8ElJBjcIQ4Mv28ZRbHP+rdyhsX0GIoA8bb/KB6PkleBI= 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)(82310400017)(1800799015)(36860700004)(376005); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5574 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AMS0EPF0000019A.eurprd05.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: b96a20eb-1fea-48f0-aa89-08dc7fbe2ef7 X-Microsoft-Antispam: BCL:0; ARA:13230031|36860700004|376005|35042699013|82310400017|1800799015; X-Microsoft-Antispam-Message-Info: JMGJRvN1qY10U+VyWVIH7v4lQGoyvUf9AOe5d2EAms6XrLlrLMH58uhSMjVoFhtlvZM6Y/g9OeunzXms2Z7o2rHt0JqKs3zM8A3t9XoAfSSbqv6Jos+qlQe7TnshXcBOtBAY4sH9I79A7LSQaX3WI9pGXsA1Fl/Kc+7vhlRdRnKiEH+snHW9Dz2gYVeTWSYJlv5j6OUL7XczTMuYuVGs2Ce4Ow+eTwdGKGu0jMzVoxU6KghNsqhilCxndhsFRlyd/eRCgSFXweOpFeDyiVkafCYxqP81SI/QV2lLBebNfcPE6WZTPNI8I4pBb8UL9l0vZSRpCUg8Vu+grGDve+04pOMtVJcZhXukgrTXrwPXcL3TRJZfBWz1Xq+wajPmP9Fw4GM3jnL/tEZBVmnoVxj1IgLJd9lWeQtpFgzDcHPM7j9Z0JfjjIDInHmEjaHlish2QS7tZ1X/CYLgK3e/1ZCT2rgP0oE5VUeZtZDgdRsxLKs+LHh+Zlio1NaJz4qb7Xc2z/wZjBf6b2Rq2DtgzXFfVxE0/lP1IxbO4oRy4ryDA8ZqrBIMTTl8+3Hj9pQV3wF1os9K/Ij2V2CrSp5V46Gh5a7GkbCUtN2sLDEr7OJZNhihaz9y8dsVoxIZPTl98KnI0Imv6YpSjqPhXAeICX8tNVg9KkEtXKuVRWLWKrMyu+8eIg1gQ3aT3C5M9rAdomvDPLsgitQ3Kg5I6SPN9e4WL4oIsIS/kWz5Epqh8jNYGA2ys1cawr92t5DEi2CzHOE0FEdYAUp5EBIDqpX38gF4hmvHfPyBEtSxmcadTPt4t/0r7ihmBZCfxO4VjmQoEBpbcdHPhGbx/mn9IF8ACFnNplyMc8y3yP/9NtNKZ6XCaYmkM+S2ps09yd4JjZzalRD174tPbJp03U6wQ+IHaOTyK8gPX0I2FN6GVBzpqVh8DzCxfaYz1IjthzTgFt3ifqixfoB6jnjp8YjQ882VSlJoNqo56DsgBSQhaECnK3F875YqAmGRLtGfupFeCxgLgFvwzJ8w73W609kaXiMfKI5JgBeJWnlGR2LbCkvITvigKtX3hAWBVKits0tcEBTH6A3DqwybFLVA7o9OxqwbE0TjhDPws/bJw1eOCESBLlNx9LTNcRLfOzNoJ6F8XkZg7oD7mEt0rtPsEB5sC2C6R1jGNcwE9fy0DOjQn2cM9UY8DUXIyt8aSQgckKXZ8g85tgHHuIrQo/zSNqkkEP0Pw+W3oby7xyTC8BMwFT0HsbMIaav2i/pObC2hRnbB0HMtoKcnX/jn8BHqXnReVflBOZGH1Y1MtrJsMTMDtfTnoDyL9S5B/ofNuJZ0YzNQzBH5wVk9EWMvCgHO3lbOOrAOjLIVtYZhNR1o7fMRrbt94r9MLGo= 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)(376005)(35042699013)(82310400017)(1800799015); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2024 09:03:27.3190 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 221c13c3-67e1-45f3-72e5-08dc7fbe3413 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: AMS0EPF0000019A.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR08MB8892 X-Spam-Status: No, score=-11.0 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 | 6 ++ ld/testsuite/ld-aarch64/relr-align.d | 22 +++++ ld/testsuite/ld-aarch64/relr-align.s | 106 +++++++++++++++++++++ ld/testsuite/ld-aarch64/relr-data-pie.d | 18 ++++ ld/testsuite/ld-aarch64/relr-data-shared.d | 18 ++++ ld/testsuite/ld-aarch64/relr-data.s | 71 ++++++++++++++ ld/testsuite/ld-aarch64/relr-got-pie.d | 15 +++ ld/testsuite/ld-aarch64/relr-got-shared.d | 15 +++ ld/testsuite/ld-aarch64/relr-got.s | 40 ++++++++ 9 files changed, 311 insertions(+) create mode 100644 ld/testsuite/ld-aarch64/relr-align.d create mode 100644 ld/testsuite/ld-aarch64/relr-align.s create mode 100644 ld/testsuite/ld-aarch64/relr-data-pie.d create mode 100644 ld/testsuite/ld-aarch64/relr-data-shared.d create mode 100644 ld/testsuite/ld-aarch64/relr-data.s create mode 100644 ld/testsuite/ld-aarch64/relr-got-pie.d create mode 100644 ld/testsuite/ld-aarch64/relr-got-shared.d create mode 100644 ld/testsuite/ld-aarch64/relr-got.s diff --git a/ld/testsuite/ld-aarch64/aarch64-elf.exp b/ld/testsuite/ld-aarch64/aarch64-elf.exp index 9ce61579e6c..a66c2e63237 100644 --- a/ld/testsuite/ld-aarch64/aarch64-elf.exp +++ b/ld/testsuite/ld-aarch64/aarch64-elf.exp @@ -468,6 +468,12 @@ run_dump_test_lp64 "bti-far-2" run_dump_test_lp64 "bti-far-opt" run_dump_test_lp64 "bti-far-3" +run_dump_test_lp64 "relr-align" +run_dump_test_lp64 "relr-data-pie" +run_dump_test_lp64 "relr-data-shared" +run_dump_test_lp64 "relr-got-pie" +run_dump_test_lp64 "relr-got-shared" + if { ![skip_sframe_tests] } { run_dump_test "sframe-simple-1" } diff --git a/ld/testsuite/ld-aarch64/relr-align.d b/ld/testsuite/ld-aarch64/relr-align.d new file mode 100644 index 00000000000..ac2fa6eff08 --- /dev/null +++ b/ld/testsuite/ld-aarch64/relr-align.d @@ -0,0 +1,22 @@ +#source: relr-align.s +#ld: -shared -z pack-relative-relocs -T relocs.ld +#readelf: -rW + +Relocation section '\.rela\.dyn' at offset 0x10090 contains 3 entries: + Offset Info Type Symbol's Value Symbol's Name \+ Addend +0000000012340011 0000000000000403 R_AARCH64_RELATIVE 10000 +0000000012340019 0000000000000403 R_AARCH64_RELATIVE 10000 +0000000012340041 0000000000000403 R_AARCH64_RELATIVE 10000 + +Relocation section '\.relr\.dyn' at offset 0x100d8 contains 9 entries which relocate 10 locations: +Index: Entry Address Symbolic Address +0000: 0000000012340000 0000000012340000 double_0 +0001: 0000000000000003 0000000012340008 double_0 \+ 0x8 +0002: 0000000012340022 0000000012340022 double_2 +0003: 0000000000000003 000000001234002a double_2 \+ 0x8 +0004: 0000000012340038 0000000012340038 single_0 +0005: 000000001234004a 000000001234004a single_2 +0006: 0000000012340058 0000000012340058 big +0007: 8000000100000001 0000000012340158 big \+ 0x100 + 0000000012340250 big \+ 0x1f8 +0008: 0000000000000003 0000000012340258 big \+ 0x200 diff --git a/ld/testsuite/ld-aarch64/relr-align.s b/ld/testsuite/ld-aarch64/relr-align.s new file mode 100644 index 00000000000..94223cd3512 --- /dev/null +++ b/ld/testsuite/ld-aarch64/relr-align.s @@ -0,0 +1,106 @@ +// Test DT_RELR with differently aligned relative relocs. + +.text +.global _start +_start: +foo: + +.data +.p2align 3 +double_0: +.xword foo +.xword foo +.byte 0 +double_1: +.xword foo +.xword foo +.byte 0 +double_2: +.xword foo +.xword foo +.byte 0 +.byte 0 +.byte 0 +.byte 0 +.byte 0 +.byte 0 +single_0: +.xword foo +.byte 0 +single_1: +.xword foo +.byte 0 +single_2: +.xword foo +.byte 0 +.byte 0 +.byte 0 +.byte 0 +.byte 0 +.byte 0 +big: +.xword foo +.xword 1 +.xword 2 +.xword 3 +.xword 4 +.xword 5 +.xword 6 +.xword 7 +.xword 8 +.xword 9 +.xword 10 +.xword 11 +.xword 12 +.xword 13 +.xword 14 +.xword 15 +.xword 16 +.xword 17 +.xword 18 +.xword 19 +.xword 20 +.xword 21 +.xword 22 +.xword 23 +.xword 24 +.xword 25 +.xword 26 +.xword 27 +.xword 28 +.xword 29 +.xword 30 +.xword 31 +.xword foo + 32 +.xword 33 +.xword 34 +.xword 35 +.xword 36 +.xword 37 +.xword 38 +.xword 39 +.xword 40 +.xword 41 +.xword 42 +.xword 43 +.xword 44 +.xword 45 +.xword 46 +.xword 47 +.xword 48 +.xword 49 +.xword 50 +.xword 51 +.xword 52 +.xword 53 +.xword 54 +.xword 55 +.xword 56 +.xword 57 +.xword 58 +.xword 59 +.xword 60 +.xword 61 +.xword 62 +.xword foo + 63 +.xword foo + 64 diff --git a/ld/testsuite/ld-aarch64/relr-data-pie.d b/ld/testsuite/ld-aarch64/relr-data-pie.d new file mode 100644 index 00000000000..b96e9b61ca4 --- /dev/null +++ b/ld/testsuite/ld-aarch64/relr-data-pie.d @@ -0,0 +1,18 @@ +#source: relr-data.s +#ld: -pie -z pack-relative-relocs -T relocs.ld +#readelf: -rW + +Relocation section '\.rela\.dyn' at offset 0x100e0 contains 5 entries: + Offset Info Type Symbol's Value Symbol's Name \+ Addend +0000000012340000 0000000000000403 R_AARCH64_RELATIVE 10004 +0000000012340008 0000000000000403 R_AARCH64_RELATIVE 10008 +0000000012340010 0000000000000403 R_AARCH64_RELATIVE 1000c +0000000012340018 0000000000000403 R_AARCH64_RELATIVE 12340050 +0000000012340040 0000000300000101 R_AARCH64_ABS64 0000000000000000 sym_weak_undef \+ 0 + +Relocation section '\.relr\.dyn' at offset 0x10158 contains 2 entries which relocate 4 locations: +Index: Entry Address Symbolic Address +0000: 0000000012340020 0000000012340020 aligned_local +0001: 0000000000000027 0000000012340028 aligned_hidden + 0000000012340030 aligned_global + 0000000012340048 aligned_DYNAMIC diff --git a/ld/testsuite/ld-aarch64/relr-data-shared.d b/ld/testsuite/ld-aarch64/relr-data-shared.d new file mode 100644 index 00000000000..d94b335fac2 --- /dev/null +++ b/ld/testsuite/ld-aarch64/relr-data-shared.d @@ -0,0 +1,18 @@ +#source: relr-data.s +#ld: -shared -z pack-relative-relocs -T relocs.ld +#readelf: -rW + +Relocation section '\.rela\.dyn' at offset 0x10150 contains 6 entries: + Offset Info Type Symbol's Value Symbol's Name \+ Addend +0000000012340000 0000000000000403 R_AARCH64_RELATIVE 10004 +0000000012340008 0000000000000403 R_AARCH64_RELATIVE 10008 +0000000012340018 0000000000000403 R_AARCH64_RELATIVE 12340050 +0000000012340010 0000000400000101 R_AARCH64_ABS64 000000000001000c sym_global \+ 0 +0000000012340030 0000000400000101 R_AARCH64_ABS64 000000000001000c sym_global \+ 0 +0000000012340040 0000000300000101 R_AARCH64_ABS64 0000000000000000 sym_weak_undef \+ 0 + +Relocation section '\.relr\.dyn' at offset 0x101e0 contains 2 entries which relocate 3 locations: +Index: Entry Address Symbolic Address +0000: 0000000012340020 0000000012340020 aligned_local +0001: 0000000000000023 0000000012340028 aligned_hidden + 0000000012340048 aligned_DYNAMIC diff --git a/ld/testsuite/ld-aarch64/relr-data.s b/ld/testsuite/ld-aarch64/relr-data.s new file mode 100644 index 00000000000..93b401e4b5e --- /dev/null +++ b/ld/testsuite/ld-aarch64/relr-data.s @@ -0,0 +1,71 @@ +// Test symbol references in .data when used with DT_RELR. +// Relocations for unaligned sections are currently not packed. + +.text +.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 .data.unaligned_local +unaligned_local: +.xword sym_local + +.section .data.unaligned_hidden +unaligned_hidden: +.xword sym_hidden + +.section .data.unaligned_global +unaligned_global: +.xword sym_global + +.section .data.unaligned_DYNAMIC +unaligned_DYNAMIC: +.xword _DYNAMIC + +.section .data.aligned_local +.p2align 1 +aligned_local: +.xword sym_local + +.section .data.aligned_hidden +.p2align 1 +aligned_hidden: +.xword sym_hidden + +.section .data.aligned_global +.p2align 1 +aligned_global: +.xword sym_global + +.section .data.aligned_global_abs +.p2align 1 +aligned_global_abs: +.xword sym_global_abs + +.section .data.aligned_weak_undef +.p2align 1 +aligned_weak_undef: +.xword sym_weak_undef + +.section .data.aligned_DYNAMIC +.p2align 1 +aligned_DYNAMIC: +.xword _DYNAMIC diff --git a/ld/testsuite/ld-aarch64/relr-got-pie.d b/ld/testsuite/ld-aarch64/relr-got-pie.d new file mode 100644 index 00000000000..2a397498009 --- /dev/null +++ b/ld/testsuite/ld-aarch64/relr-got-pie.d @@ -0,0 +1,15 @@ +#source: relr-got.s +#ld: -pie -z pack-relative-relocs -T relocs.ld +#readelf: -rW + +Relocation section '\.rela\.dyn' at offset 0x100e8 contains 2 entries: + Offset Info Type Symbol's Value Symbol's Name \+ Addend +0000000000000000 0000000000000000 R_AARCH64_NONE 0 +0000000000020030 0000000200000401 R_AARCH64_GLOB_DAT 0000000000000000 sym_weak_undef \+ 0 + +Relocation section '\.relr\.dyn' at offset 0x10118 contains 2 entries which relocate 4 locations: +Index: Entry Address Symbolic Address +0000: 0000000000020008 0000000000020008 _GLOBAL_OFFSET_TABLE_ \+ 0x8 +0001: 000000000000000f 0000000000020010 _GLOBAL_OFFSET_TABLE_ \+ 0x10 + 0000000000020018 _GLOBAL_OFFSET_TABLE_ \+ 0x18 + 0000000000020020 _GLOBAL_OFFSET_TABLE_ \+ 0x20 diff --git a/ld/testsuite/ld-aarch64/relr-got-shared.d b/ld/testsuite/ld-aarch64/relr-got-shared.d new file mode 100644 index 00000000000..59526947a9a --- /dev/null +++ b/ld/testsuite/ld-aarch64/relr-got-shared.d @@ -0,0 +1,15 @@ +#source: relr-got.s +#ld: -shared -z pack-relative-relocs -T relocs.ld +#readelf: -rW + +Relocation section '\.rela\.dyn' at offset 0x10168 contains 3 entries: + Offset Info Type Symbol's Value Symbol's Name \+ Addend +0000000000020020 0000000300000401 R_AARCH64_GLOB_DAT 0000000000010038 sym_global \+ 0 +0000000000020028 0000000500000401 R_AARCH64_GLOB_DAT 000000000000002a sym_global_abs \+ 0 +0000000000020030 0000000200000401 R_AARCH64_GLOB_DAT 0000000000000000 sym_weak_undef \+ 0 + +Relocation section '\.relr\.dyn' at offset 0x101b0 contains 2 entries which relocate 3 locations: +Index: Entry Address Symbolic Address +0000: 0000000000020008 0000000000020008 _GLOBAL_OFFSET_TABLE_ \+ 0x8 +0001: 0000000000000007 0000000000020010 _GLOBAL_OFFSET_TABLE_ \+ 0x10 + 0000000000020018 _GLOBAL_OFFSET_TABLE_ \+ 0x18 diff --git a/ld/testsuite/ld-aarch64/relr-got.s b/ld/testsuite/ld-aarch64/relr-got.s new file mode 100644 index 00000000000..44e44633eb4 --- /dev/null +++ b/ld/testsuite/ld-aarch64/relr-got.s @@ -0,0 +1,40 @@ +// Test GOT relocations with DT_RELR. + +.text +.global _start +_start: + adrp x0, :got:sym_local + ldr x0, [x0, :got_lo12:sym_local] + + adrp x0, :got:sym_hidden + ldr x0, [x0, :got_lo12:sym_hidden] + + adrp x0, :got:sym_global + ldr x0, [x0, :got_lo12:sym_global] + + adrp x0, :got:sym_global + ldr x0, [x0, :got_lo12:sym_global_abs] + + adrp x0, :got:sym_weak_undef + ldr x0, [x0, :got_lo12:sym_weak_undef] + + adrp x0, :got:_DYNAMIC + ldr x0, [x0, :got_lo12:_DYNAMIC] + +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