• Ard Biesheuvel's avatar
    x86/boot: Define setup size in linker script · 093ab258
    Ard Biesheuvel authored
    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: default avatarArd Biesheuvel <ardb@kernel.org>
    Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
    Link: https://lore.kernel.org/r/20230915171623.655440-13-ardb@google.com
    093ab258
setup.ld 1.2 KB