3 Copyright 2005, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 x64 Specific relocation fixups
25 #include <Common/UefiBaseTypes.h>
26 #include <Common/EfiImage.h>
27 #include <Library/PeCoffLib.h>
33 PeCoffLoaderRelocateImageEx (
36 IN OUT CHAR8
**FixupData
,
42 Performs an x64 specific relocation fixup
45 Reloc - Pointer to the relocation record
46 Fixup - Pointer to the address to fix up
47 FixupData - Pointer to a buffer to log the fixups
48 Adjust - The offset to adjust the fixup
57 switch ((*Reloc
) >> 12) {
59 case EFI_IMAGE_REL_BASED_DIR64
:
60 F64
= (UINT64
*) Fixup
;
61 *F64
= *F64
+ (UINT64
) Adjust
;
62 if (*FixupData
!= NULL
) {
63 *FixupData
= ALIGN_POINTER(*FixupData
, sizeof(UINT64
));
64 *(UINT64
*)(*FixupData
) = *F64
;
65 *FixupData
= *FixupData
+ sizeof(UINT64
);
70 return RETURN_UNSUPPORTED
;
73 return RETURN_SUCCESS
;