Message ID | dc0f734f-9fba-7a7b-a746-49b4fc033dac@suse.com |
---|---|
State | Accepted |
Headers |
Return-Path: <binutils-bounces+ouuuleilei=gmail.com@sourceware.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2945010wrt; Thu, 23 Mar 2023 07:30:29 -0700 (PDT) X-Google-Smtp-Source: AK7set+7tMiQoIdYBOb0hbXryHv6vewYWHsRoKgqKs2Ti+3Qgq01V38+74m2ajA40ZdSFm/AGUSD X-Received: by 2002:a17:906:344d:b0:932:83fa:d2fe with SMTP id d13-20020a170906344d00b0093283fad2femr10867709ejb.12.1679581829530; Thu, 23 Mar 2023 07:30:29 -0700 (PDT) Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id w25-20020a50fa99000000b004af50024631si21104854edr.433.2023.03.23.07.30.29 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Mar 2023 07:30:29 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=g9DNpROk; arc=fail (signature failed); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 54A4F38708B1 for <ouuuleilei@gmail.com>; Thu, 23 Mar 2023 14:30:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 54A4F38708B1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679581827; bh=QS07v3q2AVnFgVHFT/sxiEpJrsdtYWYAXhUFVL7tzqc=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=g9DNpROk7a1NLmZerEm7/pd8Lov/zSLV/kdm7EV0fauIZQnpmuM/AsydeWVrO977e DY0P9mgsC1Ub5djNuO3jNm7Pah099yNsvqS7wE1QI4SbuUsA+mTPpih0QVmN3JLAvz c0/m1nB6XjZHkg4hk0GAz6JqKJFJoqtfNvn+Qlxw= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2084.outbound.protection.outlook.com [40.107.247.84]) by sourceware.org (Postfix) with ESMTPS id DFF23384600C for <binutils@sourceware.org>; Thu, 23 Mar 2023 14:30:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DFF23384600C ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AIhWB8gTfG8ztCNT4xQUsgV0YOrDMj2iPADLfF5HtFrYJV7RmnEXN7iYRQbcyC3t/1YO3Wab8Rw3G2D4C+37KLbFFiiap1mZlR07JLVIlyV7GZu5h4j6jvDB569ZPCvkN2MEGS7C++sudvNq9V1kibQwCFSAsESUeZVAr8wEqWM3luwN3IJwI81kwJaC2io0x3ulYQ8/hVyJHJ5kU4rIQ+8mxxY76uT4WIUfXHzknKaGodCZeQGlTsmEPd/9XHLInyKpV5mTJZCfLz4qPAIf+5t1Ejp2ybzkA26dKFDpv8n49xPcPyCCGxj2MwUaV1JsZiTqHj1izbkAHn+q1VE5HA== 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=QS07v3q2AVnFgVHFT/sxiEpJrsdtYWYAXhUFVL7tzqc=; b=E0d7L1GtiOWma944aKir5rrzq/JJ0ChPVTksLufCnfWlIuVi3OEBmRu2ZbGKOMaa9rHg9TN3kjlXllwUfi7lUuAZ1uCf14kg6NygEKw4pHpYbAKqaqoJtA9jGR+bPlPVSyTXE6Hs+D2QY77Efatb4swIAnhJM6GS/v7ob4d6SzWj3hzdexrnrdUe+JVKjDdlfLVbsF3NppsySRpd77n8EYj7C0v0Cts8gXrwnwDY6G2vDefe3P1/Hjq2jyhJCGVkDf/V5KgcygSXKMzCr9yVrqdZv7KcTWbe/GLJya8ZYUw5WXOxZfBWoNY0ApcQfRMzuDIMD4jr0K0kJxD8NFsI7g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) by AS8PR04MB7783.eurprd04.prod.outlook.com (2603:10a6:20b:2a4::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.38; Thu, 23 Mar 2023 14:30:17 +0000 Received: from VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::154e:166d:ec25:531b]) by VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::154e:166d:ec25:531b%5]) with mapi id 15.20.6178.038; Thu, 23 Mar 2023 14:30:17 +0000 Message-ID: <dc0f734f-9fba-7a7b-a746-49b4fc033dac@suse.com> Date: Thu, 23 Mar 2023 15:30:15 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Content-Language: en-US To: Binutils <binutils@sourceware.org> Cc: Richard Earnshaw <rearnsha@arm.com>, Marcus Shawcroft <marcus.shawcroft@arm.com> Subject: [PATCH] Arm64/ELF: accept relocations against STN_UNDEF Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR2P281CA0117.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:9d::7) To VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6560:EE_|AS8PR04MB7783:EE_ X-MS-Office365-Filtering-Correlation-Id: c0431fa4-14ee-4b90-5efa-08db2bab1f78 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ey1Zz0i3XBz1fpYeoctYH1h3ITUCegid1UbUp1OgvDF4jXu2NGInjPAy2KcFJaWtbBH3i3iENEBzRHZZbm8eeKedh4TI75MN29Ve28T35FUaWMWqfAVEwcTrzsSnx5VXZc5fja++njj2NAL7qUss3R5xL2WLcxxXsRBywIuCvSmg6dzxOX/gECc6OtF2WL9l25Q/fW8biZ4rc2UBGOiV57Qly0X/I+HosJCc17PqzGN+vbGbkxrBeifYgFkGY3JNMF0QtnkEtD/pqlGNcBYtQ9y7JD3RI1zBVEHO19PEsmnsRKlDeqIcp+vjckvBqXKCDVel00FlUeV/e0GePgBdwJK2VIAwsznFuk1TFvTkVNRS65Y96+WCzi2eIn4MmhO1A1A16dbJG6gu6MAs/KB8jMtsG9eumHfhlHxeXGQpRZamcxTht8hYrEmMuwjJZdmQ07g1pdSKEHy596YtupN6XE333ydG3yenzmcf3JoAr3rnLsLCKISyA1q4H9q1yRwlxKoTmxDyYE/SKfy1dobo540F/r7+PX0V6XLbyNZfhHF0ogBOOXq7ZGseLoFagK4Zst3m/f6GtZ8/MmA3M6w7+c92c5BdsDUrpKR1L0qJxqZFH24K1wG/RE8iZ6pFU+r+7B3fikgdOQm1IzyZqFzJBW8B5iS3kFyk/H3BBlQyMApd/ytXiD7HqBZdIqNLoQ2gWlOrJuz6Kmo3gcEp9U8RMRpuNqgUNrqNo2eRcJe/wU0= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6560.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(39860400002)(366004)(136003)(376002)(396003)(346002)(451199018)(36756003)(4326008)(86362001)(8676002)(6916009)(66946007)(66476007)(66556008)(8936002)(41300700001)(478600001)(6486002)(316002)(54906003)(2906002)(5660300002)(4744005)(31696002)(26005)(38100700002)(6512007)(6506007)(2616005)(186003)(31686004)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?WoK4vti6xnKtztxUXpROUMYsyVoN?= =?utf-8?q?U9h1dEIb+8XfPIQBpWgZ81pDVlO2EWWLJpK/RKpCyKjIhszk2TRYs7zhp23KlgAX0?= =?utf-8?q?EGiOXnQgfengOijeH0jAVB0sFUppbQTS0B+pQEb7WNpk53eY4R0HpA8JDww7vYPW6?= =?utf-8?q?rUcpv0hBb91GYpFYH46yMF8lM02y57YYcucCRoTJhTqJdKiqa2oQl/wDARGtaHn/S?= =?utf-8?q?8fHrrQg7NCaCEAo3M1a6+wlqV6Ui1LST+WobSSDZd297jQdFaFzTYBUVd8v1PRY+x?= =?utf-8?q?I9PHsn/bPOL1be+s7AfLF0Eo2hMBkR7fe5a32HAsIiiVnbFoKNp94Rzl9hPtamCez?= =?utf-8?q?+cfeRGklHQfQcgqeqqIGarriQBlFI7WuEDLBQFBAUcOxM/D4S8zKtnSwp0HhTmloa?= =?utf-8?q?H1XTULrdJjQjo/W+JKLJdsE3iVveEr4XTNoKOUgHw63OZyXKddqItSga6hQOuXZR9?= =?utf-8?q?9QO8QijvYeRNOYAZ9sRmnU87zd/yhITts2mnBYqi0L+UG0Qw8ThE5uSShedPu/VkO?=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5v7KnN3MKImyjqmNb/Wy9vSuJmjit/nIA3cSA7NaKVwptn/vseE76b8T7rUBA?= =?utf-8?q?yK3hmnxZiw2a+r5/4tMahfIkR+sjhvMKk5ArJYrBaeGQc0yGLRLo/mlzOPIevc0ev?= =?utf-8?q?rbmouDmXNvTa?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: c0431fa4-14ee-4b90-5efa-08db2bab1f78 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6560.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Mar 2023 14:30:17.1691 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: g2K9WBZGz95wtlEsKvy2L+DEocKFp2/c0QP9fS2qAcDwHl9Ewu8b/V/x2c9ZW7/5eBUmN37JnR0Mw2BAM5+EXQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7783 X-Spam-Status: No, score=-3028.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP 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.29 Precedence: list List-Id: Binutils mailing list <binutils.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/binutils>, <mailto:binutils-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/binutils/> List-Post: <mailto:binutils@sourceware.org> List-Help: <mailto:binutils-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/binutils>, <mailto:binutils-request@sourceware.org?subject=subscribe> From: Jan Beulich via Binutils <binutils@sourceware.org> Reply-To: Jan Beulich <jbeulich@suse.com> Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" <binutils-bounces+ouuuleilei=gmail.com@sourceware.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761169196297890510?= X-GMAIL-MSGID: =?utf-8?q?1761169196297890510?= |
Series |
Arm64/ELF: accept relocations against STN_UNDEF
|
|
Checks
Context | Check | Description |
---|---|---|
snail/binutils-gdb-check | success | Github commit url |
Commit Message
Jan Beulich
March 23, 2023, 2:30 p.m. UTC
While only a secondary issue there, the testcase of PR gas/27212 exposes an oversight in relocation handling: Just like e.g. Arm32, which has a similar comment and a similar check, relocations against STN_UNDEF have to be permitted to satisfy the ELF spec.
--- a/bfd/elfnn-aarch64.c +++ b/bfd/elfnn-aarch64.c @@ -6779,8 +6779,12 @@ elfNN_aarch64_relocate_section (bfd *out /* An object file might have a reference to a local undefined symbol. This is a daft object file, but we - should at least do something about it. */ + should at least do something about it. NONE and NULL + relocations do not use the symbol and are explicitly + allowed to use an undefined one, so allow those. + Likewise for relocations against STN_UNDEF. */ if (r_type != R_AARCH64_NONE && r_type != R_AARCH64_NULL + && r_symndx != STN_UNDEF && bfd_is_und_section (sec) && ELF_ST_BIND (sym->st_info) != STB_WEAK) (*info->callbacks->undefined_symbol)