]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/PeCoffLoader.c
Update the copyright notice format
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / Pei / PeiLib / PeCoffLoader.c
index c276aa8bda1ec6be39228e0c56246644369fddba..68c4e96e8d1d59650ac8bf96ce1e88209f86e06c 100644 (file)
@@ -1,7 +1,7 @@
 /*++\r
 \r
-Copyright (c) 2005 - 2007, Intel Corporation                                                         \r
-All rights reserved. This program and the accompanying materials                          \r
+Copyright (c) 2005 - 2007, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
 http://opensource.org/licenses/bsd-license.php                                            \r
@@ -70,7 +70,7 @@ PeCoffLoaderLoadImage (
 EFI_STATUS\r
 EFIAPI\r
 PeCoffLoaderUnloadImage (\r
-  IN EFI_PEI_PE_COFF_LOADER_IMAGE_CONTEXT   *ImageContext\r
+  IN OUT EFI_PEI_PE_COFF_LOADER_IMAGE_CONTEXT   *ImageContext\r
   );\r
 \r
 #if defined (EFI_DEBUG_ITP_BREAK) && !defined (_CONSOLE)\r
@@ -434,7 +434,7 @@ Returns:
       ImageContext->ImageAddress = Hdr.Pe32Plus->OptionalHeader.ImageBase;\r
     }\r
   } else {\r
-    ImageContext->ImageAddress = (EFI_PHYSICAL_ADDRESS)(Hdr.Te->ImageBase);\r
+    ImageContext->ImageAddress = (EFI_PHYSICAL_ADDRESS)(Hdr.Te->ImageBase + Hdr.Te->StrippedSize - sizeof (EFI_TE_IMAGE_HEADER));\r
   }\r
 \r
   //\r
@@ -799,8 +799,8 @@ Returns:
     }\r
   } else {\r
     Hdr.Te             = (EFI_TE_IMAGE_HEADER *)(UINTN)(ImageContext->ImageAddress);\r
-    Adjust             = (UINT64) (BaseAddress - Hdr.Te->ImageBase);\r
-    Hdr.Te->ImageBase  = (UINT64) (BaseAddress);\r
+    Adjust             = (UINT64) (BaseAddress - Hdr.Te->StrippedSize + sizeof (EFI_TE_IMAGE_HEADER) - Hdr.Te->ImageBase);\r
+    Hdr.Te->ImageBase  = (UINT64) (BaseAddress - Hdr.Te->StrippedSize + sizeof (EFI_TE_IMAGE_HEADER));\r
 \r
     //\r
     // Find the relocation block\r
@@ -1357,7 +1357,7 @@ Returns:
 EFI_STATUS\r
 EFIAPI\r
 PeCoffLoaderUnloadImage (\r
-  IN EFI_PEI_PE_COFF_LOADER_IMAGE_CONTEXT   *ImageContext\r
+  IN OUT EFI_PEI_PE_COFF_LOADER_IMAGE_CONTEXT   *ImageContext\r
   )\r
 /*++\r
 \r