Add EntryPoint info of module into Fv.map file, which is used to debug when no serial output.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1544 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lgao4 2006-09-15 07:53:15 +00:00
parent 1744b047bb
commit 7838808993
1 changed files with 24 additions and 10 deletions

View File

@ -706,12 +706,18 @@ Returns:
memcpy (CurrentPe32Section.Pe32Section + 1, (VOID *) MemoryImagePointerAligned, (UINT32) ImageSize);
//
// Get EntryPoint in Flash Region.
//
EntryPoint = NewPe32BaseAddress + EntryPoint - ImageAddress;
//
// If a map file was selected output mapping information for any file that
// was rebased.
//
if (MapFile != NULL) {
fprintf (MapFile, "PE32 File: %s Base:%08lx", FileGuidString, BaseAddress);
fprintf (MapFile, " EntryPoint:%08lx", EntryPoint);
if (ImageContext.PdbPointer != NULL) {
fprintf (MapFile, " FileName: %s", ImageContext.PdbPointer);
}
@ -810,6 +816,8 @@ Returns:
//
PeHdr->FileHeader.SizeOfOptionalHeader = (UINT16) (TEImageHeader->StrippedSize - 0x40 - sizeof (UINT32) - sizeof (EFI_IMAGE_FILE_HEADER));
PeHdr->OptionalHeader.ImageBase = (UINTN) (TEImageHeader->ImageBase - TEImageHeader->StrippedSize + sizeof (EFI_TE_IMAGE_HEADER));
PeHdr->OptionalHeader.AddressOfEntryPoint = TEImageHeader->AddressOfEntryPoint;
PeHdr->OptionalHeader.BaseOfCode = TEImageHeader->BaseOfCode;
PeHdr->OptionalHeader.SizeOfImage = Pe32ImageSize;
PeHdr->OptionalHeader.Subsystem = TEImageHeader->Subsystem;
PeHdr->OptionalHeader.SizeOfImage = Pe32ImageSize;
@ -942,12 +950,18 @@ Returns:
sizeof (EFI_TE_IMAGE_HEADER)
);
//
// Get EntryPoint in Flash Region.
//
EntryPoint = NewPe32BaseAddress + EntryPoint - ImageAddress;
//
// If a map file was selected output mapping information for any file that
// was rebased.
//
if (MapFile != NULL) {
fprintf (MapFile, "TE File: %s Base:%08lx", FileGuidString, BaseAddress);
fprintf (MapFile, " EntryPoint:%08lx", EntryPoint);
if (ImageContext.PdbPointer != NULL) {
fprintf (MapFile, " FileName: %s", ImageContext.PdbPointer);
}