riscv: Fix efi header size for RV32

This patch depends on Atish's patch.
(https://patchwork.ozlabs.org/project/uboot/patch/20201013192331.3236458-1-atish.patra@wdc.com/)

Modify the size of the Optional Header "Windows-Specific Fields" to fit with the specification.
(https://docs.microsoft.com/en-us/windows/win32/debug/pe-format)

Signed-off-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Cc: rick@andestech.com
Cc: alankao@andestech.com
Cc: atish.patra@wdc.com
Cc: xypron.glpk@gmx.de
Cc: bmeng.cn@gmail.com
This commit is contained in:
Leo Yu-Chi Liang 2020-11-12 10:09:52 +08:00 committed by Andes
parent 84c3db2ea3
commit 9ea6952a9a

View File

@ -50,7 +50,7 @@ coff_header:
IMAGE_FILE_LOCAL_SYMS_STRIPPED | \
IMAGE_FILE_DEBUG_STRIPPED)
optional_header:
.short PE_MAGIC /* PE32+ format */
.short PE_MAGIC /* PE32(+) format */
.byte 0x02 /* MajorLinkerVersion */
.byte 0x14 /* MinorLinkerVersion */
.long _edata - _start /* SizeOfCode */
@ -63,7 +63,11 @@ optional_header:
#endif
extra_header_fields:
#if __riscv_xlen == 32
.long 0 /* ImageBase */
#else
.quad 0 /* ImageBase */
#endif
.long 0x20 /* SectionAlignment */
.long 0x8 /* FileAlignment */
.short 0 /* MajorOperatingSystemVersion */
@ -83,10 +87,17 @@ extra_header_fields:
.long 0 /* CheckSum */
.short IMAGE_SUBSYSTEM_EFI_APPLICATION /* Subsystem */
.short 0 /* DllCharacteristics */
#if __riscv_xlen == 32
.long 0 /* SizeOfStackReserve */
.long 0 /* SizeOfStackCommit */
.long 0 /* SizeOfHeapReserve */
.long 0 /* SizeOfHeapCommit */
#else
.quad 0 /* SizeOfStackReserve */
.quad 0 /* SizeOfStackCommit */
.quad 0 /* SizeOfHeapReserve */
.quad 0 /* SizeOfHeapCommit */
#endif
.long 0 /* LoaderFlags */
.long 0x6 /* NumberOfRvaAndSizes */