2 x64 Specific relocation fixups.
4 Copyright (c) 2005 - 2006 Intel Corporation. <BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #include <Common/UefiBaseTypes.h>
16 #include <Common/EfiImage.h>
17 #include <Library/PeCoffLib.h>
20 Performs an x64 specific relocation fixup
22 @param Reloc Pointer to the relocation record
23 @param Fixup Pointer to the address to fix up
24 @param FixupData Pointer to a buffer to log the fixups
25 @param Adjust The offset to adjust the fixup
27 @retval RETURN_SUCCESS Success to perform relocation
28 @retval RETURN_UNSUPPORTED Unsupported.
31 PeCoffLoaderRelocateImageEx (
34 IN OUT CHAR8
**FixupData
,
40 switch ((*Reloc
) >> 12) {
42 case EFI_IMAGE_REL_BASED_DIR64
:
43 F64
= (UINT64
*) Fixup
;
44 *F64
= *F64
+ (UINT64
) Adjust
;
45 if (*FixupData
!= NULL
) {
46 *FixupData
= ALIGN_POINTER(*FixupData
, sizeof(UINT64
));
47 *(UINT64
*)(*FixupData
) = *F64
;
48 *FixupData
= *FixupData
+ sizeof(UINT64
);
53 return RETURN_UNSUPPORTED
;
56 return RETURN_SUCCESS
;