efi/zboot: arm64: Inject kernel code size symbol into the zboot payload
authorArd Biesheuvel <ardb@kernel.org>
Tue, 18 Apr 2023 13:49:49 +0000 (15:49 +0200)
committerArd Biesheuvel <ardb@kernel.org>
Wed, 26 Apr 2023 16:01:41 +0000 (18:01 +0200)
commit45dd403da851124412d32e3193c21de4a51d29da
treedb4606bec41de6a73ca1a9929840f73520207266
parent538bc0f40b364f2c7b81f11aa163f723b138b40f
efi/zboot: arm64: Inject kernel code size symbol into the zboot payload

The EFI zboot code is not built as part of the kernel proper, like the
ordinary EFI stub, but still needs access to symbols that are defined
only internally in the kernel, and are left unexposed deliberately to
avoid creating ABI inadvertently that we're stuck with later.

So capture the kernel code size of the kernel image, and inject it as an
ELF symbol into the object that contains the compressed payload, where
it will be accessible to zboot code that needs it.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
arch/arm64/boot/Makefile
arch/arm64/kernel/image-vars.h
drivers/firmware/efi/libstub/Makefile.zboot
drivers/firmware/efi/libstub/zboot.lds