diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2014-10-10 12:42:55 -0400 |
---|---|---|
committer | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2014-11-05 03:03:09 -0500 |
commit | a352ea3e197b3aa74deb51728b050cd4a0c6105a (patch) | |
tree | 6515e8871f2366e95bc76dc7cc18f6cf3d044fd1 /arch/arm64/kernel/vmlinux.lds.S | |
parent | ea6bc80d1819f307d98c6562c8ebb2c6c1297d47 (diff) |
arm64/efi: set PE/COFF file alignment to 512 bytes
Change our PE/COFF header to use the minimum file alignment of
512 bytes (0x200), as mandated by the PE/COFF spec v8.3
Also update the linker script so that the Image file itself is also a
round multiple of FileAlignment.
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Roy Franz <roy.franz@linaro.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Diffstat (limited to 'arch/arm64/kernel/vmlinux.lds.S')
-rw-r--r-- | arch/arm64/kernel/vmlinux.lds.S | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S index edf8715ba39b..4596f46d0244 100644 --- a/arch/arm64/kernel/vmlinux.lds.S +++ b/arch/arm64/kernel/vmlinux.lds.S | |||
@@ -32,6 +32,22 @@ jiffies = jiffies_64; | |||
32 | *(.hyp.text) \ | 32 | *(.hyp.text) \ |
33 | VMLINUX_SYMBOL(__hyp_text_end) = .; | 33 | VMLINUX_SYMBOL(__hyp_text_end) = .; |
34 | 34 | ||
35 | /* | ||
36 | * The size of the PE/COFF section that covers the kernel image, which | ||
37 | * runs from stext to _edata, must be a round multiple of the PE/COFF | ||
38 | * FileAlignment, which we set to its minimum value of 0x200. 'stext' | ||
39 | * itself is 4 KB aligned, so padding out _edata to a 0x200 aligned | ||
40 | * boundary should be sufficient. | ||
41 | */ | ||
42 | PECOFF_FILE_ALIGNMENT = 0x200; | ||
43 | |||
44 | #ifdef CONFIG_EFI | ||
45 | #define PECOFF_EDATA_PADDING \ | ||
46 | .pecoff_edata_padding : { BYTE(0); . = ALIGN(PECOFF_FILE_ALIGNMENT); } | ||
47 | #else | ||
48 | #define PECOFF_EDATA_PADDING | ||
49 | #endif | ||
50 | |||
35 | SECTIONS | 51 | SECTIONS |
36 | { | 52 | { |
37 | /* | 53 | /* |
@@ -103,6 +119,7 @@ SECTIONS | |||
103 | _data = .; | 119 | _data = .; |
104 | _sdata = .; | 120 | _sdata = .; |
105 | RW_DATA_SECTION(64, PAGE_SIZE, THREAD_SIZE) | 121 | RW_DATA_SECTION(64, PAGE_SIZE, THREAD_SIZE) |
122 | PECOFF_EDATA_PADDING | ||
106 | _edata = .; | 123 | _edata = .; |
107 | 124 | ||
108 | BSS_SECTION(0, 0, 0) | 125 | BSS_SECTION(0, 0, 0) |