\r
BOOLEAN mPropertiesTableEnable;\r
\r
+BOOLEAN mPropertiesTableEndOfDxe = FALSE;\r
+\r
//\r
// Below functions are for MemoryMap\r
//\r
it is the size of new memory map after merge.\r
@param DescriptorSize Size, in bytes, of an individual EFI_MEMORY_DESCRIPTOR.\r
**/\r
-STATIC\r
VOID\r
MergeMemoryMap (\r
IN OUT EFI_MEMORY_DESCRIPTOR *MemoryMap,\r
IMAGE_PROPERTIES_RECORD *ImageRecord;\r
CHAR8 *PdbPointer;\r
IMAGE_PROPERTIES_RECORD_CODE_SECTION *ImageRecordCodeSection;\r
- UINT16 Magic;\r
\r
DEBUG ((EFI_D_VERBOSE, "InsertImageRecord - 0x%x\n", RuntimeImage));\r
DEBUG ((EFI_D_VERBOSE, "InsertImageRecord - 0x%016lx - 0x%016lx\n", (EFI_PHYSICAL_ADDRESS)(UINTN)RuntimeImage->ImageBase, RuntimeImage->ImageSize));\r
\r
+ if (mPropertiesTableEndOfDxe) {\r
+ DEBUG ((DEBUG_INFO, "Do not insert runtime image record after EndOfDxe\n"));\r
+ return ;\r
+ }\r
+\r
ImageRecord = AllocatePool (sizeof(*ImageRecord));\r
if (ImageRecord == NULL) {\r
return ;\r
//\r
// Get SectionAlignment\r
//\r
- if (Hdr.Pe32->FileHeader.Machine == IMAGE_FILE_MACHINE_IA64 && Hdr.Pe32->OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {\r
- //\r
- // NOTE: Some versions of Linux ELILO for Itanium have an incorrect magic value\r
- // in the PE/COFF Header. If the MachineType is Itanium(IA64) and the\r
- // Magic value in the OptionalHeader is EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC\r
- // then override the magic value to EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC\r
- //\r
- Magic = EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC;\r
- } else {\r
- //\r
- // Get the magic value from the PE/COFF Optional Header\r
- //\r
- Magic = Hdr.Pe32->OptionalHeader.Magic;\r
- }\r
- if (Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {\r
+ if (Hdr.Pe32->OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {\r
SectionAlignment = Hdr.Pe32->OptionalHeader.SectionAlignment;\r
} else {\r
SectionAlignment = Hdr.Pe32Plus->OptionalHeader.SectionAlignment;\r
InsertTailList (&mImagePropertiesPrivateData.ImageRecordList, &ImageRecord->Link);\r
mImagePropertiesPrivateData.ImageRecordCount++;\r
\r
- SortImageRecord ();\r
-\r
if (mImagePropertiesPrivateData.CodeSegmentCountMax < ImageRecord->CodeSegmentCount) {\r
mImagePropertiesPrivateData.CodeSegmentCountMax = ImageRecord->CodeSegmentCount;\r
}\r
\r
+ SortImageRecord ();\r
+\r
Finish:\r
return ;\r
}\r
DEBUG ((EFI_D_VERBOSE, "RemoveImageRecord - 0x%x\n", RuntimeImage));\r
DEBUG ((EFI_D_VERBOSE, "RemoveImageRecord - 0x%016lx - 0x%016lx\n", (EFI_PHYSICAL_ADDRESS)(UINTN)RuntimeImage->ImageBase, RuntimeImage->ImageSize));\r
\r
+ if (mPropertiesTableEndOfDxe) {\r
+ DEBUG ((DEBUG_INFO, "Do not remove runtime image record after EndOfDxe\n"));\r
+ return ;\r
+ }\r
+\r
ImageRecord = FindImageRecord ((EFI_PHYSICAL_ADDRESS)(UINTN)RuntimeImage->ImageBase, RuntimeImage->ImageSize);\r
if (ImageRecord == NULL) {\r
DEBUG ((EFI_D_ERROR, "!!!!!!!! ImageRecord not found !!!!!!!!\n"));\r
VOID *Context\r
)\r
{\r
+ mPropertiesTableEndOfDxe = TRUE;\r
if (PcdGetBool (PcdPropertiesTableEnable)) {\r
EFI_STATUS Status;\r
\r