From c0351cfecaa19d9e3384fd7180c621ec1ace4caa Mon Sep 17 00:00:00 2001 From: andrewfish Date: Thu, 5 Aug 2010 17:08:14 +0000 Subject: Fix crash in UnixPkg caused by r10769. The DxeCore is not calling the library constructor, but is calling the library members that are coded to assume the constructor has run. Check to make sure constructor has run before using services. If Dxe Core starts calling library constructor then this code will just work, but it may cause an issue with the extra call to load symbols, since we catch the symbol load in DxeIpl. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10774 6f19259b-4bc3-4df7-8a09-765794883524 --- .../DxeUnixPeCoffExtraActionLib/DxeUnixPeCoffExtraActionLib.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'UnixPkg/Library/DxeUnixPeCoffExtraActionLib/DxeUnixPeCoffExtraActionLib.c') diff --git a/UnixPkg/Library/DxeUnixPeCoffExtraActionLib/DxeUnixPeCoffExtraActionLib.c b/UnixPkg/Library/DxeUnixPeCoffExtraActionLib/DxeUnixPeCoffExtraActionLib.c index e04e580f6c..68bd7f84e2 100644 --- a/UnixPkg/Library/DxeUnixPeCoffExtraActionLib/DxeUnixPeCoffExtraActionLib.c +++ b/UnixPkg/Library/DxeUnixPeCoffExtraActionLib/DxeUnixPeCoffExtraActionLib.c @@ -84,8 +84,10 @@ PeCoffLoaderRelocateImageExtraAction ( IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext ) { - mUnix->PeCoffRelocateImageExtraAction (ImageContext); + if (mUnix != NULL) { + mUnix->PeCoffRelocateImageExtraAction (ImageContext); } +} @@ -105,5 +107,7 @@ PeCoffLoaderUnloadImageExtraAction ( IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext ) { - mUnix->PeCoffUnloadImageExtraAction (ImageContext); + if (mUnix != NULL) { + mUnix->PeCoffUnloadImageExtraAction (ImageContext); + } } -- cgit v1.2.3