@@ -153,6 +153,34 @@ section_table:
IMAGE_SCN_MEM_READ | \
IMAGE_SCN_MEM_DISCARDABLE # Characteristics
+ .ascii ".text"
+ .byte 0
+ .byte 0
+ .byte 0
+ .long ZO__data
+ .long setup_size
+ .long ZO__data # Size of initialized data
+ # on disk
+ .long setup_size
+ .long 0 # PointerToRelocations
+ .long 0 # PointerToLineNumbers
+ .word 0 # NumberOfRelocations
+ .word 0 # NumberOfLineNumbers
+ .long IMAGE_SCN_CNT_CODE | \
+ IMAGE_SCN_MEM_READ | \
+ IMAGE_SCN_MEM_EXECUTE # Characteristics
+
+ .ascii ".data\0\0\0"
+ .long ZO__end - ZO__data # VirtualSize
+ .long setup_size + ZO__data # VirtualAddress
+ .long ZO__edata - ZO__data # SizeOfRawData
+ .long setup_size + ZO__data # PointerToRawData
+
+ .long 0, 0, 0
+ .long IMAGE_SCN_CNT_INITIALIZED_DATA | \
+ IMAGE_SCN_MEM_READ | \
+ IMAGE_SCN_MEM_WRITE # Characteristics
+
#ifdef CONFIG_EFI_MIXED
.asciz ".compat"
@@ -185,34 +213,6 @@ pecompat_fstart:
.set pecompat_vsize, 0
.set pecompat_fstart, setup_size
#endif
- .ascii ".text"
- .byte 0
- .byte 0
- .byte 0
- .long ZO__data
- .long setup_size
- .long ZO__data # Size of initialized data
- # on disk
- .long setup_size
- .long 0 # PointerToRelocations
- .long 0 # PointerToLineNumbers
- .word 0 # NumberOfRelocations
- .word 0 # NumberOfLineNumbers
- .long IMAGE_SCN_CNT_CODE | \
- IMAGE_SCN_MEM_READ | \
- IMAGE_SCN_MEM_EXECUTE # Characteristics
-
- .ascii ".data\0\0\0"
- .long ZO__end - ZO__data # VirtualSize
- .long setup_size + ZO__data # VirtualAddress
- .long ZO__edata - ZO__data # SizeOfRawData
- .long setup_size + ZO__data # PointerToRawData
-
- .long 0, 0, 0
- .long IMAGE_SCN_CNT_INITIALIZED_DATA | \
- IMAGE_SCN_MEM_READ | \
- IMAGE_SCN_MEM_WRITE # Characteristics
-
.set section_count, (. - section_table) / 40
#endif /* CONFIG_EFI_STUB */
Image loaders which check the contiguity of executable images consider sections adjacent in the section table to be adjacent in virtual memory. Sort sections by their RVAs in PE section table. Signed-off-by: Evgeniy Baskov <baskov@ispras.ru> --- arch/x86/boot/header.S | 56 +++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 28 deletions(-)