summaryrefslogtreecommitdiff
path: root/UnixPkg/Library/DxeUnixPeCoffExtraActionLib
diff options
context:
space:
mode:
Diffstat (limited to 'UnixPkg/Library/DxeUnixPeCoffExtraActionLib')
-rw-r--r--UnixPkg/Library/DxeUnixPeCoffExtraActionLib/DxeUnixPeCoffExtraActionLib.c39
-rw-r--r--UnixPkg/Library/DxeUnixPeCoffExtraActionLib/DxeUnixPeCoffExtraActionLib.inf4
2 files changed, 9 insertions, 34 deletions
diff --git a/UnixPkg/Library/DxeUnixPeCoffExtraActionLib/DxeUnixPeCoffExtraActionLib.c b/UnixPkg/Library/DxeUnixPeCoffExtraActionLib/DxeUnixPeCoffExtraActionLib.c
index 014390c..b700975 100644
--- a/UnixPkg/Library/DxeUnixPeCoffExtraActionLib/DxeUnixPeCoffExtraActionLib.c
+++ b/UnixPkg/Library/DxeUnixPeCoffExtraActionLib/DxeUnixPeCoffExtraActionLib.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
@@ -22,12 +23,10 @@ Abstract:
**/
-#include <FrameworkDxe.h>
-#include <Guid/StatusCodeDataTypeId.h>
+#include <PiDxe.h>
#include <UnixDxe.h>
#include <Library/PeCoffLib.h>
-
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/HobLib.h>
@@ -35,9 +34,12 @@ Abstract:
#include <Library/PeCoffExtraActionLib.h>
//
+
// Cache of UnixThunk protocol
+
//
-EFI_UNIX_THUNK_PROTOCOL *mUnix;
+
+EFI_UNIX_THUNK_PROTOCOL *mUnix = NULL;
/**
@@ -82,35 +84,10 @@ PeCoffLoaderRelocateImageExtraAction (
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
)
{
- VOID * Handle;
- VOID * Entry;
-
- ASSERT (ImageContext != NULL);
-
- Handle = NULL;
- Entry = NULL;
-
- 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()));
- }
-
- if (Entry != NULL) {
- ImageContext->EntryPoint = Entry;
- DEBUG ((EFI_D_ERROR, "Change %a Entrypoint to :0x%08lx\n", ImageContext->PdbPointer, Entry));
+ mUnix->PeCoffRelocateImageExtraAction (ImageContext);
}
- return;
- }
/**
Performs additional actions just before a PE/COFF image is unloaded. Any resources
@@ -128,5 +105,5 @@ PeCoffLoaderUnloadImageExtraAction (
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
)
{
- ASSERT (ImageContext != NULL);
+ mUnix->PeCoffUnloadImageExtraAction (ImageContext);
}
diff --git a/UnixPkg/Library/DxeUnixPeCoffExtraActionLib/DxeUnixPeCoffExtraActionLib.inf b/UnixPkg/Library/DxeUnixPeCoffExtraActionLib/DxeUnixPeCoffExtraActionLib.inf
index 93c5146..83d6963 100644
--- a/UnixPkg/Library/DxeUnixPeCoffExtraActionLib/DxeUnixPeCoffExtraActionLib.inf
+++ b/UnixPkg/Library/DxeUnixPeCoffExtraActionLib/DxeUnixPeCoffExtraActionLib.inf
@@ -2,7 +2,7 @@
# PeCoff extra action libary for DXE 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
@@ -39,8 +39,6 @@
[Packages]
UnixPkg/UnixPkg.dec
MdePkg/MdePkg.dec
- IntelFrameworkPkg/IntelFrameworkPkg.dec
- IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
[LibraryClasses]
DebugLib