]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/Common/PeCoffLoaderEx.c
BaseTools: Fix compile error on VS2010
[mirror_edk2.git] / BaseTools / Source / C / Common / PeCoffLoaderEx.c
index 8d6b3961f5272243de53cfdc053ef0b566ce2102..d04fa7d5ba2da5551c051763dcf55a72d0a1c518 100644 (file)
@@ -1,6 +1,7 @@
 /** @file\r
+IA32, X64 and IPF Specific relocation fixups\r
 \r
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>\r
 Portions Copyright (c) 2011 - 2013, ARM Ltd. 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
@@ -10,16 +11,6 @@ http://opensource.org/licenses/bsd-license.php
 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
 \r
-Module Name:\r
-\r
-    PeCoffLoaderEx.c\r
-\r
-Abstract:\r
-\r
-    IA32, X64, IPF, ARM and AArch64 Specific relocation fixups\r
-\r
-Revision History\r
-\r
 --*/\r
 \r
 #include <Common/UefiBaseTypes.h>\r
@@ -142,16 +133,6 @@ Returns:
 \r
   switch ((*Reloc) >> 12) {\r
 \r
-    case EFI_IMAGE_REL_BASED_DIR64:\r
-      F64 = (UINT64 *) Fixup;\r
-      *F64 = *F64 + (UINT64) Adjust;\r
-      if (*FixupData != NULL) {\r
-        *FixupData = ALIGN_POINTER(*FixupData, sizeof(UINT64));\r
-        *(UINT64 *)(*FixupData) = *F64;\r
-        *FixupData = *FixupData + sizeof(UINT64);\r
-      }\r
-      break;\r
-\r
     case EFI_IMAGE_REL_BASED_IA64_IMM64:\r
 \r
       //\r
@@ -279,46 +260,6 @@ Returns:
   return RETURN_SUCCESS;\r
 }\r
 \r
-RETURN_STATUS\r
-PeCoffLoaderRelocateX64Image (\r
-  IN     UINT16       *Reloc,\r
-  IN OUT CHAR8        *Fixup, \r
-  IN OUT CHAR8        **FixupData,\r
-  IN     UINT64       Adjust\r
-  )\r
-/**\r
-  Performs an x64 specific relocation fixup\r
-\r
-  @param Reloc        Pointer to the relocation record\r
-  @param Fixup        Pointer to the address to fix up\r
-  @param FixupData    Pointer to a buffer to log the fixups\r
-  @param Adjust       The offset to adjust the fixup\r
-  \r
-  @retval RETURN_SUCCESS      Success to perform relocation\r
-  @retval RETURN_UNSUPPORTED  Unsupported.\r
-**/\r
-{\r
-  UINT64      *F64;\r
-\r
-  switch ((*Reloc) >> 12) {\r
-\r
-    case EFI_IMAGE_REL_BASED_DIR64:\r
-      F64 = (UINT64 *) Fixup;\r
-      *F64 = *F64 + (UINT64) Adjust;\r
-      if (*FixupData != NULL) {\r
-        *FixupData = ALIGN_POINTER(*FixupData, sizeof(UINT64));\r
-        *(UINT64 *)(*FixupData) = *F64;\r
-        *FixupData = *FixupData + sizeof(UINT64);\r
-      }\r
-      break;\r
-\r
-    default:\r
-      return RETURN_UNSUPPORTED;\r
-  }\r
-\r
-  return RETURN_SUCCESS;\r
-}\r
-\r
 /**\r
   Pass in a pointer to an ARM MOVT or MOVW immediate instruciton and \r
   return the immediate data encoded in the instruction\r
@@ -461,8 +402,8 @@ PeCoffLoaderRelocateArmImage (
     \r
     if (*FixupData != NULL) {\r
       *FixupData = ALIGN_POINTER(*FixupData, sizeof(UINT64));\r
-      *(UINT64 *)(*FixupData) = *Fixup16;\r
       CopyMem (*FixupData, Fixup16, sizeof (UINT64));\r
+      *FixupData = *FixupData + sizeof(UINT64);\r
     }\r
     break;\r
   \r
@@ -474,43 +415,3 @@ PeCoffLoaderRelocateArmImage (
 \r
   return RETURN_SUCCESS;\r
 }\r
-\r
-RETURN_STATUS\r
-PeCoffLoaderRelocateAArch64Image (\r
-  IN     UINT16       *Reloc,\r
-  IN OUT CHAR8        *Fixup,\r
-  IN OUT CHAR8        **FixupData,\r
-  IN     UINT64       Adjust\r
-  )\r
-/**\r
-  Performs an AArch64 specific relocation fixup\r
-\r
-  @param Reloc        Pointer to the relocation record\r
-  @param Fixup        Pointer to the address to fix up\r
-  @param FixupData    Pointer to a buffer to log the fixups\r
-  @param Adjust       The offset to adjust the fixup\r
-\r
-  @retval RETURN_SUCCESS      Success to perform relocation\r
-  @retval RETURN_UNSUPPORTED  Unsupported.\r
-**/\r
-{\r
-  UINT64      *F64;\r
-\r
-  switch ((*Reloc) >> 12) {\r
-\r
-    case EFI_IMAGE_REL_BASED_DIR64:\r
-      F64 = (UINT64 *) Fixup;\r
-      *F64 = *F64 + (UINT64) Adjust;\r
-      if (*FixupData != NULL) {\r
-        *FixupData = ALIGN_POINTER(*FixupData, sizeof(UINT64));\r
-        *(UINT64 *)(*FixupData) = *F64;\r
-        *FixupData = *FixupData + sizeof(UINT64);\r
-      }\r
-      break;\r
-\r
-    default:\r
-      return RETURN_UNSUPPORTED;\r
-  }\r
-\r
-  return RETURN_SUCCESS;\r
-}\r