x86/boot: Derive file size from _edata symbol
authorArd Biesheuvel <ardb@kernel.org>
Fri, 15 Sep 2023 17:16:28 +0000 (17:16 +0000)
committerIngo Molnar <mingo@kernel.org>
Sun, 17 Sep 2023 17:48:42 +0000 (19:48 +0200)
commitaeb92067f6ae994b541d7f9752fe54ed3d108bcc
tree9686e3eb1e5406df36e43aa5b6b5776978681976
parent093ab258e3fb1d1d3afdfd4a69403d44ce90e360
x86/boot: Derive file size from _edata symbol

Tweak the linker script so that the value of _edata represents the
decompressor binary's file size rounded up to the appropriate alignment.
This removes the need to calculate it in the build tool, and will make
it easier to refer to the file size from the header directly in
subsequent changes to the PE header layout.

While adding _edata to the sed regex that parses the compressed
vmlinux's symbol list, tweak the regex a bit for conciseness.

This change has no impact on the resulting bzImage binary when
configured with CONFIG_EFI_STUB=y.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20230915171623.655440-14-ardb@google.com
arch/x86/boot/Makefile
arch/x86/boot/compressed/vmlinux.lds.S
arch/x86/boot/header.S
arch/x86/boot/tools/build.c