From nobody Wed May 1 08:54:16 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; dkim=fail spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1495190875475350.7199531780044; Fri, 19 May 2017 03:47:55 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id A581521A16EEF; Fri, 19 May 2017 03:47:53 -0700 (PDT) Received: from mail-wr0-x22e.google.com (mail-wr0-x22e.google.com [IPv6:2a00:1450:400c:c0c::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id DDC5221A16EC2 for ; Fri, 19 May 2017 03:47:51 -0700 (PDT) Received: by mail-wr0-x22e.google.com with SMTP id z52so14699254wrc.2 for ; Fri, 19 May 2017 03:47:51 -0700 (PDT) Received: from localhost.localdomain ([105.129.238.81]) by smtp.gmail.com with ESMTPSA id l7sm3619866wrc.52.2017.05.19.03.47.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 May 2017 03:47:48 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=reaz/7oA87h9ddNVklHiMVNsrZ09oqfSToL20Bv6E8s=; b=hFjP7CdpzBDZsS7eCLupfnmZJQI6a0Mf5PK2ieVT3o62yfKObaDnC2sKKMcO0UgGmA 90ZIKV7AU12SYcVbrQG3A2/az4s1w6plWIXZEQwQN5YoYHtF0/noaPv9i14npyp5aLyO /D+rSoVL0Kct9rAVwHmlo03rguRuqyMzG6WE4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=reaz/7oA87h9ddNVklHiMVNsrZ09oqfSToL20Bv6E8s=; b=roD9qK4f7Fu5z2lECnDS+9XX4N0VrHZ29mGBiWZmTeMXgDIWzNkaFUMA6UoothncKI RLaCzk5ulvmoVOIpye4rFDy0l/Wy9rShbLDs7XM+XZpfIJ8oi+48GnYtlRIfmZ6m1MXM 0l+vLLnkAeS/v9cWmveeiGUdJDks+vOfxPCeTrMQZNSxt0zZoUgb51Qj9Qmgp6Y5bTCx p+YLm5xiE/fYLjfm8BphERIulmhl5+y04aPnzOfzzFGXQ4j6easMFOeBTIJX+boWUMDv pePkXD3w/0r5U7LhHnpNgmZ4HOe4zMPUgUa91w3LCzayxrJ55CnjwWY4ogQ0ecWu7Yoa 2USA== X-Gm-Message-State: AODbwcDGd4DGxl4Y7RozxYHYfJWMMNGRWd1BkGuErImIf7WVRgO/oxeH 67SIoGjOj1babwbD X-Received: by 10.223.167.76 with SMTP id e12mr2567355wrd.177.1495190870478; Fri, 19 May 2017 03:47:50 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Fri, 19 May 2017 11:47:40 +0100 Message-Id: <20170519104740.16044-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.9.3 Subject: [edk2] [PATCH] BaseTools/Scripts: discard .gnu.hash section in GCC builds X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: liming.gao@intel.com, leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Some builds of GCC/binutils will default to using the GNU flavor of the symbol hash table, and will emit it into a section called .gnu.hash rather than .hash. We have no use for its contents, and GenFw ignores it anyway, so it shouldn't really matter what we do with it. However, due to a workaround for AARCH64 we have in GenFw to deal with older GCCs that corrupt section-based relocations when merging sections during the final link, we need the ELF and PE/COFF views of the binary to be identical. Since we don't place the .gnu.hash section explicitly, it may end up at the beginning of the ELF binary, causing other sections to be shifted in the ELF view but not in the PE/COFF view. So let's add .gnu.hash to the GCC linker script. We don't care about its contents so add it to the /DISCARD/ section. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel Reviewed-by: Liming Gao Tested-by: Leif Lindholm --- BaseTools/Scripts/GccBase.lds | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BaseTools/Scripts/GccBase.lds b/BaseTools/Scripts/GccBase.lds index 41e5c0b4a769..a43e0072f2b4 100644 --- a/BaseTools/Scripts/GccBase.lds +++ b/BaseTools/Scripts/GccBase.lds @@ -78,7 +78,7 @@ SECTIONS { *(.dynsym) *(.dynstr) *(.dynamic) - *(.hash) + *(.hash .gnu.hash) *(.comment) *(COMMON) } --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel