]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: efi: increase EFI PE/COFF header padding to 64 KB
authorArd Biesheuvel <ardb@kernel.org>
Tue, 27 Oct 2020 07:32:06 +0000 (08:32 +0100)
committerWill Deacon <will@kernel.org>
Wed, 28 Oct 2020 14:02:03 +0000 (14:02 +0000)
commit2310c96d8b6d9d7119a272030f8a0bbb0101d421
tree84d7b18775ce1c3bb67e2a1e40577011a49c712f
parentfcb402b6f2f2bfb8798492fe74368b45ca740783
arm64: efi: increase EFI PE/COFF header padding to 64 KB

Commit 38ef5f5b9492 ("efi/libstub/arm64: align PE/COFF sections to segment
alignment") increased the PE/COFF section alignment to match the minimum
segment alignment of the kernel image, which ensures that the kernel does
not need to be moved around in memory by the EFI stub if it was built as
relocatable.

However, the first PE/COFF section starts at _stext, which is only 4 KB
aligned, and so the section layout is inconsistent. Existing EFI loaders
seem to care little about this, but it is better to clean this up.

So let's pad the header to 64 KB to match the PE/COFF section alignment.

Fixes: 38ef5f5b9492 ("efi/libstub/arm64: align PE/COFF sections to segment alignment")
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20201027073209.2897-2-ardb@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/kernel/efi-header.S