search for: virtual_sz

Displaying 4 results from an estimated 4 matches for "virtual_sz".

2013 Nov 27
20
[PATCH 0/4] efi: PE header generation fix
The PE headers of the generated efi file were quite buggy. And since OVMF perform a few consistency checks, syslinux was unable to run on it. I don't pretend to have a thorough understanding of the PE+ headers, some bugs may remain. :) Celelibi (4): efi: Fix PE header field rva_and_sizes_nr efi: Location, size and alignment of .text section efi: Useless relocations in PE file efi: PE
2013 Nov 27
0
[PATCH 2/4] efi: Location, size and alignment of .text section
...eof(e_hdr_pe32p.data_directory) / sizeof(__uint64_t); fwrite(&e_hdr_pe32p, sizeof(e_hdr_pe32p), 1, f); @@ -136,8 +130,10 @@ static void write_header(FILE *f, __uint32_t entry, size_t data_size, memset(&t_sec, 0, sizeof(t_sec)); strcpy((char *)t_sec.name, ".text"); - t_sec.virtual_sz = total_sz; - t_sec.raw_data_sz = total_sz; + t_sec.virtual_sz = data_size; + t_sec.virtual_address = hdr_sz; + t_sec.raw_data_sz = t_sec.virtual_sz; + t_sec.raw_data = t_sec.virtual_address; t_sec.characteristics = IMAGE_SCN_CNT_CODE | IMAGE_SCN_ALIGN_16BYTES | IMAGE_SCN_MEM_EXECUTE | IMAG...
2013 Dec 01
0
[PATCH v2 3/4] efi: Useless relocations in PE file
...ze; @@ -144,26 +142,6 @@ static void write_header(FILE *f, __uint32_t entry, size_t data_size, fwrite(&t_sec, sizeof(t_sec), 1, f); /* - * Write our dummy relocation and reloc section. - */ - memset(&r_sec, 0, sizeof(r_sec)); - strcpy((char *)r_sec.name, ".reloc"); - r_sec.virtual_sz = sizeof(c_rel); - r_sec.virtual_address = ftell(f) + sizeof(r_sec); - r_sec.raw_data_sz = r_sec.virtual_sz; - r_sec.raw_data = r_sec.virtual_address; - r_sec.characteristics = IMAGE_SCN_CNT_INITIALIZED_DATA | - IMAGE_SCN_ALIGN_1BYTES | IMAGE_SCN_MEM_DISCARDABLE | - IMAGE_SCN_MEM_READ; - fwrite(&...
2013 Nov 27
0
[PATCH 3/4] efi: Useless relocations in PE file
...ze; @@ -140,26 +138,6 @@ static void write_header(FILE *f, __uint32_t entry, size_t data_size, fwrite(&t_sec, sizeof(t_sec), 1, f); /* - * Write our dummy relocation and reloc section. - */ - memset(&r_sec, 0, sizeof(r_sec)); - strcpy((char *)r_sec.name, ".reloc"); - r_sec.virtual_sz = sizeof(c_rel); - r_sec.virtual_address = ftell(f) + sizeof(r_sec); - r_sec.raw_data_sz = r_sec.virtual_sz; - r_sec.raw_data = r_sec.virtual_address; - r_sec.characteristics = IMAGE_SCN_CNT_INITIALIZED_DATA | - IMAGE_SCN_ALIGN_1BYTES | IMAGE_SCN_MEM_DISCARDABLE | - IMAGE_SCN_MEM_READ; - fwrite(&...