public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Liming Gao <liming.gao@intel.com>
To: edk2-devel@lists.01.org
Subject: [Patch] BaseTools: Roll back GenFw Change to keep unknown field in RSDS debug entry
Date: Tue, 22 Aug 2017 13:58:57 +0800	[thread overview]
Message-ID: <1503381537-6048-1-git-send-email-liming.gao@intel.com> (raw)

https://lists.01.org/pipermail/edk2-devel/2017-August/013488.html
These fields are actually a GUID and DWORD respectively: the GUID identifies
the PDB to make it possible to verify that a given PDB matches the PE file,
and the DWORD is the "age" of the PDB which is simply a helper value that is
incremented by 1 by the linker every time the file is remade. Wiping the
GUID will cause PDB parsers (such as the MS DIA SDK that IDA and most other
tools use) to treat the PDB as a mismatch and refuse to load it.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
---
 BaseTools/Source/C/GenFw/GenFw.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/BaseTools/Source/C/GenFw/GenFw.c b/BaseTools/Source/C/GenFw/GenFw.c
index af60c92..33ba917 100644
--- a/BaseTools/Source/C/GenFw/GenFw.c
+++ b/BaseTools/Source/C/GenFw/GenFw.c
@@ -2903,13 +2903,7 @@ Returns:
       }
       if (DebugEntry->Type == EFI_IMAGE_DEBUG_TYPE_CODEVIEW) {
         RsdsEntry = (EFI_IMAGE_DEBUG_CODEVIEW_RSDS_ENTRY *) (FileBuffer + DebugEntry->FileOffset);
-        if (RsdsEntry->Signature == CODEVIEW_SIGNATURE_RSDS) {
-          RsdsEntry->Unknown  = 0;
-          RsdsEntry->Unknown2 = 0;
-          RsdsEntry->Unknown3 = 0;
-          RsdsEntry->Unknown4 = 0;
-          RsdsEntry->Unknown5 = 0;
-        } else if (RsdsEntry->Signature == CODEVIEW_SIGNATURE_MTOC) {
+        if (RsdsEntry->Signature == CODEVIEW_SIGNATURE_MTOC) {
           // MTOC sets DebugDirectoryEntrySize to size of the .debug section, so fix it.
           if (!ZeroDebugFlag) {
             if (Optional32Hdr->Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
-- 
2.8.0.windows.1



                 reply	other threads:[~2017-08-22  5:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1503381537-6048-1-git-send-email-liming.gao@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox