Correct TeImage file format and Clean up PeiRebase tool to remove unused code and only relocate image.
Move two EFI_DEP_REPLACE_TRUE and DEPEX_STACK_SIZE_INCREMENT macros from MdePkg to EdkModule/DxeMain module, because these two macros are specific implementation, not defined in spec. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2249 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -299,7 +299,7 @@ PeCoffLoaderGetImageInfo (
|
||||
ImageContext->ImageAddress = Hdr.Pe32Plus->OptionalHeader.ImageBase;
|
||||
}
|
||||
} else {
|
||||
ImageContext->ImageAddress = (PHYSICAL_ADDRESS)(Hdr.Te->ImageBase);
|
||||
ImageContext->ImageAddress = (PHYSICAL_ADDRESS)(Hdr.Te->ImageBase + sizeof (EFI_TE_IMAGE_HEADER) - Hdr.Te->StrippedSize);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -598,8 +598,11 @@ PeCoffLoaderRelocateImage (
|
||||
//
|
||||
if (ImageContext->DestinationAddress != 0) {
|
||||
BaseAddress = ImageContext->DestinationAddress;
|
||||
} else {
|
||||
} else if (!(ImageContext->IsTeImage)) {
|
||||
BaseAddress = ImageContext->ImageAddress;
|
||||
} else {
|
||||
Hdr.Te = (EFI_TE_IMAGE_HEADER *)(UINTN)(ImageContext->ImageAddress);
|
||||
BaseAddress = ImageContext->ImageAddress + sizeof (EFI_TE_IMAGE_HEADER) - Hdr.Te->StrippedSize;
|
||||
}
|
||||
|
||||
if (!(ImageContext->IsTeImage)) {
|
||||
|
Reference in New Issue
Block a user