From patchwork Wed Jul 27 11:13:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 72848 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp242895qga; Wed, 27 Jul 2016 04:14:06 -0700 (PDT) X-Received: by 10.98.35.7 with SMTP id j7mr48583533pfj.39.1469618046548; Wed, 27 Jul 2016 04:14:06 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id 68si6041794pfr.68.2016.07.27.04.14.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jul 2016 04:14:06 -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 C79071A1E29; Wed, 27 Jul 2016 04:14:04 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com [IPv6:2a00:1450:400c:c09::231]) (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 363171A1E26 for ; Wed, 27 Jul 2016 04:14:03 -0700 (PDT) Received: by mail-wm0-x231.google.com with SMTP id q128so30426007wma.1 for ; Wed, 27 Jul 2016 04:14: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=d22QnJ+pt6PJZ+lcXzGuaXCBUoO6ja/XRn6Usj0SjyI=; b=M8DUacIfVAmT0fDF7Q7mqOSVvJ4gov1W/2S+hhoYVZ0vhrBS8OW3kuE6PM8WsIYGY9 hED/sDDy6mKIiJwE2lpqu7JQnvWg7Gba6P3UpVLA8+mE2CD+XnJBp+EBYpSPa566RjrU 9zolYmu3YNc65NQt1ieQWCAqnVjZLWQh+qlRY= 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=d22QnJ+pt6PJZ+lcXzGuaXCBUoO6ja/XRn6Usj0SjyI=; b=YydnjzNcGUm3LtMcxtjD8C6O5O+C/gSjRufIvjjJtBYR4stKZC+aWs/CgwBCOUf3zF IIV6MBOJ4IFcXVfuMsfUQ3nx2ME3a4Yy/qf0Hoc6lXMwKoCfn/q2xPVSMQ06mn5Vu302 0kA5doaMP4zZ1KUi9Bi4KYC6IB/a7XyTEIwIveTRVuiEdWlZOOcr8NNOReUlHeymykPj cClWduZPF6WrzlxekPx1ZCTp1mIkk/8sVVCVbgkmaB6o/Tbyaj2vAeAXkSg4OSb6E7Zh eAQZnz7UqSjZBrHYQUJhjhGzCV5FDdy+AsyqhKrjkCc4qA0abDK+rlnwnaekA1cAvFDY dKOg== X-Gm-Message-State: AEkoout7JuKmsYldHE97BsyT+k1ySYs/dH1gflTYbelzsmg0Fkzs1nQhFXgmbOB/w93wau7H X-Received: by 10.28.0.70 with SMTP id 67mr33129865wma.88.1469618041859; Wed, 27 Jul 2016 04:14:01 -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.14.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 27 Jul 2016 04:14:01 -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:36 +0200 Message-Id: <1469618017-6534-7-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 6/7] 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-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" 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 --- 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 32310bc75dcc..698bc606554c 100644 --- a/BaseTools/Scripts/GccBase.lds +++ b/BaseTools/Scripts/GccBase.lds @@ -57,6 +57,12 @@ SECTIONS { *(.rela .rela.*) } + /* + * 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)