@@ -47,7 +47,6 @@ typedef unsigned int u32;
47
47
/* This must be large enough to hold the entire setup */
48
48
u8 buf [SETUP_SECT_MAX * 512 ];
49
49
50
- #define PECOFF_RELOC_RESERVE 0x20
51
50
#define PECOFF_COMPAT_RESERVE 0x20
52
51
53
52
static unsigned long efi32_pe_entry ;
@@ -180,24 +179,13 @@ static void update_pecoff_section_header(char *section_name, u32 offset, u32 siz
180
179
update_pecoff_section_header_fields (section_name , offset , size , size , offset );
181
180
}
182
181
183
- static void update_pecoff_setup_and_reloc (unsigned int size )
182
+ static void update_pecoff_setup (unsigned int size )
184
183
{
185
184
u32 setup_offset = 0x200 ;
186
- u32 reloc_offset = size - PECOFF_RELOC_RESERVE - PECOFF_COMPAT_RESERVE ;
187
- #ifdef CONFIG_EFI_MIXED
188
- u32 compat_offset = reloc_offset + PECOFF_RELOC_RESERVE ;
189
- #endif
190
- u32 setup_size = reloc_offset - setup_offset ;
185
+ u32 compat_offset = size - PECOFF_COMPAT_RESERVE ;
186
+ u32 setup_size = compat_offset - setup_offset ;
191
187
192
188
update_pecoff_section_header (".setup" , setup_offset , setup_size );
193
- update_pecoff_section_header (".reloc" , reloc_offset , PECOFF_RELOC_RESERVE );
194
-
195
- /*
196
- * Modify .reloc section contents with a single entry. The
197
- * relocation is applied to offset 10 of the relocation section.
198
- */
199
- put_unaligned_le32 (reloc_offset + 10 , & buf [reloc_offset ]);
200
- put_unaligned_le32 (10 , & buf [reloc_offset + 4 ]);
201
189
202
190
#ifdef CONFIG_EFI_MIXED
203
191
update_pecoff_section_header (".compat" , compat_offset , PECOFF_COMPAT_RESERVE );
@@ -214,21 +202,10 @@ static void update_pecoff_setup_and_reloc(unsigned int size)
214
202
#endif
215
203
}
216
204
217
- static int reserve_pecoff_reloc_section (int c )
218
- {
219
- /* Reserve 0x20 bytes for .reloc section */
220
- memset (buf + c , 0 , PECOFF_RELOC_RESERVE );
221
- return PECOFF_RELOC_RESERVE ;
222
- }
223
-
224
205
#else
225
206
226
- static inline void update_pecoff_setup_and_reloc (unsigned int size ) {}
207
+ static inline void update_pecoff_setup (unsigned int size ) {}
227
208
228
- static inline int reserve_pecoff_reloc_section (int c )
229
- {
230
- return 0 ;
231
- }
232
209
#endif /* CONFIG_EFI_STUB */
233
210
234
211
static int reserve_pecoff_compat_section (int c )
@@ -307,7 +284,6 @@ int main(int argc, char ** argv)
307
284
fclose (file );
308
285
309
286
c += reserve_pecoff_compat_section (c );
310
- c += reserve_pecoff_reloc_section (c );
311
287
312
288
/* Pad unused space with zeros */
313
289
setup_sectors = (c + 511 ) / 512 ;
@@ -316,7 +292,7 @@ int main(int argc, char ** argv)
316
292
i = setup_sectors * 512 ;
317
293
memset (buf + c , 0 , i - c );
318
294
319
- update_pecoff_setup_and_reloc (i );
295
+ update_pecoff_setup (i );
320
296
321
297
/* Open and stat the kernel file */
322
298
fd = open (argv [2 ], O_RDONLY );
0 commit comments