public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdePkg BasePeCoffLib: Ignore the debug entry read error after it is found
@ 2023-04-27  6:17 gaoliming
  2023-04-27 14:47 ` [edk2-devel] " Ard Biesheuvel
  0 siblings, 1 reply; 6+ messages in thread
From: gaoliming @ 2023-04-27  6:17 UTC (permalink / raw)
  To: devel; +Cc: Ard Biesheuvel, Michael Kubacki

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4425

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 <gaoliming@byosoft.com.cn>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
---
 MdePkg/Library/BasePeCoffLib/BasePeCoff.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdePkg/Library/BasePeCoffLib/BasePeCoff.c b/MdePkg/Library/BasePeCoffLib/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 != ReadSize)) {
+          if ((ImageContext->DebugDirectoryEntryRva == 0) && (RETURN_ERROR (Status) || (Size != ReadSize))) {
             ImageContext->ImageError = IMAGE_ERROR_IMAGE_READ;
             if (Size != ReadSize) {
               Status = RETURN_UNSUPPORTED;
-- 
2.37.3.windows.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-05-04 14:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-27  6:17 [PATCH] MdePkg BasePeCoffLib: Ignore the debug entry read error after it is found gaoliming
2023-04-27 14:47 ` [edk2-devel] " Ard Biesheuvel
2023-04-28  6:02   ` 回复: " gaoliming
2023-04-28  9:20     ` Ard Biesheuvel
2023-05-04  7:49       ` 回复: " gaoliming
2023-05-04 14:15         ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox