Remove arch-specific coff headers
If we use IMAGE_FILE_MACHINE_AMD64 instead of AMD64MAGIC, we can avoid including the arch-specific coff/x86_64 header. Based on a patch from Maxim Kammerer <mk@dee.su>. Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>
This commit is contained in:
parent
1c8fac1fbe
commit
e027b87cff
5 changed files with 2 additions and 134 deletions
2
image.c
2
image.c
|
@ -117,7 +117,7 @@ static int image_pecoff_parse(struct image *image)
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (pehdr_u16(image->pehdr->f_magic) != AMD64MAGIC) {
|
||||
if (pehdr_u16(image->pehdr->f_magic) != IMAGE_FILE_MACHINE_AMD64) {
|
||||
fprintf(stderr, "Invalid PE header magic for x86_64\n");
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue