Commit f088f0ae by Kai Tietz Committed by Kai Tietz

collect2.c (maybe_lto_object_file): Add x64-coff magic and check.

2010-05-11  Kai Tietz  <kai.tietz@onevision.com>

        * collect2.c (maybe_lto_object_file): Add x64-coff magic and check.

From-SVN: r159272
parent 94f64249
2010-05-11 Kai Tietz <kai.tietz@onevision.com>
* collect2.c (maybe_lto_object_file): Add x64-coff magic and check.
2010-05-11 Jan Hubicka <jh@suse.cz> 2010-05-11 Jan Hubicka <jh@suse.cz>
* lto-cgraph.c (output_cgraph): Remove loop adding all varpool nodes * lto-cgraph.c (output_cgraph): Remove loop adding all varpool nodes
......
...@@ -2574,6 +2574,7 @@ maybe_lto_object_file (const char *prog_name) ...@@ -2574,6 +2574,7 @@ maybe_lto_object_file (const char *prog_name)
static unsigned char elfmagic[4] = { 0x7f, 'E', 'L', 'F' }; static unsigned char elfmagic[4] = { 0x7f, 'E', 'L', 'F' };
static unsigned char coffmagic[2] = { 0x4c, 0x01 }; static unsigned char coffmagic[2] = { 0x4c, 0x01 };
static unsigned char coffmagic_x64[2] = { 0x64, 0x86 };
static unsigned char machomagic[4][4] = { static unsigned char machomagic[4][4] = {
{ 0xcf, 0xfa, 0xed, 0xfe }, { 0xcf, 0xfa, 0xed, 0xfe },
{ 0xce, 0xfa, 0xed, 0xfe }, { 0xce, 0xfa, 0xed, 0xfe },
...@@ -2589,7 +2590,8 @@ maybe_lto_object_file (const char *prog_name) ...@@ -2589,7 +2590,8 @@ maybe_lto_object_file (const char *prog_name)
fclose (f); fclose (f);
if (memcmp (buf, elfmagic, sizeof (elfmagic)) == 0 if (memcmp (buf, elfmagic, sizeof (elfmagic)) == 0
|| memcmp (buf, coffmagic, sizeof (coffmagic)) == 0) || memcmp (buf, coffmagic, sizeof (coffmagic)) == 0
|| memcmp (buf, coffmagic_x64, sizeof (coffmagic_x64)) == 0)
return true; return true;
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
if (memcmp (buf, machomagic[i], sizeof (machomagic[i])) == 0) if (memcmp (buf, machomagic[i], sizeof (machomagic[i])) == 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment