]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/Core/Dxe: downgrade "CodeSegmentCount is 0" msg to DEBUG_WARN
authorLaszlo Ersek <lersek@redhat.com>
Mon, 20 Mar 2017 10:24:23 +0000 (11:24 +0100)
committerLaszlo Ersek <lersek@redhat.com>
Mon, 20 Mar 2017 15:42:03 +0000 (16:42 +0100)
UEFI executables that consist of a single read+write+exec PE/COFF section
trigger this message, but such a binary layout isn't actually an error.
The image can be launched alright, only image protection cannot be applied
to it fully.

One example that elicits the message is (some) Linux kernels (with the EFI
stub of course).

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c

index 7689c794a8ad22601965303e4dfce255e3923c09..451cc35b92908f9ba1c83724cdab06ae6f593f8f 100644 (file)
@@ -580,10 +580,18 @@ ProtectUefiImageCommon (
   }\r
 \r
   if (ImageRecord->CodeSegmentCount == 0) {\r
-    DEBUG ((DEBUG_ERROR, "!!!!!!!!  ProtectUefiImageCommon - CodeSegmentCount is 0  !!!!!!!!\n"));\r
+    //\r
+    // If a UEFI executable consists of a single read+write+exec PE/COFF\r
+    // section, that isn't actually an error. The image can be launched\r
+    // alright, only image protection cannot be applied to it fully.\r
+    //\r
+    // One example that elicits this is (some) Linux kernels (with the EFI stub\r
+    // of course).\r
+    //\r
+    DEBUG ((DEBUG_WARN, "!!!!!!!!  ProtectUefiImageCommon - CodeSegmentCount is 0  !!!!!!!!\n"));\r
     PdbPointer = PeCoffLoaderGetPdbPointer ((VOID*) (UINTN) ImageAddress);\r
     if (PdbPointer != NULL) {\r
-      DEBUG ((DEBUG_ERROR, "!!!!!!!!  Image - %a  !!!!!!!!\n", PdbPointer));\r
+      DEBUG ((DEBUG_WARN, "!!!!!!!!  Image - %a  !!!!!!!!\n", PdbPointer));\r
     }\r
     goto Finish;\r
   }\r