X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=BaseTools%2FSource%2FC%2FCommon%2FBasePeCoff.c;h=816f309f66a7041462fded0b1ba444abd6177263;hb=0d2711a69397d2971079121df4326d84736c181e;hp=54bd099e1d819e41fdfb102cc2d384e3b89bf038;hpb=421fb3b504cfe18033c49a40fcd46bab45a0fb50;p=mirror_edk2.git diff --git a/BaseTools/Source/C/Common/BasePeCoff.c b/BaseTools/Source/C/Common/BasePeCoff.c index 54bd099e1d..816f309f66 100644 --- a/BaseTools/Source/C/Common/BasePeCoff.c +++ b/BaseTools/Source/C/Common/BasePeCoff.c @@ -979,6 +979,7 @@ Returns: ImageContext, Section->VirtualAddress + Section->Misc.VirtualSize - 1 ); + // // If the base start or end address resolved to 0, then fail. // @@ -987,6 +988,7 @@ Returns: return RETURN_LOAD_ERROR; } + if (ImageContext->IsTeImage) { Base = (CHAR8 *) ((UINTN) Base + sizeof (EFI_TE_IMAGE_HEADER) - (UINTN) TeHdr->StrippedSize); End = (CHAR8 *) ((UINTN) End + sizeof (EFI_TE_IMAGE_HEADER) - (UINTN) TeHdr->StrippedSize);