2 x64 Specific relocation fixups.
4 Copyright (c) 2006, Intel Corporation
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.
13 Module Name: PeCoffLoaderEx.c
21 Performs an x64 specific relocation fixup.
23 @param Reloc Pointer to the relocation record
24 @param Fixup Pointer to the address to fix up
25 @param FixupData Pointer to a buffer to log the fixups
26 @param Adjust The offset to adjust the fixup
30 PeCoffLoaderRelocateImageEx (
33 IN OUT CHAR8
**FixupData
,
39 switch ((*Reloc
) >> 12) {
41 case EFI_IMAGE_REL_BASED_DIR64
:
42 F64
= (UINT64
*) Fixup
;
43 *F64
= *F64
+ (UINT64
) Adjust
;
44 if (*FixupData
!= NULL
) {
45 *FixupData
= ALIGN_POINTER(*FixupData
, sizeof(UINT64
));
46 *(UINT64
*)(*FixupData
) = *F64
;
47 *FixupData
= *FixupData
+ sizeof(UINT64
);
52 return RETURN_UNSUPPORTED
;
55 return RETURN_SUCCESS
;