Currently, if elf2efi.c is compiled using a 32-bit HOST_CC, then the resulting elf2efi64 binary will generate 32-bit EFI binaries instead of 64-bit EFI binaries. The problem is that elf2efi.c uses the MDE_CPU_* definitions to decide whether to output a 32-bit or 64-bit PE binary. However, MDE_CPU_* gets defined in ProcessorBind.h, depending on the compiler's target architecture. Overriding them on the command line doesn't work in the expected way, and you can end up in cases where both MDE_CPU_IA32 and MDE_CPU_X64 are defined. Fix by using a separate definition, EFI_TARGET_IA32/EFI_TARGET_X64, which is specified only on the command line. Signed-off-by: Geoff Lywood <glywood@vmware.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>tags/v1.20.1
|
|
||
907 |
|
907 |
|
908 |
|
908 |
|
909 |
|
909 |
|
910 |
|
|
|
|
910 |
|
|
911 |
|
911 |
|
912 |
|
912 |
|
913 |
|
913 |
|
914 |
|
914 |
|
915 |
|
|
|
|
915 |
|
|
916 |
|
916 |
|
917 |
|
917 |
|
918 |
|
918 |
|
|
|
||
52 |
|
52 |
|
53 |
|
53 |
|
54 |
|
54 |
|
55 |
|
|
|
|
55 |
|
|
56 |
|
56 |
|
57 |
|
|
|
|
57 |
|
|
58 |
|
58 |
|
59 |
|
59 |
|
60 |
|
60 |
|
|
|
||
67 |
|
67 |
|
68 |
|
68 |
|
69 |
|
69 |
|
70 |
|
|
|
|
70 |
|
|
71 |
|
71 |
|
72 |
|
|
|
|
72 |
|
|
73 |
|
73 |
|
74 |
|
74 |
|
75 |
|
75 |
|
76 |
|
76 |
|
77 |
|
77 |
|
78 |
|
78 |
|
79 |
|
|
|
|
79 |
|
|
80 |
|
80 |
|
81 |
|
81 |
|
82 |
|
82 |
|
83 |
|
83 |
|
84 |
|
84 |
|
85 |
|
|
|
|
85 |
|
|
86 |
|
86 |
|
87 |
|
|
|
|
87 |
|
|
88 |
|
88 |
|
89 |
|
89 |
|
90 |
|
90 |
|
|
|
||
345 |
|
345 |
|
346 |
|
346 |
|
347 |
|
347 |
|
348 |
|
|
|
|
348 |
|
|
349 |
|
349 |
|
350 |
|
|
|
|
350 |
|
|
351 |
|
351 |
|
352 |
|
352 |
|
353 |
|
353 |
|
|
|
||
434 |
|
434 |
|
435 |
|
435 |
|
436 |
|
436 |
|
437 |
|
|
|
|
437 |
|
|
438 |
|
438 |
|
439 |
|
439 |
|
440 |
|
440 |
|