public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH 1/1] riscv: revert Complete efi header for RV32/64
@ 2022-01-09 17:38 Heinrich Schuchardt
  2022-01-13  6:41 ` Leo Liang
  0 siblings, 1 reply; 2+ messages in thread
From: Heinrich Schuchardt @ 2022-01-09 17:38 UTC (permalink / raw)
  To: Rick Chen, Leo Yu-Chi Liang
  Cc: Atish Patra, Anup Patel, Alan Kao, Alexandre Ghiti, u-boot,
	Heinrich Schuchardt

EDK II refuses to load the EFI binaries created by U-Boot.
The reason is an incorrect PE-COFF header. The number of
data directories does not match NumberOfRvaAndSizes.
This leads to a failed consistency check in
PeCoffLoaderGetPeHeader():

    SizeOfOptionalHeader - HeaderWithoutDataDir) !=
    NumberOfRvaAndSizes * sizeof(DATA_DIRECTORY))

Fixes: 9afaeec6ef8b ("riscv: Complete efi header for RV32/64")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
 arch/riscv/lib/crt0_riscv_efi.S | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/arch/riscv/lib/crt0_riscv_efi.S b/arch/riscv/lib/crt0_riscv_efi.S
index b0a7a39a72..3e62e8e67b 100644
--- a/arch/riscv/lib/crt0_riscv_efi.S
+++ b/arch/riscv/lib/crt0_riscv_efi.S
@@ -110,16 +110,6 @@ extra_header_fields:
 	.quad	0				/* ExceptionTable */
 	.quad	0				/* CertificationTable */
 	.quad	0				/* BaseRelocationTable */
-	.quad	0				/* Debug */
-	.quad	0				/* Architecture */
-	.quad	0				/* Global Ptr */
-	.quad	0				/* TLS Table */
-	.quad	0				/* Load Config Table */
-	.quad	0				/* Bound Import */
-	.quad	0				/* IAT */
-	.quad	0				/* Delay Import Descriptor */
-	.quad	0				/* CLR Runtime Header */
-	.quad	0				/* Reserved */
 
 	/* Section table */
 section_table:
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] riscv: revert Complete efi header for RV32/64
  2022-01-09 17:38 [PATCH 1/1] riscv: revert Complete efi header for RV32/64 Heinrich Schuchardt
@ 2022-01-13  6:41 ` Leo Liang
  0 siblings, 0 replies; 2+ messages in thread
From: Leo Liang @ 2022-01-13  6:41 UTC (permalink / raw)
  To: Heinrich Schuchardt; +Cc: u-boot

On Sun, Jan 09, 2022 at 06:38:55PM +0100, Heinrich Schuchardt wrote:
> EDK II refuses to load the EFI binaries created by U-Boot.
> The reason is an incorrect PE-COFF header. The number of
> data directories does not match NumberOfRvaAndSizes.
> This leads to a failed consistency check in
> PeCoffLoaderGetPeHeader():
> 
>     SizeOfOptionalHeader - HeaderWithoutDataDir) !=
>     NumberOfRvaAndSizes * sizeof(DATA_DIRECTORY))
> 
> Fixes: 9afaeec6ef8b ("riscv: Complete efi header for RV32/64")
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
>  arch/riscv/lib/crt0_riscv_efi.S | 10 ----------
>  1 file changed, 10 deletions(-)

LGTM,
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>

p.s. Out of curiosity, could "change the value (0x6) to (0x10) of the
NumberOfRvaAndSizes" also fix the problem ?

Best regards,
Leo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-13  6:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-09 17:38 [PATCH 1/1] riscv: revert Complete efi header for RV32/64 Heinrich Schuchardt
2022-01-13  6:41 ` Leo Liang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox