From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x22c.google.com (mail-wm0-x22c.google.com [IPv6:2a00:1450:400c:c09::22c]) (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 5C9131A1E11 for ; Mon, 1 Aug 2016 01:01:51 -0700 (PDT) Received: by mail-wm0-x22c.google.com with SMTP id o80so231390692wme.1 for ; Mon, 01 Aug 2016 01:01:51 -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=xzQSHNmcNNt7BhMmfas69rSesLn2D8aG9d0t4hjsnlI=; b=ZwVOuKxZr6RcPj5q4xe3VtiWfJI3oCE9IDmXQOHnS0PD19UNDBub5ZWhzedenPO+/b YqVhLiU7fR7FFjl5scKG5q182Csx3BM4c9TYP8CHRGwz1fPpcl/UHpPHddDW5pW5DNFK VDX+Y76XxIzbTHpTjV0viZdRxSwBl5hn+Vo0g= 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=xzQSHNmcNNt7BhMmfas69rSesLn2D8aG9d0t4hjsnlI=; b=F2b+sLD0AqSW2kv3tt891rQ1AmgFOs3Vlxn/aIz7HMySIePtk/CM2u+S7JKDXLYFpT N2A2S24uicd5en/IWAmNnsovtu0S9jYhaf6mL9wU5yJFHNS+KFYbiAyBy5AyvVMVK9cp CHAr3oWz0rn36WHI/83h3xGmKq8PNt5MDLhuAQ+xV1gnsOzLoRSOzeoqfp1fO9+JgVbH f2xBvlxPV7GMm4Z5ahQ1bJs27qs6sh+0dzksVDq7X6U8u1Gv62M2mmQ4C3ZTitRSDAji 0y0egZ0ltwtbMFj/9le82Zfv/OjXvkAbYbRXZNyL4N9jOaXWerx+Kpj1H/mBrZa3o+xC G7zQ== X-Gm-Message-State: AEkoouv73fAq0io0SobzKJJYGlRgyY7cbuffDUxbR72B+W09UvCaHRLbdWc1dv+49LbP0Fg7 X-Received: by 10.28.216.75 with SMTP id p72mr13006628wmg.67.1470038509953; Mon, 01 Aug 2016 01:01:49 -0700 (PDT) Received: from localhost.localdomain (3.red-81-34-118.dynamicip.rima-tde.net. [81.34.118.3]) by smtp.gmail.com with ESMTPSA id m62sm15671943wmm.24.2016.08.01.01.01.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Aug 2016 01:01:49 -0700 (PDT) From: Ard Biesheuvel To: steven.shi@intel.com, yonghong.zhu@intel.com, liming.gao@intel.com, jordan.l.justen@intel.com, edk2-devel@lists.01.org Cc: leif.lindholm@linaro.org, lersek@redhat.com, Ard Biesheuvel Date: Mon, 1 Aug 2016 10:01:31 +0200 Message-Id: <1470038497-2536-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1470038497-2536-1-git-send-email-ard.biesheuvel@linaro.org> References: <1470038497-2536-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [PATCH v5 2/8] 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-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2016 08:01:51 -0000 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 Acked-by: Jordan Justen --- ArmVirtPkg/PrePi/Scripts/PrePi-PIE.lds | 3 +++ 1 file changed, 3 insertions(+) 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) -- 2.7.4