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 #define EFI_SPECIFICATION_VERSION 0x00000000
26 #define EDK_RELEASE_VERSION 0x00020000
28 #include <Library/PeCoffLib.h>
29 #include <Library/BaseMemoryLib.h>
35 PeCoffLoaderRelocateImageEx (
38 IN OUT CHAR8
**FixupData
,
44 Performs an x64 specific relocation fixup
47 Reloc - Pointer to the relocation record
48 Fixup - Pointer to the address to fix up
49 FixupData - Pointer to a buffer to log the fixups
50 Adjust - The offset to adjust the fixup
59 switch ((*Reloc
) >> 12) {
61 case EFI_IMAGE_REL_BASED_DIR64
:
62 F64
= (UINT64
*) Fixup
;
63 *F64
= *F64
+ (UINT64
) Adjust
;
64 if (*FixupData
!= NULL
) {
65 *FixupData
= ALIGN_POINTER(*FixupData
, sizeof(UINT64
));
66 *(UINT64
*)(*FixupData
) = *F64
;
67 *FixupData
= *FixupData
+ sizeof(UINT64
);
72 return RETURN_UNSUPPORTED
;
75 return RETURN_SUCCESS
;