]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
efi_loader: set IMAGE_FILE_LARGE_ADDRESS_AWARE
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Fri, 23 Dec 2022 01:16:03 +0000 (02:16 +0100)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Thu, 29 Dec 2022 09:51:50 +0000 (10:51 +0100)
For the 64bit EFI binaries that we create set the
IMAGE_FILE_LARGE_ADDRESS_AWARE characteristic in the PE-COFF header
to indicate that they can handle addresses above 2 GiB.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
arch/arm/lib/crt0_aarch64_efi.S
arch/riscv/lib/crt0_riscv_efi.S

index 7f38465359c7d1f50641183b3b2a801619b85bd3..b4fc263adfb3034c9156eeefc500cc324751a489 100644 (file)
@@ -34,6 +34,7 @@ coff_header:
        .short  (IMAGE_FILE_EXECUTABLE_IMAGE | \
                 IMAGE_FILE_LINE_NUMS_STRIPPED | \
                 IMAGE_FILE_LOCAL_SYMS_STRIPPED | \
+                IMAGE_FILE_LARGE_ADDRESS_AWARE | \
                 IMAGE_FILE_DEBUG_STRIPPED)
 optional_header:
        .short  IMAGE_NT_OPTIONAL_HDR64_MAGIC   /* PE32+ format */
index a01e08a3c6d33fad37cdf8bad3584f619733a8a9..793eefdd8833a53f9c9ea3a94e52ae87cc4b88a5 100644 (file)
 #define LOAD_LONG(reg, idx)    ld      reg, (idx*SIZE_LONG)(sp)
 #define PE_MACHINE     IMAGE_FILE_MACHINE_RISCV64
 #define PE_MAGIC    IMAGE_NT_OPTIONAL_HDR64_MAGIC
+#define IMG_CHARACTERISTICS \
+       (IMAGE_FILE_EXECUTABLE_IMAGE | \
+        IMAGE_FILE_LINE_NUMS_STRIPPED | \
+        IMAGE_FILE_LOCAL_SYMS_STRIPPED | \
+        IMAGE_FILE_LARGE_ADDRESS_AWARE | \
+        IMAGE_FILE_DEBUG_STRIPPED)
 #else
 #define SIZE_LONG      4
 #define SAVE_LONG(reg, idx)    sw      reg, (idx*SIZE_LONG)(sp)
 #define LOAD_LONG(reg, idx)    lw      reg, (idx*SIZE_LONG)(sp)
 #define PE_MACHINE     IMAGE_FILE_MACHINE_RISCV32
 #define PE_MAGIC    IMAGE_NT_OPTIONAL_HDR32_MAGIC
+#define IMG_CHARACTERISTICS \
+       (IMAGE_FILE_EXECUTABLE_IMAGE | \
+        IMAGE_FILE_LINE_NUMS_STRIPPED | \
+        IMAGE_FILE_LOCAL_SYMS_STRIPPED | \
+        IMAGE_FILE_DEBUG_STRIPPED)
 #endif
 
 
@@ -47,11 +58,7 @@ coff_header:
        .long   0                               /* PointerToSymbolTable */
        .long   0                               /* NumberOfSymbols */
        .short  section_table - optional_header /* SizeOfOptionalHeader */
-       /* Characteristics */
-       .short  (IMAGE_FILE_EXECUTABLE_IMAGE | \
-                IMAGE_FILE_LINE_NUMS_STRIPPED | \
-                IMAGE_FILE_LOCAL_SYMS_STRIPPED | \
-                IMAGE_FILE_DEBUG_STRIPPED)
+       .short  IMG_CHARACTERISTICS             /* Characteristics */
 optional_header:
        .short  PE_MAGIC                        /* PE32(+) format */
        .byte   0x02                            /* MajorLinkerVersion */