Provide source level debug ability in *unix environment.
[Background] The UnixPkg provide an simulator in *unix. To support source level debug, we need force all modules be built as ELF shard objects and dynamically load all of modules using dlopen(). For peicore, peim and dxecore, we provide a wrapper to provide PeCoffLoader interface git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5382 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user