From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from walk.intel-email.com (walk.intel-email.com [101.227.64.242]) by mx.groups.io with SMTP id smtpd.web10.14084.1682576250801646529 for ; Wed, 26 Apr 2023 23:17:31 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@byosoft.com.cn header.s=cloud-union header.b=TeRSpCAy; spf=pass (domain: byosoft.com.cn, ip: 101.227.64.242, mailfrom: gaoliming@byosoft.com.cn) Received: from walk.intel-email.com (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id 9894DCD1F776 for ; Thu, 27 Apr 2023 14:17:27 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=byosoft.com.cn; s=cloud-union; t=1682576247; bh=DYl8uTnKcNAaE+EezZZS1bdysY89DoxIPjA0nngO+ZM=; h=From:To:Cc:Subject:Date; b=TeRSpCAyBoYXnJCNSEpM7FiFNQWANii+7dzDTCArTbkC9wqXki5c1XpmwPpkJD3Pl ZKE8zZMgsExpYPRj875fHj96u/F8kPqFsbIfTEvUf5m7cCZ9BHgB3v9gnWBTS+vWS5 XENDKEiGRw2nyrRCCC86N6NT53XHDpFUIFfbeJrw= Received: from localhost (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id 942A4CD1F775 for ; Thu, 27 Apr 2023 14:17:27 +0800 (CST) Received: from walk.intel-email.com (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id 69D7ACD1F760 for ; Thu, 27 Apr 2023 14:17:27 +0800 (CST) Authentication-Results: walk.intel-email.com; none Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by walk.intel-email.com (Postfix) with SMTP id 814E2CD1F776 for ; Thu, 27 Apr 2023 14:17:25 +0800 (CST) Received: from localhost.localdomain ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Thu, 27 Apr 2023 14:17:21 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Michael Kubacki Subject: [PATCH] MdePkg BasePeCoffLib: Ignore the debug entry read error after it is found Date: Thu, 27 Apr 2023 14:17:14 +0800 Message-Id: <20230427061714.510-1-gaoliming@byosoft.com.cn> X-Mailer: git-send-email 2.37.3.windows.1 MIME-Version: 1.0 Sender: Liming Gao Content-Transfer-Encoding: quoted-printable BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4425 This change is to support the pre-built EFI image on the old Edk2 code. Old Edk2 GenFw tool generates the wrong debug entry in EFI image. Those pre-built images can be loaded before d6457b309. Signed-off-by: Liming Gao Cc: Ard Biesheuvel Cc: Michael Kubacki --- MdePkg/Library/BasePeCoffLib/BasePeCoff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdePkg/Library/BasePeCoffLib/BasePeCoff.c b/MdePkg/Library/B= asePeCoffLib/BasePeCoff.c index 4b71176a0c..4636842eeb 100644 --- a/MdePkg/Library/BasePeCoffLib/BasePeCoff.c +++ b/MdePkg/Library/BasePeCoffLib/BasePeCoff.c @@ -735,7 +735,7 @@ PeCoffLoaderGetImageInfo ( &Size, &DebugEntry ); - if (RETURN_ERROR (Status) || (Size !=3D ReadSize)) { + if ((ImageContext->DebugDirectoryEntryRva =3D=3D 0) && (RETURN= _ERROR (Status) || (Size !=3D ReadSize))) { ImageContext->ImageError =3D IMAGE_ERROR_IMAGE_READ; if (Size !=3D ReadSize) { Status =3D RETURN_UNSUPPORTED; --=20 2.37.3.windows.1