efi_loader: fix SectionAlignment, FileAlignment
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Fri, 14 Jan 2022 20:40:15 +0000 (21:40 +0100)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 15 Jan 2022 09:57:22 +0000 (10:57 +0100)
commit9ef5ccaa712238f4ccd3c55f8a7ae6ca28a5a5bf
tree1dffd5c549da54da3d08f1be67adc6a0183f9fd9
parentdfbc2be47edcb5190d161390b50d2dcc5086710e
efi_loader: fix SectionAlignment, FileAlignment

The alignment of sections in the EFI binaries generated by U-Boot is
incorrect.

According to the PE-COFF specification [1] the minimum value for
FileAlignment is 512. If the value of SectionAlignment is
less then the page size, it must equal FileAlignment.

Let's set both values to 512 for the ARM and RISC-V architectures.

[1] https://docs.microsoft.com/en-us/windows/win32/debug/pe-format

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
arch/arm/lib/crt0_aarch64_efi.S
arch/arm/lib/crt0_arm_efi.S
arch/arm/lib/elf_aarch64_efi.lds
arch/arm/lib/elf_arm_efi.lds
arch/riscv/lib/crt0_riscv_efi.S
arch/riscv/lib/elf_riscv32_efi.lds
arch/riscv/lib/elf_riscv64_efi.lds