From patchwork Wed Jul 27 11:13:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 72844 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp242808qga; Wed, 27 Jul 2016 04:13:56 -0700 (PDT) X-Received: by 10.98.155.17 with SMTP id r17mr48441324pfd.24.1469618036467; Wed, 27 Jul 2016 04:13:56 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id dc5si6027283pab.101.2016.07.27.04.13.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jul 2016 04:13:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 9C5381A1E20; Wed, 27 Jul 2016 04:13:53 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::234]) (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 C93421A1E14 for ; Wed, 27 Jul 2016 04:13:52 -0700 (PDT) Received: by mail-wm0-x234.google.com with SMTP id q128so208000070wma.1 for ; Wed, 27 Jul 2016 04:13:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZtUIIgAXpRO+FRqLVTBzgZ2VQ3zFPoYjkfJ3a3G5524=; b=VBTncb5UB+iLjUwV7hmgBTxsnZIhtEluOndUfsiwWIuQJpWeNZzyxjCMYY/RgcePjC QGs/8O1+VJMhgaBYeERVIpwPVp9Obmjc9reCSDrJtFyhvCdzu2eUKk3fnzhv7v/cGAgu zJbGtEEPhEkXhvRhPpGaHhIRt1IRGpyeVKMUA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZtUIIgAXpRO+FRqLVTBzgZ2VQ3zFPoYjkfJ3a3G5524=; b=YWMtQpyXTCVbpsLnaEX3HCVrpoJ0EiJS5TEcEeGxDGcFAQ1vNMlCQPywwhfHpPSeod hR/yMkttzNqfXxpCIs3bUXI8O5DMVfDT8QUcuN7tMWSW+wR31aqKigILM+U1WZrctSjQ cTRxsX5Htz8nKH/3Qe3uxkv+noe2qu/xG4H3FWCqbuBh7PPPZQHvONKvdYpS0vvZ8Ssu Sqr+s1rHgum0fGOIqLGKcuKw3L+uIoO4p7Cu1xhLVla8sXKI6KZhwpryNcPDzv2pzr44 8HYIX/m8KsGUEWYB60lHrdekmxhAZhOGSUR2Uf+8JCPXIAJ5p3vD4fO0EUcy1P1Y7MLq AhSg== X-Gm-Message-State: AEkoousJ2g5HeZGQQJkB8myw9OG7Owp3uAFFxC4jLFnDyN9aG3G2FQzSvdDF1Hl1RIH+lq+A X-Received: by 10.28.40.133 with SMTP id o127mr28548484wmo.46.1469618031435; Wed, 27 Jul 2016 04:13:51 -0700 (PDT) Received: from localhost.localdomain (154.red-83-36-182.dynamicip.rima-tde.net. [83.36.182.154]) by smtp.gmail.com with ESMTPSA id s184sm21699514wmb.11.2016.07.27.04.13.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 27 Jul 2016 04:13:50 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com, liming.gao@intel.com, steven.shi@intel.com, yonghong.zhu@intel.com, jordan.l.justen@intel.com Date: Wed, 27 Jul 2016 13:13:32 +0200 Message-Id: <1469618017-6534-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1469618017-6534-1-git-send-email-ard.biesheuvel@linaro.org> References: <1469618017-6534-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH v4 2/7] ArmVirtPkg/ArmVirtPrePiUniCoreRelocatable: ignore .hash and .note sections X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Newer versions of ld automatically emit .gnu.hash and .note.gnu.build-id sections, which are not listed in the linker script, and will end up breaking the build with an allocation conflict, e.g., /usr/bin/aarch64-linux-gnu-ld: section .note.gnu.build-id loaded at [0000000000000000,0000000000000023] overlaps section .text loaded at [0000000000000000,0000000000017dbf] Since we don't require or care about these sections, update the linker script so that they are discarded. Note that this involves emitting the .note.gnu.build-id section into a non-allocatable segment to prevent the linker from noticing that it is being discarded (and subsequently complaining about it) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel Acked-by: Laszlo Ersek --- ArmVirtPkg/PrePi/Scripts/PrePi-PIE.lds | 3 +++ 1 file changed, 3 insertions(+) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/ArmVirtPkg/PrePi/Scripts/PrePi-PIE.lds b/ArmVirtPkg/PrePi/Scripts/PrePi-PIE.lds index 832ad1474468..44df7840adfd 100644 --- a/ArmVirtPkg/PrePi/Scripts/PrePi-PIE.lds +++ b/ArmVirtPkg/PrePi/Scripts/PrePi-PIE.lds @@ -30,8 +30,11 @@ SECTIONS PROVIDE(__reloc_end = .); } + .note (INFO) : { *(.note.gnu.build-id) } + /DISCARD/ : { *(.note.GNU-stack) + *(.gnu.hash) *(.gnu_debuglink) *(.interp) *(.dynamic)