]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BasePeCoffLib/x64/PeCoffLoaderEx.c
Replace the original Fat.FFS to fix issue which causes to read some hard-disk slowly.
[mirror_edk2.git] / MdePkg / Library / BasePeCoffLib / x64 / PeCoffLoaderEx.c
CommitLineData
878ddf1f 1/** @file\r
2 x64 Specific relocation fixups.\r
3\r
4 Copyright (c) 2006, Intel Corporation\r
5 All rights reserved. This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13 Module Name: PeCoffLoaderEx.c\r
14\r
15**/\r
16\r
878ddf1f 17/**\r
18 Performs an x64 specific relocation fixup.\r
19\r
4ba61e5e 20 @param Reloc Pointer to the relocation record\r
21 @param Fixup Pointer to the address to fix up\r
22 @param FixupData Pointer to a buffer to log the fixups\r
23 @param Adjust The offset to adjust the fixup\r
878ddf1f 24\r
25**/\r
26RETURN_STATUS\r
27PeCoffLoaderRelocateImageEx (\r
28 IN UINT16 *Reloc,\r
29 IN OUT CHAR8 *Fixup, \r
30 IN OUT CHAR8 **FixupData,\r
31 IN UINT64 Adjust\r
32 )\r
33{\r
34 UINT64 *F64;\r
35\r
36 switch ((*Reloc) >> 12) {\r
37\r
38 case EFI_IMAGE_REL_BASED_DIR64:\r
39 F64 = (UINT64 *) Fixup;\r
40 *F64 = *F64 + (UINT64) Adjust;\r
41 if (*FixupData != NULL) {\r
42 *FixupData = ALIGN_POINTER(*FixupData, sizeof(UINT64));\r
43 *(UINT64 *)(*FixupData) = *F64;\r
44 *FixupData = *FixupData + sizeof(UINT64);\r
45 }\r
46 break;\r
47\r
48 default:\r
49 return RETURN_UNSUPPORTED;\r
50 }\r
51\r
52 return RETURN_SUCCESS;\r
53}\r