Displaying 6 results from an estimated 6 matches for "section_align".
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
...o_hdr.major_linker_version = 0x02;
o_hdr.minor_linker_version = 0x14;
- o_hdr.code_sz = total_sz;
+ o_hdr.code_sz = data_size;
o_hdr.entry_point = entry;
o_hdr.initialized_data_sz = data_size;
fwrite(&o_hdr, sizeof(o_hdr), 1, f);
memset(&e_hdr, 0, sizeof(e_hdr));
e_hdr.section_align = 4096;
e_hdr.file_align = 512;
- e_hdr.image_sz = total_sz;
- e_hdr.headers_sz = 512;
+ e_hdr.image_sz = hdr_sz + so_size;
+ e_hdr.headers_sz = hdr_sz;
e_hdr.subsystem = IMAGE_SUBSYSTEM_EFI_APPLICATION;
e_hdr.rva_and_sizes_nr = sizeof(e_hdr.data_directory) / sizeof(__uint64_t);
fwr...
2013 Dec 01
0
[PATCH v2 4/4] efi: PE file size differ from in-memory size
...,
- __uint32_t so_size, __uint8_t class)
+ __uint32_t so_memsz, __uint8_t class)
{
struct optional_hdr o_hdr;
struct optional_hdr_pe32p o_hdr_pe32p;
@@ -100,7 +100,7 @@ static void write_header(FILE *f, __uint32_t entry, size_t data_size,
memset(&e_hdr, 0, sizeof(e_hdr));
e_hdr.section_align = 4096;
e_hdr.file_align = 512;
- e_hdr.image_sz = hdr_sz + so_size;
+ e_hdr.image_sz = hdr_sz + so_memsz;
e_hdr.headers_sz = hdr_sz;
e_hdr.subsystem = IMAGE_SUBSYSTEM_EFI_APPLICATION;
e_hdr.rva_and_sizes_nr = sizeof(e_hdr.data_directory) / sizeof(__uint64_t);
@@ -123,7 +123,7 @@ stat...
2013 Nov 27
0
[PATCH 4/4] efi: PE file size differ from in-memory size
...ze,
- __uint32_t so_size, __uint8_t class)
+ __uint32_t so_memsz, __uint8_t class)
{
struct optional_hdr o_hdr;
struct optional_hdr_pe32p o_hdr_pe32p;
@@ -96,7 +96,7 @@ static void write_header(FILE *f, __uint32_t entry, size_t data_size,
memset(&e_hdr, 0, sizeof(e_hdr));
e_hdr.section_align = 4096;
e_hdr.file_align = 512;
- e_hdr.image_sz = hdr_sz + so_size;
+ e_hdr.image_sz = hdr_sz + so_memsz;
e_hdr.headers_sz = hdr_sz;
e_hdr.subsystem = IMAGE_SUBSYSTEM_EFI_APPLICATION;
e_hdr.rva_and_sizes_nr = sizeof(e_hdr.data_directory) / sizeof(__uint64_t);
@@ -119,7 +119,7 @@ stat...
2013 Dec 01
0
[PATCH v2 3/4] efi: Useless relocations in PE file
...eader(FILE *f, __uint32_t entry, size_t data_size,
o_hdr_pe32p.entry_point = entry;
o_hdr.initialized_data_sz = data_size;
fwrite(&o_hdr_pe32p, sizeof(o_hdr_pe32p), 1, f);
- memset(&e_hdr_pe32p, 0, sizeof(e_hdr));
+ memset(&e_hdr_pe32p, 0, sizeof(e_hdr_pe32p));
e_hdr_pe32p.section_align = 4096;
e_hdr_pe32p.file_align = 512;
e_hdr_pe32p.image_sz = hdr_sz + so_size;
@@ -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_...
2013 Nov 27
0
[PATCH 3/4] efi: Useless relocations in PE file
...eader(FILE *f, __uint32_t entry, size_t data_size,
o_hdr_pe32p.entry_point = entry;
o_hdr.initialized_data_sz = data_size;
fwrite(&o_hdr_pe32p, sizeof(o_hdr_pe32p), 1, f);
- memset(&e_hdr_pe32p, 0, sizeof(e_hdr));
+ memset(&e_hdr_pe32p, 0, sizeof(e_hdr_pe32p));
e_hdr_pe32p.section_align = 4096;
e_hdr_pe32p.file_align = 512;
e_hdr_pe32p.image_sz = hdr_sz + so_size;
@@ -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_...