|
@@ -52,9 +52,9 @@ struct pe_relocs {
|
52
|
52
|
struct pe_header {
|
53
|
53
|
EFI_IMAGE_DOS_HEADER dos;
|
54
|
54
|
uint8_t padding[128];
|
55
|
|
-#if defined(MDE_CPU_IA32)
|
|
55
|
+#if defined(EFI_TARGET_IA32)
|
56
|
56
|
EFI_IMAGE_NT_HEADERS32 nt;
|
57
|
|
-#elif defined(MDE_CPU_X64)
|
|
57
|
+#elif defined(EFI_TARGET_X64)
|
58
|
58
|
EFI_IMAGE_NT_HEADERS64 nt;
|
59
|
59
|
#endif
|
60
|
60
|
};
|
|
@@ -67,24 +67,24 @@ static struct pe_header efi_pe_header = {
|
67
|
67
|
.nt = {
|
68
|
68
|
.Signature = EFI_IMAGE_NT_SIGNATURE,
|
69
|
69
|
.FileHeader = {
|
70
|
|
-#if defined(MDE_CPU_IA32)
|
|
70
|
+#if defined(EFI_TARGET_IA32)
|
71
|
71
|
.Machine = EFI_IMAGE_MACHINE_IA32,
|
72
|
|
-#elif defined(MDE_CPU_X64)
|
|
72
|
+#elif defined(EFI_TARGET_X64)
|
73
|
73
|
.Machine = EFI_IMAGE_MACHINE_X64,
|
74
|
74
|
#endif
|
75
|
75
|
.TimeDateStamp = 0x10d1a884,
|
76
|
76
|
.SizeOfOptionalHeader =
|
77
|
77
|
sizeof ( efi_pe_header.nt.OptionalHeader ),
|
78
|
78
|
.Characteristics = ( EFI_IMAGE_FILE_DLL |
|
79
|
|
-#if defined(MDE_CPU_IA32)
|
|
79
|
+#if defined(EFI_TARGET_IA32)
|
80
|
80
|
EFI_IMAGE_FILE_32BIT_MACHINE |
|
81
|
81
|
#endif
|
82
|
82
|
EFI_IMAGE_FILE_EXECUTABLE_IMAGE ),
|
83
|
83
|
},
|
84
|
84
|
.OptionalHeader = {
|
85
|
|
-#if defined(MDE_CPU_IA32)
|
|
85
|
+#if defined(EFI_TARGET_IA32)
|
86
|
86
|
.Magic = EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC,
|
87
|
|
-#elif defined(MDE_CPU_X64)
|
|
87
|
+#elif defined(EFI_TARGET_X64)
|
88
|
88
|
.Magic = EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC,
|
89
|
89
|
#endif
|
90
|
90
|
.SectionAlignment = EFI_FILE_ALIGN,
|
|
@@ -345,9 +345,9 @@ static struct pe_section * process_section ( bfd *bfd,
|
345
|
345
|
/* Extract current RVA limits from file header */
|
346
|
346
|
code_start = pe_header->nt.OptionalHeader.BaseOfCode;
|
347
|
347
|
code_end = ( code_start + pe_header->nt.OptionalHeader.SizeOfCode );
|
348
|
|
-#if defined(MDE_CPU_IA32)
|
|
348
|
+#if defined(EFI_TARGET_IA32)
|
349
|
349
|
data_start = pe_header->nt.OptionalHeader.BaseOfData;
|
350
|
|
-#elif defined(MDE_CPU_X64)
|
|
350
|
+#elif defined(EFI_TARGET_X64)
|
351
|
351
|
data_start = code_end;
|
352
|
352
|
#endif
|
353
|
353
|
data_mid = ( data_start +
|
|
@@ -434,7 +434,7 @@ static struct pe_section * process_section ( bfd *bfd,
|
434
|
434
|
/* Write RVA limits back to file header */
|
435
|
435
|
pe_header->nt.OptionalHeader.BaseOfCode = code_start;
|
436
|
436
|
pe_header->nt.OptionalHeader.SizeOfCode = ( code_end - code_start );
|
437
|
|
-#if defined(MDE_CPU_IA32)
|
|
437
|
+#if defined(EFI_TARGET_IA32)
|
438
|
438
|
pe_header->nt.OptionalHeader.BaseOfData = data_start;
|
439
|
439
|
#endif
|
440
|
440
|
pe_header->nt.OptionalHeader.SizeOfInitializedData =
|