diff options
author | Jordan Justen <jordan.l.justen@intel.com> | 2012-03-23 12:35:04 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2012-03-26 16:08:33 -0400 |
commit | 2e064b1e131eba262c0ba4268cb79dbc72edeece (patch) | |
tree | 51948df7cca8591d0476b84594cb76c506c63431 /arch/x86/boot/header.S | |
parent | c16fa4f2ad19908a47c63d8fa436a1178438c7e7 (diff) |
x86, efi: Fix issue of overlapping .reloc section for EFI_STUB
Previously the .reloc section was embedded in the .text
section.
No relocations are required during the PE/COFF loading phase
for the kernel using the EFI_STUB UEFI loader. To fix the
issue of overlapping sections, create a .reloc section with a
zero length.
The .reloc section header must exist to make sure the image
will be loaded by the UEFI firmware, but a zero-length
section header seems to be sufficient.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Link: http://lkml.kernel.org/r/1332520506-6472-2-git-send-email-jordan.l.justen@intel.com
Acked-by: Matt Fleming <matt.fleming@intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/boot/header.S')
-rw-r--r-- | arch/x86/boot/header.S | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S index f1bbeeb09148..4e9124b148c2 100644 --- a/arch/x86/boot/header.S +++ b/arch/x86/boot/header.S | |||
@@ -217,18 +217,17 @@ section_table: | |||
217 | 217 | ||
218 | # | 218 | # |
219 | # The EFI application loader requires a relocation section | 219 | # The EFI application loader requires a relocation section |
220 | # because EFI applications are relocatable and not having | 220 | # because EFI applications must be relocatable. But since |
221 | # this section seems to confuse it. But since we don't need | 221 | # we don't need the loader to fixup any relocs for us, we |
222 | # the loader to fixup any relocs for us just fill it with a | 222 | # just create an empty (zero-length) .reloc section header. |
223 | # single dummy reloc. | ||
224 | # | 223 | # |
225 | .ascii ".reloc" | 224 | .ascii ".reloc" |
226 | .byte 0 | 225 | .byte 0 |
227 | .byte 0 | 226 | .byte 0 |
228 | .long reloc_end - reloc_start | 227 | .long 0 |
229 | .long reloc_start | 228 | .long 0 |
230 | .long reloc_end - reloc_start # SizeOfRawData | 229 | .long 0 # SizeOfRawData |
231 | .long reloc_start # PointerToRawData | 230 | .long 0 # PointerToRawData |
232 | .long 0 # PointerToRelocations | 231 | .long 0 # PointerToRelocations |
233 | .long 0 # PointerToLineNumbers | 232 | .long 0 # PointerToLineNumbers |
234 | .word 0 # NumberOfRelocations | 233 | .word 0 # NumberOfRelocations |
@@ -469,10 +468,3 @@ setup_corrupt: | |||
469 | 468 | ||
470 | .data | 469 | .data |
471 | dummy: .long 0 | 470 | dummy: .long 0 |
472 | |||
473 | .section .reloc | ||
474 | reloc_start: | ||
475 | .long dummy - reloc_start | ||
476 | .long 10 | ||
477 | .word 0 | ||
478 | reloc_end: | ||