summaryrefslogtreecommitdiff
path: root/MdePkg/Library/BasePeCoffLib
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library/BasePeCoffLib')
-rw-r--r--MdePkg/Library/BasePeCoffLib/BasePeCoff.c37
-rw-r--r--MdePkg/Library/BasePeCoffLib/PeCoffLoaderEx.c15
2 files changed, 33 insertions, 19 deletions
diff --git a/MdePkg/Library/BasePeCoffLib/BasePeCoff.c b/MdePkg/Library/BasePeCoffLib/BasePeCoff.c
index 181c87847a..60f0470319 100644
--- a/MdePkg/Library/BasePeCoffLib/BasePeCoff.c
+++ b/MdePkg/Library/BasePeCoffLib/BasePeCoff.c
@@ -195,7 +195,7 @@ PeCoffLoaderGetPeHeader (
RETURN_STATUS
EFIAPI
PeCoffLoaderGetImageInfo (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
+ IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
)
{
RETURN_STATUS Status;
@@ -487,6 +487,12 @@ PeCoffLoaderImageAddress (
ImageContext as the relocation base address. Otherwise, use the DestinationAddress field
of ImageContext as the relocation base address. The caller must allocate the relocation
fixup log buffer and fill in the FixupData field of ImageContext prior to calling this function.
+
+ The ImageRead, Handle, PeCoffHeaderOffset, IsTeImage, Machine, ImageType, ImageAddress,
+ ImageSize, DestinationAddress, RelocationsStripped, SectionAlignment, SizeOfHeaders,
+ DebugDirectoryEntryRva, EntryPoint, FixupDataSize, CodeView, PdbPointer, and FixupData of
+ the ImageContext structure must be valid prior to invoking this service.
+
If ImageContext is NULL, then ASSERT().
@param ImageContext Pointer to the image context structure that describes the PE/COFF
@@ -725,6 +731,10 @@ PeCoffLoaderRelocateImage (
specified by the ImageAddress and ImageSize fields of ImageContext. The caller must allocate
the load buffer and fill in the ImageAddress and ImageSize fields prior to calling this function.
The EntryPoint, FixupDataSize, CodeView, and PdbPointer fields of ImageContext are computed.
+ The ImageRead, Handle, PeCoffHeaderOffset, IsTeImage, Machine, ImageType, ImageAddress, ImageSize,
+ DestinationAddress, RelocationsStripped, SectionAlignment, SizeOfHeaders, and DebugDirectoryEntryRva
+ fields of the ImageContext structure must be valid prior to invoking this service.
+
If ImageContext is NULL, then ASSERT().
@param ImageContext Pointer to the image context structure that describes the PE/COFF
@@ -1117,17 +1127,20 @@ PeCoffLoaderLoadImage (
/**
Reapply fixups on a fixed up PE32/PE32+ image to allow virutal calling at EFI
- runtime.
-
+ runtime.
+
PE_COFF_LOADER_IMAGE_CONTEXT.FixupData stores information needed to reapply
the fixups with a virtual mapping.
- @param ImageBase Base address of relocated image
- @param VirtImageBase Virtual mapping for ImageBase
- @param ImageSize Size of the image to relocate
- @param RelocationData Location to place results of read
-
+ @param ImageBase Base address of a PE/COFF image that has been loaded
+ and relocated into system memory.
+ @param VirtImageBase The request virtual address that the PE/COFF image is to
+ be fixed up for.
+ @param ImageSize The size, in bytes, of the PE/COFF image.
+ @param RelocationData A pointer to the relocation data that was collected when the PE/COFF
+ image was relocated using PeCoffLoaderRelocateImage().
+
**/
VOID
EFIAPI
@@ -1360,11 +1373,15 @@ PeCoffLoaderImageReadFromMemory (
/**
Unloads a loaded PE/COFF image from memory and releases its taken resource.
-
+ Releases any environment specific resources that were allocated when the image
+ specified by ImageContext was loaded using PeCoffLoaderLoadImage().
+
For NT32 emulator, the PE/COFF image loaded by system needs to release.
For real platform, the PE/COFF image loaded by Core doesn't needs to be unloaded,
this function can simply return RETURN_SUCCESS.
-
+
+ If ImageContext is NULL, then ASSERT().
+
@param ImageContext Pointer to the image context structure that describes the PE/COFF
image to be unloaded.
diff --git a/MdePkg/Library/BasePeCoffLib/PeCoffLoaderEx.c b/MdePkg/Library/BasePeCoffLib/PeCoffLoaderEx.c
index 4014c16bab..6913a87e81 100644
--- a/MdePkg/Library/BasePeCoffLib/PeCoffLoaderEx.c
+++ b/MdePkg/Library/BasePeCoffLib/PeCoffLoaderEx.c
@@ -16,14 +16,15 @@
/**
- Performs an IA-32 specific relocation fixup.
+ Performs an Itanium-based specific relocation fixup and is a no-op on other
+ instruction sets.
@param Reloc Pointer to the relocation record.
@param Fixup Pointer to the address to fix up.
@param FixupData Pointer to a buffer to log the fixups.
@param Adjust The offset to adjust the fixup.
- @retval EFI_UNSUPPORTED Unsupported now.
+ @return Status code.
**/
RETURN_STATUS
@@ -38,14 +39,10 @@ PeCoffLoaderRelocateImageEx (
}
/**
- Returns TRUE if the machine type of PE/COFF image is supported. Supported
+ Returns TRUE if the machine type of PE/COFF image is supported. Supported
does not mean the image can be executed it means the PE/COFF loader supports
loading and relocating of the image type. It's up to the caller to support
- the entry point.
-
- This function implies the basic PE/COFF loader/relocator supports IA32, EBC,
- & x64 images. Calling the entry point in a correct mannor is up to the
- consumer of this library.
+ the entry point.
@param Machine Machine type from the PE Header.
@@ -75,7 +72,7 @@ PeCoffLoaderImageFormatSupported (
@param FixupData Pointer to a buffer to log the fixups.
@param Adjust The offset to adjust the fixup.
- @return Always return UNSUPPORTED.
+ @return Status code.
**/
RETURN_STATUS