aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2013-05-13 12:39:40 +0100
committerMatt Fleming <matt.fleming@intel.com>2013-05-13 12:39:40 +0100
commit34eeaa3d747284fea6eb44ebc971cb513816cb5e (patch)
treedda85dc4705ecf6b303c3fbc28f965a996a48ab7
parent717a819dd1cd43ba02db703598c172fb6b1819a8 (diff)
parent5de984d3f42258fb49cfb713002a2e2aae4b16a4 (diff)
downloadsyslinux-34eeaa3d747284fea6eb44ebc971cb513816cb5e.tar.gz
syslinux-34eeaa3d747284fea6eb44ebc971cb513816cb5e.tar.xz
syslinux-34eeaa3d747284fea6eb44ebc971cb513816cb5e.zip
Merge branch 'msdos-hdr' into for-hpa/elflink/firmware
-rw-r--r--efi/wrapper.c8
-rw-r--r--efi/wrapper.h4
2 files changed, 11 insertions, 1 deletions
diff --git a/efi/wrapper.c b/efi/wrapper.c
index 0943534c..1b1d5d33 100644
--- a/efi/wrapper.c
+++ b/efi/wrapper.c
@@ -60,6 +60,14 @@ static void write_header(FILE *f, __uint32_t entry, __uint32_t so_size, __uint8_
memset(&hdr, 0, sizeof(hdr));
hdr.msdos_signature = MSDOS_SIGNATURE;
+
+ /*
+ * The relocs table pointer needs to be >= 0x40 for PE files. It
+ * informs things like file(1) that we are not an MS-DOS
+ * executable.
+ */
+ hdr.relocs_ptr = 0x40;
+
hdr.pe_hdr = OFFSETOF(struct header, pe_signature);
hdr.pe_signature = PE_SIGNATURE;
fwrite(&hdr, sizeof(hdr), 1, f);
diff --git a/efi/wrapper.h b/efi/wrapper.h
index 492c262b..4f769914 100644
--- a/efi/wrapper.h
+++ b/efi/wrapper.h
@@ -28,7 +28,9 @@
struct header {
__uint16_t msdos_signature;
- __uint8_t _pad1[0x3c - 2];
+ __uint8_t _pad1[0x16];
+ __uint16_t relocs_ptr;
+ __uint8_t __pad2[0x3c - 0x1a];
__uint32_t pe_hdr;
__uint16_t pe_signature;
__uint16_t _pad2;