summaryrefslogtreecommitdiff
path: root/UnixPkg/Library/PeiUnixPeCoffExtraActionLib
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2009-08-25 07:29:13 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2009-08-25 07:29:13 +0000
commitccd55824e79865a04b1c872bda4af0f1de1f50be (patch)
treee67acf21c32a61eeaebf1f28d87df97732b80187 /UnixPkg/Library/PeiUnixPeCoffExtraActionLib
parent7f22d35110e43be45a0e16a2e944feebbf51e4ed (diff)
downloadedk2-platforms-ccd55824e79865a04b1c872bda4af0f1de1f50be.tar.xz
Integrate patch from Andrew Fish to make it run on OS X.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9194 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'UnixPkg/Library/PeiUnixPeCoffExtraActionLib')
-rw-r--r--UnixPkg/Library/PeiUnixPeCoffExtraActionLib/PeiUnixPeCoffExtraActionLib.c36
-rw-r--r--UnixPkg/Library/PeiUnixPeCoffExtraActionLib/PeiUnixPeCoffExtraActionLib.inf4
2 files changed, 8 insertions, 32 deletions
diff --git a/UnixPkg/Library/PeiUnixPeCoffExtraActionLib/PeiUnixPeCoffExtraActionLib.c b/UnixPkg/Library/PeiUnixPeCoffExtraActionLib/PeiUnixPeCoffExtraActionLib.c
index 3b2af0301b..dea03fb142 100644
--- a/UnixPkg/Library/PeiUnixPeCoffExtraActionLib/PeiUnixPeCoffExtraActionLib.c
+++ b/UnixPkg/Library/PeiUnixPeCoffExtraActionLib/PeiUnixPeCoffExtraActionLib.c
@@ -1,6 +1,7 @@
/**@file
Copyright (c) 2006 - 2009, Intel Corporation
+Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -36,7 +37,7 @@ Abstract:
EFI_UNIX_THUNK_PROTOCOL *mUnix = NULL;
/**
- The function caches the pointer of the WinNT thunk functions
+ The function caches the pointer of the Unix thunk functions
It will ASSERT() if Unix thunk ppi is not installed.
@retval EFI_SUCCESS WinNT thunk protocol is found and cached.
@@ -83,38 +84,12 @@ PeCoffLoaderRelocateImageExtraAction (
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
)
{
- VOID * Handle;
- VOID * Entry;
-
- ASSERT (ImageContext != NULL);
-
- Handle = NULL;
- Entry = NULL;
-
if (mUnix == NULL) {
UnixPeCoffGetUnixThunkStucture ();
}
- DEBUG ((EFI_D_ERROR, "Loading %a 0x%08lx - entry point 0x%08lx\n",
- ImageContext->PdbPointer,
- (UINTN)ImageContext->ImageAddress,
- (UINTN)ImageContext->EntryPoint));
-
- Handle = mUnix->Dlopen (ImageContext->PdbPointer, RTLD_NOW);
-
- if (Handle) {
- Entry = mUnix->Dlsym(Handle, "_ModuleEntryPoint");
- } else {
- DEBUG ((EFI_D_ERROR, "%a\n", mUnix->Dlerror()));
+ mUnix->PeCoffRelocateImageExtraAction (ImageContext);
}
-
- if (Entry != NULL) {
- ImageContext->EntryPoint = Entry;
- DEBUG ((EFI_D_ERROR, "Change %a Entrypoint to :0x%08lx\n", ImageContext->PdbPointer, Entry));
- }
-
- return;
- }
/**
Performs additional actions just before a PE/COFF image is unloaded. Any resources
@@ -132,5 +107,8 @@ PeCoffLoaderUnloadImageExtraAction (
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
)
{
- ASSERT (ImageContext != NULL);
+ if (mUnix == NULL) {
+ UnixPeCoffGetUnixThunkStucture ();
+ }
+ mUnix->PeCoffUnloadImageExtraAction (ImageContext);
}
diff --git a/UnixPkg/Library/PeiUnixPeCoffExtraActionLib/PeiUnixPeCoffExtraActionLib.inf b/UnixPkg/Library/PeiUnixPeCoffExtraActionLib/PeiUnixPeCoffExtraActionLib.inf
index 1ecdd29681..722d586e17 100644
--- a/UnixPkg/Library/PeiUnixPeCoffExtraActionLib/PeiUnixPeCoffExtraActionLib.inf
+++ b/UnixPkg/Library/PeiUnixPeCoffExtraActionLib/PeiUnixPeCoffExtraActionLib.inf
@@ -2,7 +2,7 @@
# PeCoff extra action libary for Pei phase that run UNIX emulator.
#
# Lib to provide memory journal status code reporting Routines
-# Copyright (c) 2007, Intel Corporation
+# Copyright (c) 2007 - 2009, Intel Corporation
# All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -37,8 +37,6 @@
[Packages]
MdePkg/MdePkg.dec
UnixPkg/UnixPkg.dec
- IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
- IntelFrameworkPkg/IntelFrameworkPkg.dec
[LibraryClasses]
BaseLib