diff options
author | Ard Biesheuvel <ardb@kernel.org> | 2023-09-15 19:16:27 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2023-09-17 19:48:42 +0200 |
commit | 093ab258e3fb1d1d3afdfd4a69403d44ce90e360 (patch) | |
tree | fe7a28a2747566f6c1244bdea4e13ae917413fea /arch/x86/boot/header.S | |
parent | x86/boot: Set EFI handover offset directly in header asm (diff) | |
download | linux-093ab258e3fb1d1d3afdfd4a69403d44ce90e360.tar.xz linux-093ab258e3fb1d1d3afdfd4a69403d44ce90e360.zip |
x86/boot: Define setup size in linker script
The setup block contains the real mode startup code that is used when
booting from a legacy BIOS, along with the boot_params/setup_data that
is used by legacy x86 bootloaders to pass the command line and initial
ramdisk parameters, among other things.
The setup block also contains the PE/COFF header of the entire combined
image, which includes the compressed kernel image, the decompressor and
the EFI stub.
This PE header describes the layout of the executable image in memory,
and currently, the fact that the setup block precedes it makes it rather
fiddly to get the right values into the right place in the final image.
Let's make things a bit easier by defining the setup_size in the linker
script so it can be referenced from the asm code directly, rather than
having to rely on the build tool to calculate it. For the time being,
add 64 bytes of fixed padding for the .reloc and .compat sections - this
will be removed in a subsequent patch after the PE/COFF header has been
reorganized.
This change has no impact on the resulting bzImage binary when
configured with CONFIG_EFI_MIXED=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-13-ardb@google.com
Diffstat (limited to 'arch/x86/boot/header.S')
-rw-r--r-- | arch/x86/boot/header.S | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S index 72744ba440f6..06bd72a324c1 100644 --- a/arch/x86/boot/header.S +++ b/arch/x86/boot/header.S @@ -231,7 +231,7 @@ sentinel: .byte 0xff, 0xff /* Used to detect broken loaders */ .globl hdr hdr: -setup_sects: .byte 0 /* Filled in by build.c */ + .byte setup_sects - 1 root_flags: .word ROOT_RDONLY syssize: .long 0 /* Filled in by build.c */ ram_size: .word 0 /* Obsolete */ |