summaryrefslogtreecommitdiffstats
path: root/drivers/firmware/efi/libstub/zboot.lds
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2023-04-18 15:49:49 +0200
committerArd Biesheuvel <ardb@kernel.org>2023-04-26 18:01:41 +0200
commit45dd403da851124412d32e3193c21de4a51d29da (patch)
treedb4606bec41de6a73ca1a9929840f73520207266 /drivers/firmware/efi/libstub/zboot.lds
parentefi/zboot: Set forward edge CFI compat header flag if supported (diff)
downloadlinux-45dd403da851124412d32e3193c21de4a51d29da.tar.xz
linux-45dd403da851124412d32e3193c21de4a51d29da.zip
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>
Diffstat (limited to '')
-rw-r--r--drivers/firmware/efi/libstub/zboot.lds7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/firmware/efi/libstub/zboot.lds b/drivers/firmware/efi/libstub/zboot.lds
index 93d33f68333b..ac8c0ef85158 100644
--- a/drivers/firmware/efi/libstub/zboot.lds
+++ b/drivers/firmware/efi/libstub/zboot.lds
@@ -2,6 +2,8 @@
ENTRY(__efistub_efi_zboot_header);
+PROVIDE(zboot_code_size = ABSOLUTE(0));
+
SECTIONS
{
.head : ALIGN(4096) {
@@ -17,6 +19,11 @@ SECTIONS
*(.gzdata)
__efistub__gzdata_end = .;
*(.rodata* .init.rodata* .srodata*)
+
+ . = ALIGN(4);
+ __efistub_code_size = .;
+ LONG(zboot_code_size);
+
_etext = ALIGN(4096);
. = _etext;
}