diff options
-rw-r--r-- | src/util/elf2efi.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/util/elf2efi.c b/src/util/elf2efi.c index 007453e2..b28c7ef3 100644 --- a/src/util/elf2efi.c +++ b/src/util/elf2efi.c @@ -614,8 +614,11 @@ static void write_pe_file ( struct pe_header *pe_header, struct pe_section *section; unsigned long fpos = 0; + /* Align length of headers */ + fpos = pe_header->nt.OptionalHeader.SizeOfHeaders = + efi_file_align ( pe_header->nt.OptionalHeader.SizeOfHeaders ); + /* Assign raw data pointers */ - fpos = efi_file_align ( pe_header->nt.OptionalHeader.SizeOfHeaders ); for ( section = pe_sections ; section ; section = section->next ) { if ( section->hdr.SizeOfRawData ) { section->hdr.PointerToRawData = fpos; |