From patchwork Mon Aug 1 08:01:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 73093 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp2567774qga; Mon, 1 Aug 2016 01:02:07 -0700 (PDT) X-Received: by 10.98.193.1 with SMTP id i1mr93644768pfg.66.1470038525941; Mon, 01 Aug 2016 01:02:05 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id h70si33919585pfh.199.2016.08.01.01.02.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Aug 2016 01:02:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; 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 2001:19d0:306:5::1 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 336661A1E3E; Mon, 1 Aug 2016 01:02:04 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wm0-x236.google.com (mail-wm0-x236.google.com [IPv6:2a00:1450:400c:c09::236]) (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 562DF1A1E3E for ; Mon, 1 Aug 2016 01:02:03 -0700 (PDT) Received: by mail-wm0-x236.google.com with SMTP id f65so359160071wmi.0 for ; Mon, 01 Aug 2016 01:02:03 -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=M45gcoXNq+smjKWQIkj/QIDxZxLm1BLH48mroPpbGF8=; b=eA1SEHljT4sroaK723ZGRBnd6w+A1wjt7BTJYXRmqXTrYLQJWX+9HLAnhCewS5vwu+ hPaQQs8WTuBvse6uZjxxEsrjNQAsPuOsmLhwvwH+0+H/XiALcvan0MG4Gc5P6nKQBOZd PyxzffWndzSBMooxCQcmtGqmqDdvKIG5P8FqI= 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=M45gcoXNq+smjKWQIkj/QIDxZxLm1BLH48mroPpbGF8=; b=lc5s7JLIwYSMvFll5VBfHCpjPMl3ISX9xjoSdohdXUkvK+Y2eCigt1PeeuvMdNBDAy Y9UOuB5DHinNP3uOsAypGxympYUTxsoLJjDwiU2/ioq1K+oSCUqOY8X/2dttBofZjZ23 ztCXc1c7nT3Q+Snp1QVbEw+jvXusfulbZzQBMs4uke0Ydp7qRZlUBhNWFt51jh1FQCXx ZBc0fjmuv7jSn92l+Gybi1v2Nrb8AT4SAQiol4M17gttTfHGV8uBINXzDHiAbnLmiFSg KgsHQfGGoI0H7qR+Avh1kWJtAPhlcMrK6W5Wvf9lD3J6xhSYkCmD5gv/ovL33Ucwp/1D YAUg== X-Gm-Message-State: AEkoouubVIIzFEeI+eUzJXwwMpBgelxhGfcVlja7/0BAXJHw33kmmHzzJLec6QV3EfBW+xIQ X-Received: by 10.28.198.140 with SMTP id w134mr55929275wmf.30.1470038521949; Mon, 01 Aug 2016 01:02:01 -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.02.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Aug 2016 01:02:01 -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 Date: Mon, 1 Aug 2016 10:01:35 +0200 Message-Id: <1470038497-2536-7-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: [edk2] [PATCH v5 6/8] BaseTools GCC: drop GNU notes section from EFI image 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: , Cc: lersek@redhat.com, leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Recent versions of GNU ld automatically emit a .notes section into the ELF binary containing a build id. Since this is an allocatable section by default, it will be identified by GenFw as a section that requires PE/COFF conversion, which may cause sections to be moved around unexpectedly. So retain the section, but tag it as INFO, which tells the linker that it should not be accounted for in the binary's memory layout. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel Acked-by: Jordan Justen --- BaseTools/Scripts/GccBase.lds | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/BaseTools/Scripts/GccBase.lds b/BaseTools/Scripts/GccBase.lds index 7e4cdde9bfea..281af8a9bd33 100644 --- a/BaseTools/Scripts/GccBase.lds +++ b/BaseTools/Scripts/GccBase.lds @@ -62,6 +62,12 @@ SECTIONS { KEEP (*(.hii)) } + /* + * Retain the GNU build id but in a non-allocatable section so GenFw + * does not copy it into the PE/COFF image. + */ + .build-id (INFO) : { *(.note.gnu.build-id) } + /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink)