From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Cc: leif.lindholm@linaro.org, lersek@redhat.com, Ard Biesheuvel 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: [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: , X-List-Received-Date: Mon, 01 Aug 2016 08:02:03 -0000 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(+) 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) -- 2.7.4