I recently added an PeCoffLoaderRelocateImageExtraAction() and I got a GP
Fault. It turned out that my extra action lib was extracting information from
ImageContext and it dereferenced a pointer to non existent address,
ImageContext->CodeView was 0xb2bb748af8e9e02f. The problem was most of the
ImageContext structure was garbage, so you can only safely check for NULL
ImageContext.PdbPointer the other items are not safe to probe. So this forces
you to know this specific implementation in the DXE Core to write a
PeCoffLoaderRelocateImageExtraAction().
I think it would be better to ZeroMem (&ImageContext, sizeof (ImageContext));
so the other pointers/offsets in this structure are NULL/zero.
Thanks,
Andrew Fish
https://svn.code.sf.net/p/edk2/code/trunk/edk2/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
//
// Report DXE Core image information to the PE/COFF Extra Action Library
//
ImageContext.ImageAddress =
(EFI_PHYSICAL_ADDRESS)(UINTN)gDxeCoreLoadedImage->ImageBase;
ImageContext.PdbPointer = PeCoffLoaderGetPdbPointer ((VOID*) (UINTN)
ImageContext.ImageAddress);
PeCoffLoaderRelocateImageExtraAction (&ImageContext);
Contributed-under: TianoCore Contribution Agreement 1.0
------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel