summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2025-01-29 00:09:20 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2025-01-29 18:42:13 +0000
commit3600675368581ba4987f5656c2783bab62750ee7 (patch)
tree850a3dc892370a5395bd7f47a6e174b69069397a
parent254937f0bca17649b5d213381a38ffe9ff66acec (diff)
downloadedk2-3600675368581ba4987f5656c2783bab62750ee7.tar.gz
MdePkg/BasePeCoffLib: Remove DEBUG() statements from runtime code
PeCoffLoaderRelocateImageForRuntime() executes after boot services, and so it should not use DEBUG() prints at all, given that these may rely on MMIO mappings or other boot time facilities that are no longer available. So revert the changes in aedcaa3df8a2 ("MdePkg: Fix overflow issue in PeCoffLoaderRelocateImageForRuntime") that replaced code comments with DBEUG() statements. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
-rw-r--r--MdePkg/Library/BasePeCoffLib/BasePeCoff.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/MdePkg/Library/BasePeCoffLib/BasePeCoff.c b/MdePkg/Library/BasePeCoffLib/BasePeCoff.c
index 92285dfd05..f853c84827 100644
--- a/MdePkg/Library/BasePeCoffLib/BasePeCoff.c
+++ b/MdePkg/Library/BasePeCoffLib/BasePeCoff.c
@@ -1845,11 +1845,15 @@ PeCoffLoaderRelocateImageForRuntime (
}
if ((RelocBase == NULL) || (RelocBaseEnd == NULL) || ((UINTN)RelocBaseEnd < (UINTN)RelocBase)) {
- DEBUG ((DEBUG_ERROR, "Relocation block is not valid\n"));
+ //
+ // relocation block is not valid, just return
+ //
return;
}
} else {
- DEBUG ((DEBUG_ERROR, "Cannot find relocations, cannot continue to relocate the image\n"));
+ //
+ // Cannot find relocations, cannot continue to relocate the image, ASSERT for this invalid image.
+ //
ASSERT (FALSE);
return;
}