diff options
author | Arvind Sankar <[email protected]> | 2020-03-08 09:08:48 +0100 |
---|---|---|
committer | Ingo Molnar <[email protected]> | 2020-03-08 09:58:20 +0100 |
commit | 26725192c46e1e543ed86a06823fa591cd6faf58 (patch) | |
tree | dfe983cce255b3266165d653f5f9c9189207f287 | |
parent | 1887c9b653f99577c0f8ec413b0921a32b6129e2 (diff) |
efi/x86: Add kernel preferred address to PE header
Store the kernel's link address as ImageBase in the PE header. Note that
the PE specification requires the ImageBase to be 64k aligned. The
preferred address should almost always satisfy that, except for 32-bit
kernel if the configuration has been customized.
Signed-off-by: Arvind Sankar <[email protected]>
Signed-off-by: Ard Biesheuvel <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
-rw-r--r-- | arch/x86/boot/header.S | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S index 4ee25e28996f..735ad7f21ab0 100644 --- a/arch/x86/boot/header.S +++ b/arch/x86/boot/header.S @@ -138,10 +138,12 @@ optional_header: #endif extra_header_fields: + # PE specification requires ImageBase to be 64k aligned + .set image_base, (LOAD_PHYSICAL_ADDR + 0xffff) & ~0xffff #ifdef CONFIG_X86_32 - .long 0 # ImageBase + .long image_base # ImageBase #else - .quad 0 # ImageBase + .quad image_base # ImageBase #endif .long 0x20 # SectionAlignment .long 0x20 # FileAlignment |