From 9626a87e43394aa49a6d077d161428646b84dec3 Mon Sep 17 00:00:00 2001 From: lgao4 Date: Fri, 26 Oct 2007 09:28:29 +0000 Subject: Add one judge whether TeImage or PeImage has reloc section when relocate TeImage or PeImage into memory. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4224 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Library/BasePeCoffLib/BasePeCoff.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'MdePkg') diff --git a/MdePkg/Library/BasePeCoffLib/BasePeCoff.c b/MdePkg/Library/BasePeCoffLib/BasePeCoff.c index fb78aefb8c..dbdb5ab869 100644 --- a/MdePkg/Library/BasePeCoffLib/BasePeCoff.c +++ b/MdePkg/Library/BasePeCoffLib/BasePeCoff.c @@ -271,6 +271,8 @@ PeCoffLoaderGetImageInfo ( // if ((!(ImageContext->IsTeImage)) && ((Hdr.Pe32->FileHeader.Characteristics & EFI_IMAGE_FILE_RELOCS_STRIPPED) != 0)) { ImageContext->RelocationsStripped = TRUE; + } else if ((ImageContext->IsTeImage) && (Hdr.Te->DataDirectory[0].Size == 0) && (Hdr.Te->DataDirectory[0].VirtualAddress == 0)) { + ImageContext->RelocationsStripped = TRUE; } else { ImageContext->RelocationsStripped = FALSE; } -- cgit v1.2.3