1
2
3
4
5
6
7 #include <linux/pe.h>
8 #include <linux/sizes.h>
9
10 .macro __EFI_PE_HEADER
11 .long PE_MAGIC
12 coff_header:
13 .short IMAGE_FILE_MACHINE_ARM64
14 .short section_count
15 .long 0
16 .long 0
17 .long 0
18 .short section_table - optional_header
19 .short IMAGE_FILE_DEBUG_STRIPPED | \
20 IMAGE_FILE_EXECUTABLE_IMAGE | \
21 IMAGE_FILE_LINE_NUMS_STRIPPED
22
23 optional_header:
24 .short PE_OPT_MAGIC_PE32PLUS
25 .byte 0x02
26 .byte 0x14
27 .long __initdata_begin - efi_header_end
28 .long __pecoff_data_size
29 .long 0
30 .long __efistub_entry - _head
31 .long efi_header_end - _head
32
33 extra_header_fields:
34 .quad 0
35 .long SZ_4K
36 .long PECOFF_FILE_ALIGNMENT
37 .short 0
38 .short 0
39 .short 0
40 .short 0
41 .short 0
42 .short 0
43 .long 0
44
45 .long _end - _head
46
47
48 .long efi_header_end - _head
49 .long 0
50 .short IMAGE_SUBSYSTEM_EFI_APPLICATION
51 .short 0
52 .quad 0
53 .quad 0
54 .quad 0
55 .quad 0
56 .long 0
57 .long (section_table - .) / 8
58
59 .quad 0
60 .quad 0
61 .quad 0
62 .quad 0
63 .quad 0
64 .quad 0
65
66 #ifdef CONFIG_DEBUG_EFI
67 .long efi_debug_table - _head
68 .long efi_debug_table_size
69 #endif
70
71
72 section_table:
73 .ascii ".text\0\0\0"
74 .long __initdata_begin - efi_header_end
75 .long efi_header_end - _head
76 .long __initdata_begin - efi_header_end
77 .long efi_header_end - _head
78
79 .long 0
80 .long 0
81 .short 0
82 .short 0
83 .long IMAGE_SCN_CNT_CODE | \
84 IMAGE_SCN_MEM_READ | \
85 IMAGE_SCN_MEM_EXECUTE
86
87 .ascii ".data\0\0\0"
88 .long __pecoff_data_size
89 .long __initdata_begin - _head
90 .long __pecoff_data_rawsize
91 .long __initdata_begin - _head
92
93 .long 0
94 .long 0
95 .short 0
96 .short 0
97 .long IMAGE_SCN_CNT_INITIALIZED_DATA | \
98 IMAGE_SCN_MEM_READ | \
99 IMAGE_SCN_MEM_WRITE
100
101 .set section_count, (. - section_table) / 40
102
103 #ifdef CONFIG_DEBUG_EFI
104
105
106
107
108
109
110
111
112
113
114 __INITRODATA
115
116 .align 2
117 efi_debug_table:
118
119 .long 0
120 .long 0
121 .short 0
122 .short 0
123 .long IMAGE_DEBUG_TYPE_CODEVIEW
124 .long efi_debug_entry_size
125 .long 0
126 .long efi_debug_entry - _head
127
128 .set efi_debug_table_size, . - efi_debug_table
129 .previous
130
131 efi_debug_entry:
132
133 .ascii "NB10"
134 .long 0
135 .long 0
136 .long 0
137
138 .asciz VMLINUX_PATH
139
140 .set efi_debug_entry_size, . - efi_debug_entry
141 #endif
142
143
144
145
146
147
148
149
150 .align 12
151 efi_header_end:
152 .endm