summaryrefslogtreecommitdiff
path: root/UnixPkg/Sec/SecMain.c
diff options
context:
space:
mode:
Diffstat (limited to 'UnixPkg/Sec/SecMain.c')
-rw-r--r--UnixPkg/Sec/SecMain.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/UnixPkg/Sec/SecMain.c b/UnixPkg/Sec/SecMain.c
index a6da20b135..bfa44e7a17 100644
--- a/UnixPkg/Sec/SecMain.c
+++ b/UnixPkg/Sec/SecMain.c
@@ -983,6 +983,21 @@ SecNt32PeCoffRelocateImage (
(unsigned long)ImageContext->ImageAddress,
(unsigned long)ImageContext->EntryPoint);
+ Handle = dlopen(ImageContext->PdbPointer, RTLD_NOW);
+
+ if (Handle) {
+ Entry = dlsym(Handle, "_ModuleEntryPoint");
+ } else {
+ printf("%s\n", dlerror());
+ }
+
+ if (Entry != NULL) {
+ ImageContext->EntryPoint = Entry;
+ printf("Change %s Entrypoint to :0x%08lx\n", ImageContext->PdbPointer, Entry);
+ } else {
+ printf("Could not find _ModuleEntryPoint Entry, Module may be built error\n");
+ }
+
SecUnixLoaderBreak ();
return Status;